Conversation
This branch has not been deployed
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.
Closes #54.
_make_shared_paramscreated the trainable shared slots withoutshape=, so an RV declared withdimsand noshapekept a type shape of(None, None)after replacement. Under JAX (and MLX), anarangewhose bound comes from such a shape is not concrete, and a trace penalty likept.trace(W @ W.T)lowers to one in the gradient, so compilation failed.The shared slots now take their shape from the init value, as proposed in the issue. Parameters do not resize during a fit, and every existing
set_valuepath (unpack_to_shared,load_fit, staged VFE) writes a value of the same shape, so nothing that worked before is affected. The frozen-Z fallback inminimize_staged_vfegets the same treatment.Tests
test_shared_params_have_static_shape: backend independent. Shared slots fordims-only RVs have concrete shapes (W: (4, 2),kappa_log__: (4,)).test_dims_only_rv_compiles_under_jax: the issue's reproduction, compiled withmode="JAX". Skipped when JAX is not installed, which includes CI since JAX is not a test dependency.Both fail on
mainwith the reported errors and pass with this change. The full suite passes locally (285 tests).📚 Documentation preview 📚: https://ptgp--60.org.readthedocs.build/en/60/