fix(interop): five bugs found in conversion audit#213
Merged
Conversation
- Add missing input_dilation guard to nnx Conv import (silent data corruption) - Fix norm num extraction to use framework metadata instead of affine params that may be None (crashes on LayerNorm/RMSNorm/GroupNorm without affine) - Fix bst_set_norm to early-return when both scale and offset are None - Fix bst_set_batchnorm to omit None-valued keys from weight dict - Fix lookup_export to avoid O(N) dict rebuild on every call
Contributor
There was a problem hiding this comment.
Sorry @chaoming0625, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Merged
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.
Summary
input_dilation, producing numerically wrong results. Added the same guard as the linen adapter.AttributeErrorwhen all affine parameters were disabled (use_scale=False, use_bias=False). Fixed by extracting feature count from framework metadata (m.num_features,m.shape,layer.in_size) instead of from affine parameter arrays.bst_set_normcrashed when the norm state attribute wasNone(no affine). Added early return.bst_set_batchnormwroteNonevalues into the weight dict. Now omitsNone-valued keys.lookup_exportrebuilt a full dict from_EXPORTon every call. Replaced with direct__mro__-walk over the existing dict.Test plan
input_dilation != 1raisesConversionError🤖 Generated with Claude Code