From 06be53563ba24b44d788d43ef1afc99a5aef98f4 Mon Sep 17 00:00:00 2001 From: Chenyaaang <42742451+Chenyaaang@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:18:52 -0800 Subject: [PATCH] [Core]Extract is_last_rank in Ray for tpu to override (#33012) Signed-off-by: Chenyaaang --- vllm/v1/executor/ray_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/v1/executor/ray_utils.py b/vllm/v1/executor/ray_utils.py index 21403e1c0e..67c5a58f7e 100644 --- a/vllm/v1/executor/ray_utils.py +++ b/vllm/v1/executor/ray_utils.py @@ -108,7 +108,7 @@ try: if isinstance(output, AsyncModelRunnerOutput): output = output.get_output() - if not get_pp_group().is_last_rank: + if not self._is_last_rank(): # Case where there are no scheduled requests # but may still be finished requests. assert not output or not output.req_ids @@ -128,6 +128,9 @@ try: def _is_intermediate_tensors(self, output) -> bool: return isinstance(output, IntermediateTensors) + def _is_last_rank(self) -> bool: + return get_pp_group().is_last_rank + ray_import_err = None except ImportError as e: