fix: update Module.param() call in interceptors test for Flax API compatibility #461
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
Fixes test failures in
_interceptors_test.pycaused by using deprecated Flax API forModule.param(). The current Flax version requires an explicitshapeparameter, which was missing in the test code.Problem
Two tests were failing with:
Failing tests:
test_moduletest_module_non_share_scopeRoot Cause
The test was using the old Flax API signature:
Flax's current API requires:
Solution
Updated to use the current Flax API with explicit shape parameter:
This change:
nn.initializers.zerosinstead of lambda function()as a positional argumentChanges
gemma/peft/_interceptors_test.pyTesting
Before fix:
After fix:
Remaining 2 failures: Expected failures requiring Google Cloud Storage checkpoints
Test command:
Impact
Checklist