@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 06be53563b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 7, 15:15 UTC

[Core]Extract is_last_rank in Ray for tpu to override (#33012)

Signed-off-by: Chenyaaang <chenyangli@google.com>

Chenyaaang committed Feb 26, 2026 at 19:18 UTC 06be53563ba24b44d788d43ef1afc99a5aef98f4
1 file changed +4 -1
vllm/v1/executor/ray_utils.py
+4 -1
@@ -108,7 +108,7 @@ try:
108
109 if isinstance(output, AsyncModelRunnerOutput):
110 output = output.get_output()
111 - if not get_pp_group().is_last_rank:
111 + if not self._is_last_rank():
112 # Case where there are no scheduled requests
113 # but may still be finished requests.
114 assert not output or not output.req_ids
@@ -128,6 +128,9 @@ try:
128 def _is_intermediate_tensors(self, output) -> bool:
129 return isinstance(output, IntermediateTensors)
130
131 + def _is_last_rank(self) -> bool:
132 + return get_pp_group().is_last_rank
133 +
134 ray_import_err = None
135
136 except ImportError as e: