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

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

[Core] Simplify MRV2 async output handling (#45442)

Nick Hill committed Jun 13, 2026 at 18:15 UTC cf027b86af71251a8e937a56751636686b4429e4
3 files changed +8 -14
vllm/v1/executor/multiproc_executor.py
+4 -7
@@ -396,9 +396,7 @@ class MultiprocExecutor(Executor):
396 return responses[0] if output_rank is not None else responses
397
398 future = FutureWrapper(
399 - self.futures_queue,
400 - get_response=get_response,
401 - aggregate=aggregate,
399 + self.futures_queue, get_response=get_response, aggregate=aggregate
400 )
401
402 return future if non_block else future.result()
@@ -982,6 +980,9 @@ class WorkerProc:
980 func = partial(cloudpickle.loads(method), self.worker)
981
982 output = func(*args, **kwargs)
983 +
984 + if output_rank is None or self.rank == output_rank:
985 + self.handle_output(output)
986 except Exception as e:
987 # Notes have been introduced in python 3.11
988 if hasattr(e, "add_note"):
@@ -991,10 +992,6 @@ class WorkerProc:
992 # string, only for logging purpose.
993 if output_rank is None or self.rank == output_rank:
994 self.handle_output(e)
994 - continue
995 -
996 - if output_rank is None or self.rank == output_rank:
997 - self.handle_output(output)
995
996 @staticmethod
997 def setup_proc_title_and_log_prefix(enable_ep: bool) -> None:
vllm/v1/executor/uniproc_executor.py
+2
@@ -90,6 +90,8 @@ class UniProcExecutor(Executor):
90
91 if not non_block:
92 result = run_method(self.driver_worker, method, args, kwargs)
93 + if isinstance(result, AsyncModelRunnerOutput):
94 + result = result.get_output()
95 return result if single_value else [result]
96
97 try:
vllm/v1/worker/gpu/model_runner.py
+2 -7
@@ -145,7 +145,6 @@ class GPUModelRunner(LoRAModelRunnerMixin):
145 self.max_num_reqs = self.scheduler_config.max_num_seqs
146 self.is_encoder_decoder = self.model_config.is_encoder_decoder
147
148 - self.use_async_scheduling = self.scheduler_config.async_scheduling
148 self.output_copy_stream = torch.cuda.Stream(self.device)
149
150 # Pipeline parallelism.
@@ -1457,9 +1456,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
1456 kv_connector_output = self.kv_connector.post_forward(finished_req_ids)
1457 model_runner_output.kv_connector_output = kv_connector_output
1458
1460 - if self.use_async_scheduling:
1461 - return async_output
1462 - return async_output.get_output()
1459 + return async_output
1460
1461 def take_draft_token_ids(self) -> DraftTokenIds | None:
1462 return self.draft_tokens_handler.get_draft_tokens()
@@ -1503,9 +1500,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
1500 )
1501
1502 self.postprocess_num_computed_tokens(input_batch)
1506 - if self.use_async_scheduling:
1507 - return async_output
1508 - return async_output.get_output()
1503 + return async_output
1504
1505 def postprocess_num_computed_tokens(self, input_batch: InputBatch) -> None:
1506 # Update the number of computed tokens.