[ROCm] Auto-enable breakable CUDA graphs for DeepseekV41ForCausalLM (#56349)

Signed-off-by: Markus Hartikainen <markus.hartikainen@amd.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>

Markus Hartikainen committed Sep 12, 2026 at 20:47 UTC c711f740b7c7540c8c4d7f2c26ff6960b427a4cc
2 files changed +14 -3
tests/test_config.py
+4
@@ -358,6 +358,10 @@ def test_rocm_keeps_compiled_deepseek_defaults(monkeypatch):
358 assert "DeepseekV32ForCausalLM" not in breakable_architectures
359 assert "DeepseekV32MTPModel" not in breakable_architectures
360 assert "GlmMoeDsaForCausalLM" not in breakable_architectures
361 + # V4.1 cannot torch.compile and the ROCm sparse SWA backend only
362 + # supports uniform-batch CUDA graphs, so it must opt in or the
363 + # default FULL_AND_PIECEWISE serve path cannot start.
364 + assert "DeepseekV41ForCausalLM" in breakable_architectures
365
366 # The carve-out takes effect via the runner-selection property
367 # (warning_once args must be hashable for its lru_cache).
vllm/config/vllm.py
+10 -3
@@ -110,10 +110,17 @@ def default_breakable_cudagraph_architectures() -> frozenset[str]:
110 from vllm.platforms import current_platform
111
112 if current_platform.is_rocm():
113 - # Breakable CUDA graphs currently regress performance on ROCm, so no
114 - # architecture opts in by default here. Users can still force it with
113 + # Breakable CUDA graphs currently regress performance on ROCm for
114 + # models that can use torch.compile piecewise graphs instead. Do not
115 + # opt those in by default. Users can still force them with
116 # VLLM_USE_BREAKABLE_CUDAGRAPH=1.
116 - return frozenset()
117 + #
118 + # DeepseekV41ForCausalLM cannot torch.compile, and the ROCm sparse
119 + # SWA backend only reports AttentionCGSupport.UNIFORM_BATCH. Default
120 + # FULL_AND_PIECEWISE then dies at capture unless breakable CUDA
121 + # graphs are on. Enable this architecture so the published AMD
122 + # recipe can start.
123 + return frozenset({"DeepseekV41ForCausalLM"})
124 return DEFAULT_BREAKABLE_CUDAGRAPH_ARCHITECTURES
125
126