[Core] Re-enable Inductor pre-grad passes in standalone compile (torch>=2.12) (#38944)

Signed-off-by: Frederik Gossen <frgossen@meta.com>
This commit is contained in:
Frederik Gossen
2026-04-06 12:37:13 -04:00
committed by GitHub
parent 4ae218c122
commit 608914de30

View File

@@ -345,9 +345,9 @@ class InductorStandaloneAdaptor(CompilerInterface):
# Inductor's pre-grad passes don't do anything for vLLM.
# The pre-grad passes get run even on cache-hit and negatively impact
# vllm cold compile times by O(1s)
# Can remove this after the following issue gets fixed
# Fixed upstream in PyTorch 2.12:
# https://github.com/pytorch/pytorch/issues/174502
if envs.VLLM_ENABLE_PREGRAD_PASSES:
if is_torch_equal_or_newer("2.12.0.dev") or envs.VLLM_ENABLE_PREGRAD_PASSES:
pregrad_ctx: Any = contextlib.nullcontext()
else:
pregrad_ctx = patch(