From d91f7af7d05d7bad61088418e305830778c27f0e Mon Sep 17 00:00:00 2001 From: Matt <156021403+mawong-amd@users.noreply.github.com> Date: Thu, 30 Jul 2026 21:37:36 -0500 Subject: [PATCH] [Hardware][AMD][Kernel][CI][Bugfix] Fix ROCm DeepEP FP8 max (#50467) Signed-off-by: Matthew Wong Co-authored-by: Andreas Karatzas --- docker/Dockerfile.rocm | 7 +++++-- tests/kernels/moe/test_deepep_moe.py | 10 +--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile.rocm b/docker/Dockerfile.rocm index 27c199317d..a32ecb620f 100644 --- a/docker/Dockerfile.rocm +++ b/docker/Dockerfile.rocm @@ -467,18 +467,21 @@ RUN --mount=type=cache,target=/root/.cache/ccache \ # DeepEP build stage - depends on ROCShmem, builds the HIP kernel wheel. FROM build_rocshmem AS build_deepep -ARG DEEPEP_BRANCH="a9ea9774" +ARG DEEPEP_BRANCH="0f63d3e9" ARG DEEPEP_REPO="https://github.com/ROCm/DeepEP.git" ARG DEEPEP_NIC="cx7" # Build DeepEP wheel. DeepEP looks for rocshmem at ROCSHMEM_DIR. # DeepEP only supports gfx942 and gfx950, so avoid gfx90a in the default list. +# We pass --rocm-gfx942-fp8-fnuz-max 224 to align the DeepEP dispatch FP8 +# quantization bound with vLLM's own clamp +# (vllm/model_executor/layers/quantization/utils/fp8_utils.py): 224 for E4M3FNUZ RUN --mount=type=cache,target=/root/.cache/ccache \ export PYTORCH_ROCM_ARCH="gfx942;gfx950" \ && git clone ${DEEPEP_REPO} \ && cd DeepEP \ && git checkout ${DEEPEP_BRANCH} \ - && LDFLAGS="-fuse-ld=mold" MAX_JOBS="${MAX_JOBS:-$(nproc)}" python3 setup.py --variant rocm --rocm-explicit-ctx --nic ${DEEPEP_NIC} bdist_wheel --dist-dir=/app/deep_install + && LDFLAGS="-fuse-ld=mold" MAX_JOBS="${MAX_JOBS:-$(nproc)}" python3 setup.py --variant rocm --rocm-explicit-ctx --nic ${DEEPEP_NIC} --rocm-gfx942-fp8-fnuz-max 224 bdist_wheel --dist-dir=/app/deep_install # MoRI runtime dependencies live in Dockerfile.rocm so NIC backend changes do # not force users to rebuild the long-lived Dockerfile.rocm_base image. diff --git a/tests/kernels/moe/test_deepep_moe.py b/tests/kernels/moe/test_deepep_moe.py index 933718ef33..ce9e4f343d 100644 --- a/tests/kernels/moe/test_deepep_moe.py +++ b/tests/kernels/moe/test_deepep_moe.py @@ -11,7 +11,7 @@ import torch.distributed from torch.distributed import ProcessGroup import vllm.envs as envs -from tests.kernels.moe.utils import check_accuracy, make_dummy_moe_config +from tests.kernels.moe.utils import make_dummy_moe_config from vllm import _custom_ops as ops from vllm.config import VllmConfig, set_current_vllm_config from vllm.model_executor.layers.activation import SiluAndMul @@ -367,14 +367,6 @@ def assert_deepep_close( k: int, use_fp8_dispatch: bool, ) -> None: - if use_fp8_dispatch and current_platform.is_fp8_fnuz(): - # ROCm e4m3fnuz rounds differently than the reference quant, - # so DeepEP's fp8 dispatch can yield a few outliers even with - # a correct kernel; allow a small fraction of mismatches here. - atol = rtol = 1.5e-1 - check_accuracy(expected, actual, atol=atol, rtol=rtol, percent=0.95) - return - torch.testing.assert_close( expected, actual,