From 78fc1e6274d326c869432e4dfde8dc5b4c6e85a8 Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Tue, 29 Sep 2026 02:10:26 -0500 Subject: [PATCH] [ROCm][CI] Add MI355 TP2 AR-RMS and B200 fusion mirrors (#58284) Signed-off-by: Andreas Karatzas Co-authored-by: OpenAI Codex --- .buildkite/test-amd.yaml | 50 ++++++++++++++++ .buildkite/test_areas/compile.yaml | 52 ++++++++++++++++ tests/compile/fusions_e2e/test_tp2_ar_rms.py | 4 +- .../compile/fusions_e2e/test_tp2_rocm_moe.py | 60 +++++++++++++++++++ 4 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 tests/compile/fusions_e2e/test_tp2_rocm_moe.py diff --git a/.buildkite/test-amd.yaml b/.buildkite/test-amd.yaml index 830b2166ea..55f7f382c8 100644 --- a/.buildkite/test-amd.yaml +++ b/.buildkite/test-amd.yaml @@ -3228,6 +3228,56 @@ steps: commands: - pytest -v -s compile/h100/test_startup.py +- label: ":amd: (MI355) Fusion E2E TP2 AR-RMS FP8 Config Sweep" + timeout_in_minutes: 45 + mirror_hardwares: [amdexperimental, amdproduction, amdgfx950nightly, amdmi355] + dind: false + agent_pool: mi355_2 + num_gpus: 2 + optional: true + working_dir: "/vllm-workspace/" + source_file_dependencies: + - vllm/compilation/ + - vllm/model_executor/ + - vllm/distributed/ + - vllm/v1/attention/ + - vllm/_aiter_ops.py + - vllm/platforms/rocm.py + - tests/compile/fusions_e2e/ + - tests/utils.py + - tests/conftest.py + - csrc/quantization/ + commands: + # Existing MI300 jobs own BF16; TP2 Quick owns the excluded Llama cell. + - amd-smi + - VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_CUSTOM_AR=1 pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k 'test_tp2_ar_rms_fp8_fusions and Llama-3 and ROCM_AITER_UNIFIED_ATTN and (dynamo_partition or +quant_fp8 or +rms_norm)' + +- label: ":amd: (MI355) Fusion E2E TP2 FP8 BF16 rewrites" + timeout_in_minutes: 45 + mirror_hardwares: [amdexperimental, amdproduction, amdgfx950nightly, amdmi355] + dind: false + agent_pool: mi355_2 + num_gpus: 2 + optional: true + working_dir: "/vllm-workspace/" + source_file_dependencies: + - vllm/compilation/ + - vllm/model_executor/ + - vllm/distributed/ + - vllm/v1/attention/ + - vllm/_aiter_ops.py + - vllm/platforms/rocm.py + - tests/compile/fusions_e2e/ + - tests/utils.py + - tests/conftest.py + - csrc/quantization/ + commands: + # Dummy-weight rewrite coverage; trained FP8 AR/RMS equivalence is unresolved. + # TODO: FP4 output-quant and trained MXFP4 AR/RMS fusion remain unsupported. + - amd-smi + - VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_CUSTOM_AR=1 pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k 'test_tp2_ar_rms_fp8_fusions and qwen3 and ROCM_AITER_UNIFIED_ATTN and +quant_fp8 and (dynamo_partition or not +rms_norm)' + - pytest -v -s tests/compile/fusions_e2e/test_tp2_rocm_moe.py + - label: ":amd: (MI355) Fusion and Compile FP8" timeout_in_minutes: 45 mirror_hardwares: [amdexperimental, amdproduction, amdgfx950nightly, amdmi355] diff --git a/.buildkite/test_areas/compile.yaml b/.buildkite/test_areas/compile.yaml index 221c2e8838..3819c2b3a3 100644 --- a/.buildkite/test_areas/compile.yaml +++ b/.buildkite/test_areas/compile.yaml @@ -267,6 +267,31 @@ steps: - nvidia-smi # Run just llama3 (fp8 & bf16) for all config combinations - pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k "llama-3" + mirror: + amd: + label: ":amd: (MI355) Fusion E2E TP2 AR-RMS FP8 Config Sweep" + dind: false + device: mi355_2 + num_devices: 2 + timeout_in_minutes: 45 + working_dir: "/vllm-workspace/" + depends_on: + - image-build-amd + source_file_dependencies: + - vllm/compilation/ + - vllm/model_executor/ + - vllm/distributed/ + - vllm/v1/attention/ + - vllm/_aiter_ops.py + - vllm/platforms/rocm.py + - tests/compile/fusions_e2e/ + - tests/utils.py + - tests/conftest.py + - csrc/quantization/ + commands: + # Existing MI300 jobs own BF16; TP2 Quick owns the excluded Llama cell. + - amd-smi + - VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_CUSTOM_AR=1 pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k 'test_tp2_ar_rms_fp8_fusions and Llama-3 and ROCM_AITER_UNIFIED_ATTN and (dynamo_partition or +quant_fp8 or +rms_norm)' - label: ":nvidia: (H100) Fusion E2E TP2 AsyncTP Config Sweep" key: fusion-e2e-tp2-asynctp-config-sweep-h100 @@ -334,3 +359,30 @@ steps: # for ar-rms-quant-fp4, also sweep llama3 - pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k "(FLASHINFER and inductor_partition and not +rms_norm and (not +quant_fp8 or +quant_fp8 and (qwen3 or deepseek))) or Llama-3.1-8B-Instruct-FP4" - pytest -v -s tests/compile/fusions_e2e/test_tp2_async_tp.py -k "FLASHINFER and inductor_partition and not +rms_norm and (not +quant_fp8 or +quant_fp8 and (qwen3 or deepseek))" + mirror: + amd: + label: ":amd: (MI355) Fusion E2E TP2 FP8 BF16 rewrites" + dind: false + device: mi355_2 + num_devices: 2 + timeout_in_minutes: 45 + working_dir: "/vllm-workspace/" + depends_on: + - image-build-amd + source_file_dependencies: + - vllm/compilation/ + - vllm/model_executor/ + - vllm/distributed/ + - vllm/v1/attention/ + - vllm/_aiter_ops.py + - vllm/platforms/rocm.py + - tests/compile/fusions_e2e/ + - tests/utils.py + - tests/conftest.py + - csrc/quantization/ + commands: + # Dummy-weight rewrite coverage; trained FP8 AR/RMS equivalence is unresolved. + # TODO: FP4 output-quant and trained MXFP4 AR/RMS fusion remain unsupported. + - amd-smi + - VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_CUSTOM_AR=1 pytest -v -s tests/compile/fusions_e2e/test_tp2_ar_rms.py -k 'test_tp2_ar_rms_fp8_fusions and qwen3 and ROCM_AITER_UNIFIED_ATTN and +quant_fp8 and (dynamo_partition or not +rms_norm)' + - pytest -v -s tests/compile/fusions_e2e/test_tp2_rocm_moe.py diff --git a/tests/compile/fusions_e2e/test_tp2_ar_rms.py b/tests/compile/fusions_e2e/test_tp2_ar_rms.py index f35bc1bd9c..b0a3d71888 100644 --- a/tests/compile/fusions_e2e/test_tp2_ar_rms.py +++ b/tests/compile/fusions_e2e/test_tp2_ar_rms.py @@ -111,7 +111,9 @@ def test_tp2_ar_rms_fp8_fusions( model_kwargs["max_model_len"] = 1024 model_kwargs["kernel_config"] = {"enable_flashinfer_autotune": False} model_kwargs["disable_custom_all_reduce"] = False - if current_platform.is_rocm() and "llama-3" in model_name_lower: + if current_platform.is_rocm() and ( + "llama-3" in model_name_lower or "qwen" in model_name_lower + ): model_kwargs.update( gpu_memory_utilization=0.01, kv_cache_memory_bytes=64 * 1024**2, diff --git a/tests/compile/fusions_e2e/test_tp2_rocm_moe.py b/tests/compile/fusions_e2e/test_tp2_rocm_moe.py new file mode 100644 index 0000000000..9a228ca76c --- /dev/null +++ b/tests/compile/fusions_e2e/test_tp2_rocm_moe.py @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project +"""ROCm MoE coverage for the TP2 GEMM/collective fusion contract.""" + +import pytest + +from tests.utils import multi_gpu_test +from vllm.config import PassConfig +from vllm.platforms import current_platform + +from .common import INDUCTOR_GRAPH_PARTITION +from .models import TRITON_ATTN, qwen3_a3b + + +@multi_gpu_test(num_gpus=2) +@pytest.mark.skipif(not current_platform.is_rocm(), reason="ROCm AsyncTP contract") +@pytest.mark.parametrize("inductor_graph_partition", INDUCTOR_GRAPH_PARTITION[:1]) +@pytest.mark.parametrize("attn_backend", [TRITON_ATTN]) +def test_tp2_rocm_moe_async_tp_bf16_fusions( + inductor_graph_partition, attn_backend, run_e2e_fusion_test +): + """MoE dense projections retain the Qwen SP/AsyncTP rewrite counts.""" + n_layers = 4 + run_e2e_fusion_test( + qwen3_a3b.model_name, + qwen3_a3b.matches(n_layers), + dict( + hf_overrides=dict( + num_hidden_layers=n_layers, + hidden_size=512, + intermediate_size=1024, + moe_intermediate_size=128, + num_attention_heads=8, + num_key_value_heads=2, + head_dim=64, + num_experts=8, + num_experts_per_tok=2, + ), + load_format="dummy", + max_model_len=1024, + kv_cache_memory_bytes=64 * 1024**2, + gpu_memory_utilization=0.01, + max_num_batched_tokens=1024, + max_num_seqs=32, + ), + attn_backend, + dict( + use_inductor_graph_partition=inductor_graph_partition, + custom_ops=["-rms_norm"], + pass_config=PassConfig( + enable_qk_norm_rope_fusion=True, + enable_sp=True, + fuse_gemm_comms=True, + fuse_allreduce_rms=False, + sp_min_token_num=512, + ), + ), + ["norm_rope_fusion", "sequence_parallel", "async_tp"], + tp_size=2, + )