From c711f740b7c7540c8c4d7f2c26ff6960b427a4cc Mon Sep 17 00:00:00 2001 From: Markus Hartikainen Date: Sat, 12 Sep 2026 20:47:07 -0700 Subject: [PATCH] [ROCm] Auto-enable breakable CUDA graphs for DeepseekV41ForCausalLM (#56349) Signed-off-by: Markus Hartikainen Co-authored-by: Jee Jee Li --- tests/test_config.py | 4 ++++ vllm/config/vllm.py | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index e6d040caf5..218ec61445 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -358,6 +358,10 @@ def test_rocm_keeps_compiled_deepseek_defaults(monkeypatch): assert "DeepseekV32ForCausalLM" not in breakable_architectures assert "DeepseekV32MTPModel" not in breakable_architectures assert "GlmMoeDsaForCausalLM" not in breakable_architectures + # V4.1 cannot torch.compile and the ROCm sparse SWA backend only + # supports uniform-batch CUDA graphs, so it must opt in or the + # default FULL_AND_PIECEWISE serve path cannot start. + assert "DeepseekV41ForCausalLM" in breakable_architectures # The carve-out takes effect via the runner-selection property # (warning_once args must be hashable for its lru_cache). diff --git a/vllm/config/vllm.py b/vllm/config/vllm.py index 3bdfe1f3ed..6fab6f0c71 100644 --- a/vllm/config/vllm.py +++ b/vllm/config/vllm.py @@ -110,10 +110,17 @@ def default_breakable_cudagraph_architectures() -> frozenset[str]: from vllm.platforms import current_platform if current_platform.is_rocm(): - # Breakable CUDA graphs currently regress performance on ROCm, so no - # architecture opts in by default here. Users can still force it with + # Breakable CUDA graphs currently regress performance on ROCm for + # models that can use torch.compile piecewise graphs instead. Do not + # opt those in by default. Users can still force them with # VLLM_USE_BREAKABLE_CUDAGRAPH=1. - return frozenset() + # + # DeepseekV41ForCausalLM cannot torch.compile, and the ROCm sparse + # SWA backend only reports AttentionCGSupport.UNIFORM_BATCH. Default + # FULL_AND_PIECEWISE then dies at capture unless breakable CUDA + # graphs are on. Enable this architecture so the published AMD + # recipe can start. + return frozenset({"DeepseekV41ForCausalLM"}) return DEFAULT_BREAKABLE_CUDAGRAPH_ARCHITECTURES