[tx] replace calls to jax.process_index() to resolve rank ordering issue with multi-host TPUs#1252
Open
andrewsykim wants to merge 11 commits intoNovaSky-AI:mainfrom
Open
[tx] replace calls to jax.process_index() to resolve rank ordering issue with multi-host TPUs#1252andrewsykim wants to merge 11 commits intoNovaSky-AI:mainfrom
andrewsykim wants to merge 11 commits intoNovaSky-AI:mainfrom
Conversation
… and GPU Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Collaborator
|
We will also need to update SkyRL/skyrl-tx/tx/utils/models.py Line 300 in 675851c |
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Author
Updated |
pcmoritz
reviewed
Mar 3, 2026
skyrl/tx/utils/models.py
Outdated
| adapter_config: LoraConfig, | ||
| adapter_index: int, | ||
| output_path: Path | CloudPath, | ||
| rank: int = 0, |
Collaborator
There was a problem hiding this comment.
It would probably be better to remove the default from this, otherwise it is too easy to make a mistake and not specify this in call sites (before, it was kind of doing implicitly the right thing by using jax.process_index(), but now it is important to pass in the right value here).
I can make that change before merging the PR.
Collaborator
|
/gemini review |
pcmoritz
approved these changes
Mar 3, 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.
jax.process_index()is inconsistent between GPU and TPU backends. For GPU / CPU, it returns theprocess_idpassed intojax.distributed.initialize. However, for TPU, the index assignment happens from the TPU slice, regardless of what is assigned fromjax.distributed.initializeor the TPU environment (e.g. TPU_WORKER_ID from GKE). This leads tojax.process_index()returning a different rank from--process-idset from the user.Assuming
jax.process_index()won't be updated in the near future to be consistent across TPU / GPU, this PR updates the SkyRL JAX backend to only use the index provided from the--process-idargument.I've tested this PR on my 4x4 TPU v6e cluster with both Qwen3-0.6B and Qwen3-8B.
Resolves #1024