[Profiler] Add Proton CUDA graph attribution for MRV2 (#51084)

Signed-off-by: Luossu <zhluosuu@outlook.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
鐘天楽
2026-09-14 19:02:07 +00:00
committed by GitHub
co-authored by Nick Hill
parent 5372e72a98
commit 0a5747d410
8 changed files with 657 additions and 45 deletions
+10
View File
@@ -987,6 +987,16 @@ class GPUModelRunner(LoRAModelRunnerMixin):
"""Estimate the GPU memory required to capture CUDA graphs."""
return _profile_cudagraph_memory(self)
def needs_cudagraph_capture(self) -> bool:
"""Whether capture_model() has any CUDA graphs left to capture."""
return (
self.model_state.supports_mm_inputs
and self.model_state.encoder_runner.has_cudagraph()
) or (
self.cudagraph_manager is not None
and self.cudagraph_manager.needs_capture()
)
@torch.inference_mode()
def capture_model(self, *, profile_only: bool = False) -> int:
assert self.cudagraph_manager is not None