[ROCm][Bugfix] Reduce CUDA graph divergences (#57229)

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
This commit is contained in:
Matt
2026-09-17 05:12:13 +00:00
committed by GitHub
parent 0bfc7a15d0
commit 2d8a5c5741
5 changed files with 8 additions and 90 deletions
-39
View File
@@ -477,45 +477,6 @@ def test_rocm_keeps_compiled_deepseek_defaults(monkeypatch):
default_breakable_cudagraph_architectures.cache_clear()
@pytest.mark.skipif(not current_platform.is_rocm(), reason="ROCm-specific test")
@pytest.mark.parametrize(
("architecture", "use_v2", "mode", "expected"),
[
("DeepseekV4ForCausalLM", True, None, CUDAGraphMode.NONE),
("DeepseekV4ForConditionalGeneration", True, None, CUDAGraphMode.NONE),
("DeepseekV4ForCausalLM", False, None, None),
("LlamaForCausalLM", True, None, None),
(
"DeepseekV4ForCausalLM",
True,
CUDAGraphMode.FULL_DECODE_ONLY,
CUDAGraphMode.FULL_DECODE_ONLY,
),
],
)
def test_rocm_gfx950_deepseek_v4_cudagraph_default(
monkeypatch, architecture, use_v2, mode, expected
):
from vllm._aiter_ops import rocm_aiter_ops
from vllm.platforms import rocm
monkeypatch.setattr(rocm, "on_gfx950", lambda: True)
monkeypatch.setattr(rocm_aiter_ops, "is_fused_moe_enabled", lambda: False)
monkeypatch.setattr(rocm_aiter_ops, "is_linear_fp8_enabled", lambda: False)
monkeypatch.setattr(
rocm_aiter_ops, "is_fusion_moe_shared_experts_enabled", lambda: False
)
config = SimpleNamespace(
compilation_config=CompilationConfig(cudagraph_mode=mode),
model_config=SimpleNamespace(architecture=architecture),
use_v2_model_runner=use_v2,
)
rocm.RocmPlatform.apply_config_platform_defaults(config)
assert config.compilation_config.cudagraph_mode == expected
@pytest.mark.parametrize(
("model", "architecture"),
[