[Model Refactoring] Remove torch compile dependency in DSv4 (#43746)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
This commit is contained in:
Woosuk Kwon
2026-05-28 14:26:25 +00:00
committed by GitHub
parent 864990e8d9
commit 9957e4d240
8 changed files with 270 additions and 24 deletions
+17
View File
@@ -1044,6 +1044,23 @@ class VllmConfig:
)
self.compilation_config.mode = CompilationMode.NONE
# DeepSeek V4's model classes don't carry @support_torch_compile —
# the breakable cudagraph is the supported PIECEWISE path. Auto-enable
# it unless the user has explicitly opted out via the env var.
if (
self.model_config is not None
and "VLLM_USE_BREAKABLE_CUDAGRAPH" not in os.environ
and any(
a in ("DeepseekV4ForCausalLM", "DeepSeekV4MTPModel")
for a in self.model_config.architectures
)
):
os.environ["VLLM_USE_BREAKABLE_CUDAGRAPH"] = "1"
logger.info_once(
"Auto-enabling VLLM_USE_BREAKABLE_CUDAGRAPH=1 for DeepSeek V4. "
"Set VLLM_USE_BREAKABLE_CUDAGRAPH=0 to opt out."
)
if envs.VLLM_USE_BREAKABLE_CUDAGRAPH:
logger.warning_once(
"VLLM_USE_BREAKABLE_CUDAGRAPH is set, disabling vLLM's "