Repository navigation
Preserve input shapes when reusing GroupNorm - #907
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
sylvesterkaczmarek
force-pushed
the
fix/group-norm-reused-input-shapes
branch
from
October 7, 2026 15:59
2b89db4 to
d8c8aed
Compare
Author
|
Updated validation is recorded in the PR description for |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compute GroupNorm's reshape dimensions from the current input rather than caching the first input's spatial dimensions. Reusing one module within a forward pass on
(1, 2, 3, 8)followed by(1, 3, 2, 8)currently returns the second result with shape(1, 2, 3, 8). Changing the spatial volume can instead change the inferred batch size or raise a reshape error.The fix keeps the existing rank check, reduction-axis mapping, parameter names, and per-channel parameter shapes. Both channel layouts continue to share one set of scale/offset parameters. This restores the documented same-shape output contract for repeated use at different spatial resolutions.
Newly reproduced on current main
e4dbc6e. Searches of issues and open PRs found no matching fix or ownership claim. This is independent of the pending attention and BatchNorm changes.Validation
macOS arm64 CPU, Python 3.12.11:
python -m pytest -n 2 -q haiku --ignore=haiku/_src/integration --tb=short --maxfail=5completed with 1,591 passed, 34 skipped, 18 passing subtests, and one failure in the unrelatedReshapeTest.test_reshape_convertexport test.git diff --checkpass. Changed-file Pylint errors-only exits successfully; its existing configuration emits obsolete-option diagnostics.GPU/TPU execution, the integration directory, documentation builds, and other operating systems were not tested locally. No existing assertion, tolerance, dependency, or CI configuration was changed.
Validation update on 7 October 2026
Current validated commit
d8c8aed42e9b.Refreshed onto checked current main. Existing component tests and the new regression file pass in the normal default-precision configuration using real JAX CPU execution. 60 passed in 20.30s Pylint error checks and
git diff --checkpass. Only the new test file was formatted; no whole-source rewrite of existing main formatting was added. The complete repository and GPU/TPU matrix were not run locally.The complete upstream workflow result is not claimed from local checks. Fresh fork workflows may require maintainer approval.