[ROCm][CI] Expand MI355 mirrors and route MIG-sized jobs to DPX (#59137)

Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com>
This commit is contained in:
Andreas Karatzas
2026-09-29 03:40:07 -05:00
committed by GitHub
parent 70dc122f81
commit 6ebb5bd64f
15 changed files with 534 additions and 91 deletions
+45 -16
View File
@@ -3,6 +3,7 @@
import json
import logging
from contextlib import nullcontext
import pytest
@@ -174,13 +175,18 @@ def test_async_tp_pass_correctness(
@create_new_process_for_each_test()
def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int):
if (
not current_platform.is_cuda()
or not current_platform.is_device_capability_family(100)
):
pytest.skip("NVFP4 requires Blackwell")
if not has_flashinfer():
def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int, caplog_mp_spawn):
is_blackwell = current_platform.is_cuda() and (
current_platform.is_device_capability_family(100)
)
is_rocm_cdna = False
if current_platform.is_rocm():
from vllm.platforms.rocm import on_cdna
is_rocm_cdna = on_cdna()
if not (is_blackwell or is_rocm_cdna):
pytest.skip("NVFP4 AsyncTP requires Blackwell or ROCm CDNA")
if is_blackwell and not has_flashinfer():
pytest.skip("FlashInfer is required for the NVFP4 AsyncTP path")
tp_size = 2
@@ -196,8 +202,7 @@ def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int):
"8",
"--load-format",
"dummy",
"--linear-backend",
"flashinfer_cutlass",
*(["--linear-backend", "flashinfer_cutlass"] if is_blackwell else []),
"--hf-overrides",
json.dumps(NVFP4_HF_OVERRIDES),
]
@@ -213,6 +218,8 @@ def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int):
"sp_min_token_num": 1,
},
}
if is_rocm_cdna:
compilation_config["inductor_compile_config"] = {"force_disable_caches": True}
async_tp_args = [
*common_args,
@@ -232,10 +239,32 @@ def test_async_tp_pass_nvfp4_correctness(num_gpus_available: int):
"mp",
]
compare_two_settings(
NVFP4_MODEL_ID,
async_tp_args,
tp_args,
method="generate",
force_v1_runner=True,
)
env = {"VLLM_DISABLE_COMPILE_CACHE": "1"} if is_rocm_cdna else None
log_context = caplog_mp_spawn(logging.DEBUG) if is_rocm_cdna else nullcontext()
with log_context as logs:
compare_two_settings(
NVFP4_MODEL_ID,
async_tp_args,
tp_args,
env1=env,
env2=env,
method="generate",
force_v1_runner=True,
)
if is_rocm_cdna:
assert logs is not None
matches_by_rank = {
rank: [
int(count)
for line in logs.text.splitlines()
if line.startswith(f"(Worker_TP{rank} pid=")
for count in FUSION_LOG_PATTERNS["async_tp"].findall(line)
]
for rank in range(tp_size)
}
assert all(
any(count > 0 for count in matches) for matches in matches_by_rank.values()
), (
"Expected positive NVFP4 AsyncTP rewrites on both TP workers, "
f"found {matches_by_rank}"
)
@@ -374,11 +374,16 @@ def test_tp_sp_generation_prompt_embeds(
@create_new_process_for_each_test()
def test_tp_sp_nvfp4_generation(num_gpus_available: int):
if (
not current_platform.is_cuda()
or not current_platform.is_device_capability_family(100)
):
pytest.skip("NVFP4 requires Blackwell")
is_blackwell = current_platform.is_cuda() and (
current_platform.is_device_capability_family(100)
)
is_rocm_cdna = False
if current_platform.is_rocm():
from vllm.platforms.rocm import on_cdna
is_rocm_cdna = on_cdna()
if not (is_blackwell or is_rocm_cdna):
pytest.skip("NVFP4 sequence parallelism requires Blackwell or ROCm CDNA")
comparison = _build_sp_args(
NVFP4_MODEL_ID,
+15 -9
View File
@@ -8,6 +8,7 @@ Run: pytest tests/distributed/test_mnnvl_alltoall.py -v
import os
import traceback
from contextlib import contextmanager
import pytest
import torch
@@ -148,16 +149,17 @@ def _init_dp_environment(world_size, rank, port, dp_size, dp_port):
ensure_model_parallel_initialized(1, 1)
@contextmanager
def _make_forward_context(rank, world_size, num_tokens_per_rank):
"""Create a forward context with mock DP metadata for AgRs tests.
"""Keep the vLLM config and mock-DP forward context active together.
Returns a context manager suitable for ``with`` statements.
The real DPMetadata (with sp_local_sizes etc.) is created internally
by set_forward_context from num_tokens_across_dp; the attn_metadata
placeholder just satisfies the "attn_metadata is not None" guard.
"""
from vllm.config import VllmConfig, set_current_vllm_config
from vllm.config.parallel import ParallelConfig
from vllm.config.vllm import VllmConfig
from vllm.forward_context import set_forward_context
class _AttnMeta:
@@ -173,14 +175,18 @@ def _make_forward_context(rank, world_size, num_tokens_per_rank):
is_moe_model=True,
data_parallel_rank=rank,
)
return set_forward_context(
_AttnMeta(),
vllm_config,
num_tokens=num_tokens_per_rank,
num_tokens_across_dp=torch.tensor(
[num_tokens_per_rank] * world_size, dtype=torch.int
with (
set_current_vllm_config(vllm_config),
set_forward_context(
_AttnMeta(),
vllm_config,
num_tokens=num_tokens_per_rank,
num_tokens_across_dp=torch.tensor(
[num_tokens_per_rank] * world_size, dtype=torch.int
),
),
)
):
yield
# ---------------------------------------------------------------------------
@@ -0,0 +1,18 @@
model_name: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4"
accuracy_threshold: 0.93
num_questions: 1319
num_fewshot: 5
max_concurrency: 16
rocm_request_timeout_seconds: 1800
min_acceptance_length: 2.0
startup_max_wait_seconds: 1200
server_args: >-
--enforce-eager
--max-model-len 4096
--max-num-seqs 16
--max-num-batched-tokens 32768
--gpu-memory-utilization 0.5
--tensor-parallel-size 2
--enable-expert-parallel
--mamba-backend triton
--speculative-config '{"method":"mtp","num_speculative_tokens":5}'
@@ -0,0 +1,17 @@
model_name: "nm-testing/Qwen3-Next-80B-A3B-Instruct-NVFP4"
accuracy_threshold: 0.75
num_questions: 1319
num_fewshot: 5
max_concurrency: 16
rocm_request_timeout_seconds: 1800
server_args: >-
--enforce-eager
--max-model-len 4096
--max-num-seqs 16
--max-num-batched-tokens 32768
--gpu-memory-utilization 0.5
--tensor-parallel-size 2
--enable-expert-parallel
--all2all-backend allgather_reducescatter
--attention-backend TRITON_ATTN
--no-async-scheduling
@@ -0,0 +1,19 @@
model_name: "nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4"
accuracy_threshold: 0.85
num_questions: 1319
num_fewshot: 5
max_concurrency: 16
rocm_request_timeout_seconds: 1800
min_acceptance_length: 1.5
server_args: >-
--enforce-eager
--max-model-len 4096
--max-num-seqs 16
--max-num-batched-tokens 32768
--gpu-memory-utilization 0.5
--tensor-parallel-size 2
--enable-expert-parallel
--all2all-backend allgather_reducescatter
--attention-backend TRITON_ATTN
--no-async-scheduling
--speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":1}'
@@ -0,0 +1,5 @@
# Exact B200 compressed-tensors checkpoint; it does not contain MTP weights.
Qwen3-Next-80B-A3B-NVFP4-EP2-CT-MI355.yaml
# MTP-capable ModelOpt checkpoint exercises NVFP4 EP2 with MTP1.
Qwen3-Next-80B-A3B-NVFP4-EP2-MTP-MI355.yaml
Nemotron-3-Super-120B-A12B-NVFP4-MI355.yaml
@@ -1,2 +1,5 @@
Qwen3-0.6B-FP8.yaml
Qwen3-1.7B-MXFP4.yaml
Qwen3-30B-A3B-NVFP4.yaml
Laguna-XS.2-NVFP4.yaml
Laguna-XS-2.1-INT4.yaml
@@ -2,3 +2,4 @@ Qwen3.5-35B-A3B-DEP2.yaml
Qwen3.5-35B-A3B-FP8-DEP2.yaml
Qwen3.5-35B-A3B-MXFP4-AITER-TP2.yaml
Qwen3.5-35B-A3B-MXFP4-EMU-TP2.yaml
Qwen3.5-397B-A17B-NVFP4-DEP2.yaml