chore: Upgrade MaxText post-training pinned dependencies to JAX 0.11.1 - #5004
chore: Upgrade MaxText post-training pinned dependencies to JAX 0.11.1#5004darisoy wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the dependency generation scripts to support environment-specific constraints and overrides, updates post-training TPU dependencies, and refactors MaxTextCheckpointManager to use Orbax's CheckpointManager directly for saving and restoring model parameters, optimizer states, and input pipeline iterators. The review feedback suggests using uv run --with toml in generate_requirements.sh to ensure the toml library is available when injecting overrides into pyproject.toml without requiring manual installation.
| if [[ -n "$OVERRIDE_REQUIREMENTS" ]]; then | ||
| echo "=== Adding overrides from $OVERRIDE_REQUIREMENTS ===" | ||
|
|
||
| python3 -c " |
There was a problem hiding this comment.
The script uses python3 -c "import toml ..." to inject overrides into pyproject.toml. However, the toml library is not part of the Python standard library and may not be installed in the host or active virtual environment, which would cause the script to fail with a ModuleNotFoundError.
Since uv is already required and used throughout this script, you can use uv run --with toml python3 to execute the Python script. This guarantees that toml is available in a transient environment without requiring manual installation by the developer.
| python3 -c " | |
| uv run --with toml python3 -c " |
There was a problem hiding this comment.
Addressed in commit fdd06ea using uv run --no-project --with toml python3 to execute the Python script in an isolated ephemeral environment without host dependency requirements.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Description
Upgrades MaxText TPU post-training pinned dependencies to JAX 0.11.1 ecosystem:
jax==0.11.1jaxlib==0.11.1libtpu==0.0.46flax==0.12.9optax==0.2.8torch==2.11.0+cpuandtorchvision==0.26.0+cpumpmath<=1.3.0,>=1.3.0,llguidance<1.8.0,>=1.7.0,boto3>=1.34.0,tensorflow==2.20.0,tensorflow-text==2.20.1,tokamax>=0.0.13,xprof<=2.23.0).generate_requirements.shpost-training resolution flow to injectoverride-dependenciesand Linux x86_64 target platform constraints.MaxTextCheckpointManagerindistillation_utils.pyto correctly initialize and delegate to Tunix'sCheckpointManagerwith MaxTextGrainCheckpointHandler.FIXES: b/552616887
cc @bvandermoon @SurbhiJainUSC
Tests
tests/post_training/unit/distillation_checkpointing_test.py(2 passed)tests/post_training/unit/train_distill_test.py(23 passed, 1 skipped)tests/post_training/unit/dpo_trainer_correctness_test.py(2 passed)tests/post_training/unit/(56 passed, 271 skipped)Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.