[Bugfix] vLLM should check Inductor config for compile cache enablement status (#27637)

Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
This commit is contained in:
gmagogsfm
2025-11-05 12:22:44 -05:00
committed by GitHub
parent 752ddeacaa
commit 002b07c4b2
2 changed files with 26 additions and 7 deletions
+5 -2
View File
@@ -33,6 +33,7 @@ from .compiler_interface import (
EagerAdaptor,
InductorAdaptor,
InductorStandaloneAdaptor,
is_compile_cache_enabled,
)
from .counter import compilation_counter
from .inductor_pass import InductorPass
@@ -239,7 +240,7 @@ class CompilerManager:
assert compiled_graph is not None, "Failed to compile the graph"
# store the artifact in the cache
if not envs.VLLM_DISABLE_COMPILE_CACHE and handle is not None:
if is_compile_cache_enabled(additional_inductor_config) and handle is not None:
self.cache[(runtime_shape, graph_index, self.compiler.name)] = handle
compilation_counter.num_cache_entries_updated += 1
self.is_cache_updated = True
@@ -611,7 +612,9 @@ class VllmBackend:
os.makedirs(local_cache_dir, exist_ok=True)
self.compilation_config.local_cache_dir = local_cache_dir
disable_cache = envs.VLLM_DISABLE_COMPILE_CACHE
disable_cache = not is_compile_cache_enabled(
self.compilation_config.inductor_compile_config
)
if disable_cache:
logger.info_once("vLLM's torch.compile cache is disabled.", scope="local")