[BE] Fix compile time message to be consistent (use monitoring) (#40641)

Signed-off-by: Lucas Kabela <lucaskabela@meta.com>
This commit is contained in:
Lucas Kabela
2026-04-23 00:12:08 +00:00
committed by GitHub
parent ac58e2a170
commit 0283f303d8
3 changed files with 14 additions and 15 deletions
+5
View File
@@ -18,6 +18,7 @@ torch_compile_start_time: float = 0.0
def monitor_torch_compile(
vllm_config: VllmConfig,
message: str = "torch.compile took %.2f s in total",
is_encoder: bool = False,
) -> Generator[None, None, None]:
"""Context manager that times torch.compile and manages depyf debugging.
@@ -45,6 +46,10 @@ def monitor_torch_compile(
else:
total_compile_time = time.perf_counter() - torch_compile_start_time
if compilation_config.mode == CompilationMode.VLLM_COMPILE:
if is_encoder:
compilation_config.encoder_compilation_time += total_compile_time
else:
compilation_config.compilation_time += total_compile_time
logger.info_once(message, total_compile_time)
finally:
if depyf_cm is not None: