From 54d93af9fb89d0bb8392bdb72db42bb6a17cb4ca Mon Sep 17 00:00:00 2001 From: Matthew Bonanni Date: Mon, 5 Oct 2026 12:42:27 -0400 Subject: [PATCH] [Bugfix][HiSparse] Reject cudagraph_mode=FULL at startup (#59688) Signed-off-by: Matthew Bonanni Co-authored-by: Claude Opus 5.5 --- tests/test_config.py | 11 +++++++++++ vllm/config/vllm.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index a2e75b1072..b1348480cc 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -502,6 +502,17 @@ def test_hisparse_rejects_pipeline_parallelism(monkeypatch): ) +def test_hisparse_rejects_full_cudagraph_mode(monkeypatch): + monkeypatch.setattr(current_platform, "is_cuda", lambda: True) + monkeypatch.setattr(current_platform, "support_static_graph_mode", lambda: True) + monkeypatch.setattr("vllm.config.vllm.HAS_TRITON", True) + with pytest.raises(ValueError, match="does not support cudagraph_mode=FULL"): + VllmConfig( + attention_config=AttentionConfig(hisparse_config=HiSparseConfig()), + compilation_config=CompilationConfig(cudagraph_mode=CUDAGraphMode.FULL), + ) + + def test_hisparse_rejects_disabled_hybrid_kv_cache_manager(monkeypatch): monkeypatch.setattr(current_platform, "is_cuda", lambda: True) monkeypatch.setattr("vllm.config.vllm.HAS_TRITON", True) diff --git a/vllm/config/vllm.py b/vllm/config/vllm.py index 32b49f4272..a5e1ad08b4 100644 --- a/vllm/config/vllm.py +++ b/vllm/config/vllm.py @@ -1836,6 +1836,12 @@ class VllmConfig: raise ValueError( "HiSparse does not support decode context parallelism." ) + if self.compilation_config.cudagraph_mode == CUDAGraphMode.FULL: + raise ValueError( + "HiSparse does not support cudagraph_mode=FULL; use " + "FULL_AND_PIECEWISE (the default), which captures FULL graphs " + "for decode batches." + ) if not self.scheduler_config.scheduler_reserve_full_isl: # Without it, async loads admitted against free host blocks can # each wait on host pages the others hold, and waiting requests