[Bugfix] Include inductor and functorch configs in compilation cache key (#40627)

Signed-off-by: Richard Zou <zou3519@gmail.com>
This commit is contained in:
Richard Zou
2026-04-23 09:52:59 -04:00
committed by GitHub
parent da1e7311ca
commit 424033f4fc
3 changed files with 40 additions and 2 deletions
+2
View File
@@ -56,6 +56,7 @@ def _cold_start(vllm_runner):
def test_moe_startup(monkeypatch, vllm_runner, fresh_vllm_cache, mega_aot_artifact):
monkeypatch.setenv("VLLM_ENABLE_V1_MULTIPROCESSING", "0")
monkeypatch.setenv("VLLM_USE_MEGA_AOT_ARTIFACT", mega_aot_artifact)
monkeypatch.setenv("VLLM_DEEP_GEMM_WARMUP", "skip")
# Cold start in a forked child (must fork before CUDA init).
# This model has 32 identical transformer layers which produce
@@ -235,6 +236,7 @@ def _cold_start_model(vllm_runner, spec: ModelStartupSpec):
@fork_new_process_for_each_test
def test_model_startup(monkeypatch, vllm_runner, fresh_vllm_cache, spec):
monkeypatch.setenv("VLLM_ENABLE_V1_MULTIPROCESSING", "0")
monkeypatch.setenv("VLLM_DEEP_GEMM_WARMUP", "skip")
# Cold start in a forked child (must fork before CUDA init).
ctx = mp.get_context("fork")
+18
View File
@@ -617,6 +617,24 @@ def test_inductor_asserts_enabled_in_debug(monkeypatch):
assert config.inductor_compile_config.get("scalar_asserts") is True
def test_get_inductor_factors_includes_configs():
"""Changing inductor or functorch config must change the cache key factors."""
from torch._functorch import config as functorch_config
from torch._inductor import config as inductor_config
from vllm.compilation.compiler_interface import get_inductor_factors
baseline = get_inductor_factors()
with inductor_config.patch("max_autotune", not inductor_config.max_autotune):
patched = get_inductor_factors()
assert baseline != patched, "inductor config change was not reflected"
with functorch_config.patch("donated_buffer", not functorch_config.donated_buffer):
patched = get_inductor_factors()
assert baseline != patched, "functorch config change was not reflected"
def test_inductor_asserts_user_override(monkeypatch):
"""Test that explicit inductor_compile_config overrides the
debug-logging default."""