[MRV2] Support breakable CUDA graph (#44050)
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user