fix: pin jax/jaxlib/flax lower bounds to avoid linear_util ImportError#39
Closed
ayaangazali wants to merge 1 commit into
Closed
fix: pin jax/jaxlib/flax lower bounds to avoid linear_util ImportError#39ayaangazali wants to merge 1 commit into
ayaangazali wants to merge 1 commit into
Conversation
pyproject.toml and requirements.txt pinned jax, jaxlib and flax with no lower bounds, so the resolver could select an old Flax (<0.8) that does 'from jax import linear_util' against a modern JAX. jax.linear_util was removed in JAX 0.4.24, producing 'ImportError: cannot import name linear_util' at import time. Add floors (jax>=0.4.30, jaxlib>=0.4.30, flax>=0.8.0) so a compatible set is always resolved. Closes cactus-compute#24 Signed-off-by: ayaangazali <ayaan.gazly@gmail.com>
Author
|
Closing this — we've decided not to pursue contributions to this repo for now. No action needed on your side; feel free to cherry-pick the one-line change if it's useful. Thanks! |
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.
What
Fixes the
ImportError: cannot import name 'linear_util'reported in #24.Why
pyproject.tomlandrequirements.txtpinjax,jaxlibandflaxwith no lower bounds:so a resolver can land on an old Flax (<0.8) that does
from jax import linear_utilwhile pulling a modern JAX.jax.linear_utilwas removed in JAX 0.4.24, so that combination raisesImportError: cannot import name 'linear_util'at import time — exactly what the reporter hit.Fix
Add lower bounds so a compatible set is always selected (in both files):
Flax >= 0.8 no longer imports the removed symbol; JAX >= 0.4.30 is a safe, widely-available floor.
Testing
Fresh venv,
pip install -e ., thenpython -c "import needle":jax 0.10.2 / jaxlib 0.10.2 / flax 0.12.7(all satisfy the floors)import needleandfrom needle.model.architecture import SimpleAttentionNetworksucceedNote: PR #29 proposes removing
requirements.txt; if it merges first, thepyproject.tomlfloors still fully cover this fix.Closes #24