[MRV2] Support breakable CUDA graph (#44050)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
This commit is contained in:
Woosuk Kwon
2026-05-30 09:40:52 -07:00
committed by GitHub
parent e1105064b2
commit 27fa5aa3b9
3 changed files with 59 additions and 5 deletions
+11 -1
View File
@@ -1189,7 +1189,17 @@ class GPUModelRunner(LoRAModelRunnerMixin):
skip_compiled=skip_compiled,
):
self.kv_connector.pre_forward(scheduler_output)
model_output = self.model(**model_inputs)
if batch_desc.cg_mode == CUDAGraphMode.PIECEWISE:
# Run the PIECEWISE graph (compiled PW cudagraph or breakable
# cudagraph, chosen inside run_pw_graph). cg_mode is only
# PIECEWISE after the cudagraph manager exists.
assert self.cudagraph_manager is not None
model_output = self.cudagraph_manager.run_pw_graph(
self.model, model_inputs
)
else:
# Eager (NONE): call the raw model directly.
model_output = self.model(**model_inputs)
if self.is_last_pp_rank:
if self.use_aux_hidden_state_outputs: