Improve RL parallelism ValueError message and UXR documentation#3960
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
bvandermoon
reviewed
May 20, 2026
khatwanimohit
approved these changes
May 21, 2026
SurbhiJainUSC
approved these changes
May 21, 2026
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.
Description
This PR improves the usability of MaxText Reinforcement Learning (RL) training by enhancing the error message for invalid rollout parallelism configurations and correcting the multi-host RL UXR tutorial documentation.
Why this change is being made
During MaxText 2.0 RL UXR testing (reported in b/497920004), users encountered immediate job failures with a cryptic
ValueErrorwhen submitting training workloads. The root cause was twofold:rl.yml) sets bothrollout_tensor_parallelismandrollout_data_parallelismto-1(auto-derived), which is an invalid state since the system can only auto-derive at most one parameter.rl_on_multi_host.mdtutorial did not override these defaults, leading to out-of-the-box failures for users copying the commands.Solution
ValueErrorintrain_rl.pyto print the resolved values ofrollout_tensor_parallelism,rollout_data_parallelism, androllout_expert_parallelism, and added a concrete suggestion on how to fix it (e.g., addingrollout_tensor_parallelism=4).xpkworkload creation commands inrl_on_multi_host.mdto explicitly includerollout_tensor_parallelism=8(optimal for Llama 3.1 70B onv5p-128GKE clusters).Future Improvements
While this runtime check prevents confusing failures, a future improvement could involve implementing pre-flight validation in the launcher/configuration loader to fail-fast locally before the job is submitted to the GKE queue.
FIXES: b/497920004
Tests
Manual Verification
The changes were implemented and verified on a TPU v6e-4 VM (
darisoy-gvnic-test):train_rl.pyPython file.rl_on_multi_host.mdMarkdown file.git diffto ensure only the intended lines were modified.Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.