Unverified Commit ce6a199e authored by Lucas Kabela's avatar Lucas Kabela Committed by GitHub
Browse files

[BE][Bugfix] Respect TORCH_COMPILE_DISABLE env var at the vLLM config level for torch 2.12 (#40715)


Signed-off-by: default avatarLucas Kabela <lucaskabela@meta.com>
parent f88763ef
......@@ -205,6 +205,22 @@ def test_enforce_eager(vllm_runner, monkeypatch):
pass
@pytest.mark.forked
def test_torch_compile_disable(vllm_runner, monkeypatch):
monkeypatch.setenv("VLLM_ENABLE_V1_MULTIPROCESSING", "0")
monkeypatch.setenv("TORCH_COMPILE_DISABLE", "1")
monkeypatch.setenv("VLLM_DISABLE_COMPILE_CACHE", "1")
with (
compilation_counter.expect(num_graphs_seen=0, stock_torch_compile_count=0),
vllm_runner(
"facebook/opt-125m",
gpu_memory_utilization=0.4,
) as _,
):
pass
def test_splitting_ops_dynamic():
# Default config
config = VllmConfig()
......
......@@ -900,6 +900,13 @@ class VllmConfig:
self.compilation_config.mode = CompilationMode.NONE
self.compilation_config.cudagraph_mode = CUDAGraphMode.NONE
if os.environ.get("TORCH_COMPILE_DISABLE") == "1":
logger.warning(
"TORCH_COMPILE_DISABLE is set, disabling torch.compile. "
"This is equivalent to setting -cc.mode=none"
)
self.compilation_config.mode = CompilationMode.NONE
if self.compilation_config.backend == "eager" or (
self.compilation_config.mode is not None
and self.compilation_config.mode != CompilationMode.VLLM_COMPILE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment