Skip to content

Commit 8c0491b

Browse files
committed
[misc] Clean up ray compiled graph type hints
Signed-off-by: Rui Qiao <[email protected]>
1 parent f61528d commit 8c0491b

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

vllm/executor/ray_distributed_executor.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,18 @@ def _compiled_ray_dag(self, enable_asyncio: bool):
528528
envs.VLLM_USE_RAY_COMPILED_DAG_OVERLAP_COMM)
529529
with InputNode() as input_data:
530530
# Example DAG: PP=2, TP=4
531-
# (ExecuteModelReq, None) -> 0 -> (ExecuteModelReq, IntermediateOutput) -> 4 -> SamplerOutput # noqa: E501
532-
# -> 1 -> (ExecuteModelReq, IntermediateOutput) -> 5 -> SamplerOutput # noqa: E501
533-
# -> 2 -> (ExecuteModelReq, IntermediateOutput) -> 6 -> SamplerOutput # noqa: E501
534-
# -> 3 -> (ExecuteModelReq, IntermediateOutput) -> 7 -> SamplerOutput # noqa: E501
531+
#
532+
# For V0:
533+
# ExecuteModelRequest -> 0 -> (ExecuteModelReq, IntermediateTensors) -> 4 -> SamplerOutput # noqa: E501
534+
# ExecuteModelRequest -> 1 -> (ExecuteModelReq, IntermediateTensors) -> 5 -> SamplerOutput # noqa: E501
535+
# ExecuteModelRequest -> 2 -> (ExecuteModelReq, IntermediateTensors) -> 6 -> SamplerOutput # noqa: E501
536+
# ExecuteModelRequest -> 3 -> (ExecuteModelReq, IntermediateTensors) -> 7 -> SamplerOutput # noqa: E501
537+
#
538+
# For V1:
539+
# SchedulerOutput -> 0 -> (SchedulerOutput, IntermediateTensors) -> 4 -> ModelRunnerOutput # noqa: E501
540+
# SchedulerOutput -> 1 -> (SchedulerOutput, IntermediateTensors) -> 5 -> ModelRunnerOutput # noqa: E501
541+
# SchedulerOutput -> 2 -> (SchedulerOutput, IntermediateTensors) -> 6 -> ModelRunnerOutput # noqa: E501
542+
# SchedulerOutput -> 3 -> (SchedulerOutput, IntermediateTensors) -> 7 -> ModelRunnerOutput # noqa: E501
535543

536544
# All workers in the first TP group will take in the
537545
# ExecuteModelRequest as input.

vllm/executor/ray_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ def setup_device_if_necessary(self):
114114

115115
def execute_model_ray(
116116
self,
117-
scheduler_output: "SchedulerOutput",
118-
) -> "ModelRunnerOutput":
117+
scheduler_output: Union["SchedulerOutput",
118+
Tuple["SchedulerOutput",
119+
"IntermediateTensors"]],
120+
) -> Union["ModelRunnerOutput", Tuple["SchedulerOutput",
121+
"IntermediateTensors"]]:
119122
# this method is used to compile ray CG,
120123
# and it needs a special logic of self.setup_device_if_necessary()
121124
self.setup_device_if_necessary()

0 commit comments

Comments
 (0)