[Hardware][AMD][Kernel][CI][Bugfix] Fix ROCm DeepEP FP8 max (#50467)
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user