[compile] Fix torch.compile time discrepancy in logging. (#34912)

Signed-off-by: zhxchen17 <zhxchen17@fb.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
Zhengxu Chen
2026-02-20 08:47:14 -08:00
committed by GitHub
co-authored by Cyrus Leung
parent e4a5d8c653
commit f863994084
3 changed files with 17 additions and 8 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ torch_compile_start_time: float = 0.0
def start_monitoring_torch_compile(vllm_config: VllmConfig) -> None:
global torch_compile_start_time
torch_compile_start_time = time.time()
torch_compile_start_time = time.perf_counter()
compilation_config: CompilationConfig = vllm_config.compilation_config
path = vllm_config.compile_debug_dump_path()
@@ -30,10 +30,11 @@ def start_monitoring_torch_compile(vllm_config: VllmConfig) -> None:
def end_monitoring_torch_compile(vllm_config: VllmConfig) -> None:
compilation_config: CompilationConfig = vllm_config.compilation_config
total_compile_time: float = time.perf_counter() - torch_compile_start_time
if compilation_config.mode == CompilationMode.VLLM_COMPILE:
logger.info_once(
"torch.compile takes %.2f s in total",
compilation_config.compilation_time,
total_compile_time,
scope="local",
)
global context_manager