[Core]Extract is_last_rank in Ray for tpu to override#33012
Merged
DarkLight1337 merged 3 commits intovllm-project:mainfrom Feb 27, 2026
Merged
[Core]Extract is_last_rank in Ray for tpu to override#33012DarkLight1337 merged 3 commits intovllm-project:mainfrom
DarkLight1337 merged 3 commits intovllm-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a small but important refactoring in vllm/v1/executor/ray_utils.py. It extracts the logic for determining if a worker is the last rank in a pipeline parallel group, get_pp_group().is_last_rank, into a new method _is_last_rank() within the RayWorkerWrapper class. This change is well-motivated, as it enables platform-specific implementations, like for TPUs, to override this behavior. The implementation is clean and correct. I have no concerns with this pull request.
Signed-off-by: Chenyaaang <chenyangli@google.com>
kouroshHakha
approved these changes
Feb 13, 2026
Collaborator
kouroshHakha
left a comment
There was a problem hiding this comment.
LGTM. it's a no op to the current implementation. Just a refactor.
DarkLight1337
approved these changes
Feb 14, 2026
antonovsergey93
pushed a commit
to antonovsergey93/vllm
that referenced
this pull request
Feb 27, 2026
…3012) Signed-off-by: Chenyaaang <chenyangli@google.com>
Copilot AI
pushed a commit
to machov/vllm
that referenced
this pull request
Mar 10, 2026
…3012) Signed-off-by: Chenyaaang <chenyangli@google.com>
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.
Extract Ray's
get_pp_group().is_last_rankas a separate methodis_last_rank, so that TPU can override it.