From e33de821c0df5c15d0fad990a754f3b69a6478e3 Mon Sep 17 00:00:00 2001 From: stefankoncarevic Date: Thu, 24 Sep 2026 22:36:36 +0200 Subject: [PATCH] [ROCm][CI] skip the ROCm MRV1 default where MRV1 cannot serve the config (#58535) Signed-off-by: Stefan Koncarevic Co-authored-by: Andreas Karatzas --- .buildkite/test_areas/lm_eval.yaml | 1 + ...DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml | 28 +++++++++++ .../gsm8k/configs/models-spec-decode-rocm.txt | 1 + tests/test_config.py | 47 +++++++++++++++++++ vllm/config/vllm.py | 16 ++++++- 5 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml diff --git a/.buildkite/test_areas/lm_eval.yaml b/.buildkite/test_areas/lm_eval.yaml index dccf57f2e2..e93157e521 100644 --- a/.buildkite/test_areas/lm_eval.yaml +++ b/.buildkite/test_areas/lm_eval.yaml @@ -307,6 +307,7 @@ steps: - csrc/ - tests/evals/gsm8k/configs/Kimi-K3-pruned75-DSpark-AITER-TP4.yaml - tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-AITER-TEP4.yaml + - tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml - tests/evals/gsm8k/configs/models-spec-decode-rocm.txt - tests/evals/gsm8k/test_gsm8k_correctness.py - tests/evals/gsm8k/gsm8k_eval.py diff --git a/tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml b/tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml new file mode 100644 index 0000000000..a3c6840fb3 --- /dev/null +++ b/tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml @@ -0,0 +1,28 @@ +model_name: "deepseek-ai/DeepSeek-V4-Flash-DSpark" +accuracy_threshold: 0.92 +tolerance: 0.08 +min_acceptance_length: 1.2 +num_questions: 1319 +num_fewshot: 5 +startup_max_wait_seconds: 1800 +env: + VLLM_ROCM_USE_AITER: "1" +server_args: >- + --tokenizer-mode deepseek_v4 + --trust-remote-code + --max-model-len 8192 + --tensor-parallel-size 4 + --enable-expert-parallel + --all2all-backend allgather_reducescatter + --block-size 256 + --gpu-memory-utilization 0.5 + --kv-cache-dtype fp8 + --attention_config.indexer_kv_dtype=fp8 + --max-num-batched-tokens 16384 + --max-num-seqs 128 + --enforce-eager + --speculative-config '{"method":"dspark", + "model":"deepseek-ai/DeepSeek-V4-Flash-DSpark", + "num_speculative_tokens":7, + "draft_sample_method":"probabilistic", + "enable_adaptive_verification":false}' diff --git a/tests/evals/gsm8k/configs/models-spec-decode-rocm.txt b/tests/evals/gsm8k/configs/models-spec-decode-rocm.txt index 177e336a3c..d96c405010 100644 --- a/tests/evals/gsm8k/configs/models-spec-decode-rocm.txt +++ b/tests/evals/gsm8k/configs/models-spec-decode-rocm.txt @@ -1,2 +1,3 @@ Kimi-K3-pruned75-DSpark-AITER-TP4.yaml DeepSeek-V4-Flash-DSpark-AITER-TEP4.yaml +DeepSeek-V4-Flash-DSpark-FP8-TP4-ROCm.yaml diff --git a/tests/test_config.py b/tests/test_config.py index c391216d9a..3c93743756 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -550,11 +550,58 @@ def test_rocm_keeps_compiled_deepseek_defaults(monkeypatch): model_config=SimpleNamespace(architectures=["DeepseekV32ForCausalLM"]), attention_config=AttentionConfig(), ) + config._get_v1_model_runner_unsupported_features = lambda: [] assert VllmConfig.use_v2_model_runner.fget(config) is False finally: default_breakable_cudagraph_architectures.cache_clear() +def test_rocm_mrv1_default_yields_to_v1_unsupported_config(monkeypatch): + """The ROCm V1 default is a speed preference, not a capability claim. + + DSpark runs only on V2, so pinning DeepSeek V4 to V1 would fail config + validation instead of serving it. With nothing V1 refuses, it still holds. + """ + from vllm.platforms import current_platform + + monkeypatch.setattr(current_platform, "is_rocm", lambda: True) + monkeypatch.setattr(vllm_config_module, "HAS_TRITON", True) + monkeypatch.delenv("VLLM_USE_V2_MODEL_RUNNER", raising=False) + + config = SimpleNamespace( + model_config=SimpleNamespace( + architectures=["DeepseekV4ForCausalLM"], is_diffusion=False + ), + attention_config=AttentionConfig(), + parallel_config=SimpleNamespace( + prefill_context_parallel_size=1, + pipeline_parallel_size=1, + enable_batch_sharded_sampling=False, + ), + scheduler_config=SimpleNamespace(async_scheduling=False), + speculative_config=None, + ) + config._dflash_needs_multi_kv_group = lambda: False + config._is_dflash2_draft = lambda: False + config._get_v2_model_runner_unsupported_features = lambda: [] + # The real predicate, so the test also pins where dspark lands in it. + config._get_v1_model_runner_unsupported_features = lambda: ( + VllmConfig._get_v1_model_runner_unsupported_features(config) + ) + + assert VllmConfig.use_v2_model_runner.fget(config) is False + + config.speculative_config = SimpleNamespace( + method="dspark", enable_adaptive_verification=False + ) + assert VllmConfig.use_v2_model_runner.fget(config) is True + + # Yielding is not the same as selecting V2: the later checks still run, so + # a config neither runner can serve lands on V1 and fails validation there. + config._get_v2_model_runner_unsupported_features = lambda: ["sequence parallelism"] + assert VllmConfig.use_v2_model_runner.fget(config) is False + + @pytest.mark.parametrize( ("model", "architecture"), [ diff --git a/vllm/config/vllm.py b/vllm/config/vllm.py index f5851e0da2..e6a67a5fb1 100644 --- a/vllm/config/vllm.py +++ b/vllm/config/vllm.py @@ -722,11 +722,23 @@ class VllmConfig: if model_config is not None and current_platform.is_rocm(): architectures = getattr(model_config, "architectures", ()) if any(arch in ROCM_DEFAULT_MRV1_ARCHITECTURES for arch in architectures): + # This default is a speed preference, not a claim that V1 can + # serve the config, so it yields where V1 cannot. It yields by + # falling through to the checks below, not by selecting V2. + v1_unsupported = self._get_v1_model_runner_unsupported_features() + if not v1_unsupported: + logger.warning_once( + "Defaulting to V1 model runner on ROCm for model " + "architectures: %s", + ", ".join(architectures), + ) + return False logger.warning_once( - "Defaulting to V1 model runner on ROCm for model architectures: %s", + "Skipping the ROCm V1 model runner default for %s: V1 does " + "not support %s.", ", ".join(architectures), + ", ".join(v1_unsupported), ) - return False if not HAS_TRITON: logger.warning_once(