[Bugfix][MRV2] Support encoder timing stats in model runner V2 (#50020)

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Guan-Ming Chiu
2026-08-12 00:00:49 +08:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 5426311d91
commit 457a5f34db
7 changed files with 99 additions and 22 deletions
+6
View File
@@ -453,6 +453,12 @@ class GPUModelRunner(LoRAModelRunnerMixin):
# Cache the default CUDA stream to avoid lookup overhead.
return torch.cuda.current_stream(self.device)
def get_encoder_timing_stats(self) -> dict[str, dict[str, float | int]]:
encoder_runner = getattr(self.model_state, "encoder_runner", None)
if encoder_runner is None:
return {}
return encoder_runner.get_encoder_timing_stats()
def get_kv_cache_spec(self):
if self.is_encoder_only:
return {}