Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
5664186
Triton version bump
jpvillam-amd Jul 31, 2026
e1b8021
Perf pass 1
JadenMathias Jul 17, 2026
1ea8c62
experimental v4 preshuffle
Aug 4, 2026
24b9fa0
Push up rocm version
jpvillam-amd Aug 10, 2026
864ea32
Update docker args
JadenMathias Aug 13, 2026
cf53bc2
Narrow torch and rocm sdk device to 1250
JadenMathias Aug 13, 2026
e5c6438
Move gfx1250 SITU handling to oracle mxfp4
JadenMathias Aug 17, 2026
f7f6935
Use native AITER shuffle for all gfx1250 MXFP4 MoE activations
JadenMathias Aug 17, 2026
2612751
Enable AITER a4w4 MoE on gfx1250 for DeepSeek R1
JadenMathias Aug 17, 2026
e8fdf03
Enable DSV4F Aiter MoE
JadenMathias Aug 18, 2026
6666981
gfx1250 tp4 e2e patch (#1223)
omuhamma Aug 18, 2026
366cb28
Add aiter Triton a4w4 class
JadenMathias Aug 25, 2026
d9820be
Fix transpose
JadenMathias Aug 25, 2026
bdb34b3
Fix 2D shapes
JadenMathias Aug 25, 2026
0af9f6b
enabling a4w4 moe triton path
Aug 26, 2026
9194ecc
Match atom implementation
JadenMathias Aug 26, 2026
fc22aa9
Fix DeepSeek-V4-Flash on gfx1250 by skipping bpreshuffle GEMM
Aug 27, 2026
d53c753
enable dsr1 path
Aug 27, 2026
55c71f2
remove amdsmi build, should be there by default
Aug 28, 2026
a18b6f5
update rock version and add amdsmi pythonpath
Aug 28, 2026
e761f04
Fix GPT oss mxfp4 stride
JadenMathias Aug 28, 2026
239703f
Fix Minimax-m3 routing, activation and weight prep
JadenMathias Aug 28, 2026
72f307b
Clean up
jpvillam-amd Aug 31, 2026
d859357
Remove bench file
jpvillam-amd Aug 31, 2026
685fa05
pull bench, user aiter api for tunned gemms
jpvillam-amd Aug 31, 2026
20262a7
gemm_config bug
jpvillam-amd Sep 1, 2026
455839c
use better rocmsdk10 version (#1296)
JadenMathias Sep 11, 2026
334fd92
deleting _get_padding_mask(), aiter commit addressing the issue alrea…
Sep 14, 2026
1f8386a
Pin ainic version
JadenMathias Sep 15, 2026
3481bbc
Clean up
jpvillam-amd Sep 17, 2026
60fc8f4
Drop K3 gfx1250 enablement, upstreaming separately
jpvillam-amd Sep 22, 2026
9e6be53
DSV4 Core dump fix
JadenMathias Sep 24, 2026
3a173d2
Split AiterW4A16ExpertsMonolithic and AiterW4A4ExpertsMonolithic out …
JadenMathias Sep 29, 2026
24df9ad
Backend selection fix (#1320)
JadenMathias Sep 23, 2026
cedef94
sanitize router logits and pass an fp32 bias to aiter W4A4 MoE routin…
danichan-mkm Oct 6, 2026
e7d3a4f
Pass routing replay to Monolithic A4W4 class
JadenMathias Oct 7, 2026
e9ff539
small spelling error
jpvillam-amd Oct 7, 2026
7025e86
Linter changes
jpvillam-amd Oct 7, 2026
9e21a93
Change aiter pin commit to fix build
JadenMathias Oct 7, 2026
ba5dd3f
Review and transposed needs to be misspelled
Oct 8, 2026
6aecd06
Avoid the misspell, pass positionally
Oct 8, 2026
c886e90
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 8, 2026
8561eda
Drop gpt-oss RMSNorm+pad custom op in favor of fuse_act_padding
Oct 9, 2026
5d86664
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 9, 2026
480bc0c
Seperate Priority backend list for gfx1250 (#1362)
JadenMathias Oct 9, 2026
5499c6e
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 12, 2026
8158cbc
linter after merge
Oct 12, 2026
aacd2ea
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 12, 2026
f500858
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 13, 2026
63040d7
Fixing merge
Oct 13, 2026
f319a98
Add new Enum to handle gfx1250 backends (#1365)
JadenMathias Oct 13, 2026
f234df4
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 13, 2026
5ba5536
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 13, 2026
b97acf1
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 14, 2026
3b492a3
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 14, 2026
0d84379
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 14, 2026
ddf7eb6
Review comments
Oct 14, 2026
8d048d8
More review comments
Oct 14, 2026
f66ef0b
Remove from priority backend (#1374)
JadenMathias Oct 14, 2026
48d006a
Review meeting comments
Oct 14, 2026
0b0ae59
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 14, 2026
9fbb90e
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 14, 2026
e8a04fc
Merge branch 'main' into gfx1250_perf1
jpvillam-amd Oct 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions docker/Dockerfile.rocm_base_gfx1250
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG BASE_IMAGE=ubuntu:24.04
ARG ROCM_WHEEL_INDEX=https://rocm.devreleases.amd.com/whl-multi-arch/
ARG ROCM_SDK_VERSION=7.14.0a20260623
ARG TORCH_VERSION=2.11.0+rocm7.14.0a20260623
ARG TORCHVISION_VERSION=0.26.0+rocm7.14.0a20260623
ARG TORCHAUDIO_VERSION=2.11.0+rocm7.14.0a20260623
ARG TRITON_VERSION=3.7.1+git110cd8e2.rocm7.14.0a20260623
ARG APEX_VERSION=1.11.0+rocm7.14.0a20260623
ARG ROCM_WHEEL_INDEX=https://rocm.nightlies.amd.com/whl-multi-arch/
ARG ROCM_SDK_VERSION=10.1.0a20260822
ARG TORCH_VERSION=2.11.0+rocm10.1.0a20260822
ARG TORCHVISION_VERSION=0.26.0+rocm10.1.0a20260822
ARG TORCHAUDIO_VERSION=2.11.0+rocm10.1.0a20260822
ARG TRITON_VERSION=3.8.0+git4cff872c.rocm10.1.0a20260822
ARG APEX_VERSION=1.11.0+rocm10.1.0a20260822


ARG FA_BRANCH="jpvillam/gfx1250_wip"
ARG FA_REPO="https://github.com/jpvillam-amd/flash-attention.git"
ARG AITER_BRANCH="main"
ARG AITER_BRANCH="f85b24b"
ARG AITER_REPO="https://github.com/ROCm/aiter.git"
ARG MORI_BRANCH="v1.1.0"
ARG MORI_REPO="https://github.com/ROCm/mori.git"
Expand Down Expand Up @@ -119,10 +119,10 @@ ENV PYTHONPATH=${SITE_PACKAGES}/_rocm_sdk_core/share/amd_smi
# which keeps the set consistent and avoids pip backtracking.
RUN pip install --pre --index-url "${ROCM_WHEEL_INDEX}" \
--extra-index-url https://pypi.org/simple \
"torch[device-all]==${TORCH_VERSION}" \
"torch[device-gfx1250]==${TORCH_VERSION}" \
"torchvision==${TORCHVISION_VERSION}" \
"torchaudio==${TORCHAUDIO_VERSION}" \
"rocm[libraries,devel,device-all]==${ROCM_SDK_VERSION}" && \
"rocm[libraries,devel,device-gfx1250]==${ROCM_SDK_VERSION}" && \
rocm-sdk init

# Torch runtime deps that may not be published on the ROCm wheel index;
Expand Down Expand Up @@ -200,15 +200,6 @@ ENV SCCACHE_S3_NO_CREDENTIALS=${USE_SCCACHE:+${SCCACHE_S3_NO_CREDENTIALS}}
ENV SCCACHE_IDLE_TIMEOUT=${USE_SCCACHE:+0}


###
### AMD SMI Build
###
FROM base AS build_amdsmi
RUN cd ${SITE_PACKAGES}/_rocm_sdk_core/share/amd_smi \
&& pip wheel . --wheel-dir=dist
RUN mkdir -p /app/install && cp ${SITE_PACKAGES}/_rocm_sdk_core/share/amd_smi/dist/*.whl /app/install


###
### MORI Build TODO(Build needs fixing)
###
Expand Down Expand Up @@ -253,7 +244,10 @@ FROM base AS build_aiter
ARG AITER_BRANCH
ARG AITER_REPO
ARG USE_SCCACHE
RUN git clone --recursive --branch ${AITER_BRANCH} ${AITER_REPO}

RUN git clone ${AITER_REPO} \
&& cd aiter \
&& git checkout --detach ${AITER_BRANCH}
RUN cd aiter \
&& git submodule update --init --recursive \
&& pip install -r requirements.txt
Expand All @@ -278,8 +272,6 @@ FROM base AS debs_wheel_release
RUN mkdir /app/debs
RUN --mount=type=bind,from=build_fa,src=/app/install/,target=/install \
if ls /install/*.whl >/dev/null 2>&1; then cp /install/*.whl /app/debs; fi
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
cp /install/*.whl /app/debs
RUN --mount=type=bind,from=build_aiter,src=/app/install/,target=/install \
cp /install/*.whl /app/debs

Expand All @@ -288,8 +280,6 @@ FROM base AS debs
RUN mkdir /app/debs
RUN --mount=type=bind,from=build_fa,src=/app/install/,target=/install \
if ls /install/*.whl >/dev/null 2>&1; then cp /install/*.whl /app/debs; fi
RUN --mount=type=bind,from=build_amdsmi,src=/app/install/,target=/install \
cp /install/*.whl /app/debs
RUN --mount=type=bind,from=build_aiter,src=/app/install/,target=/install \
cp /install/*.whl /app/debs
RUN --mount=type=bind,from=build_mori,src=/app/install/,target=/install \
Expand Down
8 changes: 5 additions & 3 deletions docker/Dockerfile.rocm_gfx1250
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ARG NIC_BACKEND=all
# Users can specify a custom version compatible with their host drivers.
# The default version has been tested with ionic-dkms=26.03.3.001
# (libionic1=54.0-187-1), required for MoRI-EP/NIXL on Pollara/AINIC.
# TODO (jmathias) : Check if we can revert this Pinned AINIC version
ARG AINIC_VERSION=1.117.5-a-77
ARG UBUNTU_CODENAME=jammy

Expand Down Expand Up @@ -115,8 +116,8 @@ WORKDIR ${COMMON_WORKDIR}
FROM base AS fetch_vllm_0
ONBUILD COPY ./ vllm/
FROM base AS fetch_vllm_1
ARG VLLM_REPO="https://github.com/ROCm/vllm.git"
ARG VLLM_BRANCH="455_wip"
ARG VLLM_REPO="https://github.com/vllm-project/vllm.git"
ARG VLLM_BRANCH="main"
ENV VLLM_REPO=${VLLM_REPO}
ENV VLLM_BRANCH=${VLLM_BRANCH}
ONBUILD RUN git clone ${VLLM_REPO} \
Expand Down Expand Up @@ -726,13 +727,14 @@ RUN echo "VLLM_BASE_IMAGE=${BASE_IMAGE}" >> ${COMMON_WORKDIR}/versions.txt \

# Download bench scripts for gfx1250
RUN curl -k -O https://raw.githubusercontent.com/ROCm/vllm/refs/heads/gfx1250_bench/vllm_smoketest.sh
RUN curl -k -O https://raw.githubusercontent.com/ROCm/vllm/refs/heads/gfx1250_bench/vllm_benchserve.sh


### Install triton from upstream for AITER Deps TODO: (JPVILLAM) If possible to get this on whls it would be better
RUN pip3 uninstall -y triton && \
git clone https://github.com/triton-lang/triton.git && \
cd triton && \
git checkout c517f38c && \
git checkout aedd1f6 && \
TRITON_APPEND_CMAKE_ARGS="-DCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH=FALSE" pip3 install .

CMD ["/bin/bash"]
Expand Down
15 changes: 14 additions & 1 deletion tests/kernels/moe/test_ocp_mx_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@
ROCM_TRITON_KERNELS_AVAILABLE = False
ROCM_AITER_AVAILABLE = is_aiter_found()
ROCM_GFX950 = False
ROCM_GFX1250 = False

if ROCM_AVAILABLE:
from vllm.platforms.rocm import on_gfx950
from vllm.platforms.rocm import on_gfx950, on_gfx1250
from vllm.utils.import_utils import has_triton_kernels

ROCM_TRITON_KERNELS_AVAILABLE = has_triton_kernels()
ROCM_GFX950 = on_gfx950()
ROCM_GFX1250 = on_gfx1250()

if ROCM_AITER_AVAILABLE:
from aiter.ops.triton.quant import dynamic_mxfp4_quant
Expand Down Expand Up @@ -1568,6 +1570,15 @@ def test_trtllm_gen_mxfp8_block_scale_moe(
"requires_aiter": True,
"requires_gfx950": True,
},
"AITER_TRITON_MXFP4_MXFP4": {
"activation": "SILU",
"act_type": "mxfp4",
"rtol": 1.0,
"percent": 0.8,
"requires_aiter": True,
"requires_gfx950": False,
"requires_gfx1250": True,
},
}


Expand Down Expand Up @@ -1607,6 +1618,8 @@ def test_rocm_mxfp4_moe_oracle(
pytest.skip(f"Backend {backend_name} requires AITER")
if config["requires_gfx950"] and not ROCM_GFX950:
pytest.skip(f"Backend {backend_name} requires GFX950")
if config.get("requires_gfx1250") and not ROCM_GFX1250:
pytest.skip(f"Backend {backend_name} requires GFX1250")

import vllm.distributed.parallel_state as ps
from vllm.config import VllmConfig, set_current_vllm_config
Expand Down
63 changes: 63 additions & 0 deletions vllm/_aiter_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,39 @@ def _rocm_aiter_triton_gemm_a8w8_blockscale_fake(
return Y


def _rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle_impl(
A: torch.Tensor,
B: torch.Tensor,
As: torch.Tensor,
Bs: torch.Tensor,
output_dtype: torch.dtype = torch.bfloat16,
) -> torch.Tensor:
from aiter.ops.triton.gemm_a8w8_blockscale import gemm_a8w8_blockscale_preshuffle

n, k = B.shape
return gemm_a8w8_blockscale_preshuffle(
A,
B.reshape(n // 16, k * 16),
As,
Bs,
output_dtype,
None, # y
None, # config
False, # skip_reduce
False, # is_x_scale_transposed (misspelled in aiter)
)


def _rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle_fake(
A: torch.Tensor,
B: torch.Tensor,
As: torch.Tensor,
Bs: torch.Tensor,
output_dtype: torch.dtype = torch.bfloat16,
) -> torch.Tensor:
return torch.empty(A.shape[0], B.shape[0], dtype=output_dtype, device=A.device)


def _rocm_aiter_gemm_a8w8_blockscale_impl(
A: torch.Tensor,
B: torch.Tensor,
Expand Down Expand Up @@ -2924,6 +2957,12 @@ def register_ops_once() -> None:
fake_impl=_rocm_aiter_triton_gemm_a8w8_blockscale_fake,
)

direct_register_custom_op(
op_name="rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle",
op_func=_rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle_impl,
fake_impl=_rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle_fake,
)

direct_register_custom_op(
op_name="rocm_aiter_gemm_a8w8_blockscale",
op_func=_rocm_aiter_gemm_a8w8_blockscale_impl,
Expand Down Expand Up @@ -3238,6 +3277,19 @@ def triton_gemm_a8w8_blockscale(
A, B, As, Bs, output_dtype
)

@staticmethod
def triton_gemm_a8w8_blockscale_preshuffle(
A: torch.Tensor,
B: torch.Tensor,
As: torch.Tensor,
Bs: torch.Tensor,
block_size: list[int],
output_dtype: torch.dtype = torch.bfloat16,
) -> torch.Tensor:
return torch.ops.vllm.rocm_aiter_triton_gemm_a8w8_blockscale_preshuffle(
A, B, As, Bs, output_dtype
)

@staticmethod
def gemm_a8w8_blockscale(
A: torch.Tensor,
Expand Down Expand Up @@ -3993,6 +4045,17 @@ def is_triton_gemm_w8a8_tuned(n: int, k: int) -> bool:
except (AssertionError, ImportError):
return False

@staticmethod
@if_aiter_supported
def is_triton_blockscale_bpreshuffle_gemm_tuned(n: int, k: int) -> bool:
from aiter.ops.triton.utils.gemm_config_utils import (
get_gemm_config,
)

# Fake M value for now
_, is_tuned = get_gemm_config("GEMM-A8W8_BLOCKSCALE_PRESHUFFLED", 1, n, k)
return is_tuned

@staticmethod
@functools.cache
def is_triton_gemm_afp4wfp4_presh_ws_tuned(n: int, k_bytes: int) -> bool:
Expand Down
3 changes: 3 additions & 0 deletions vllm/config/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def with_default(
"aiter",
"aiter_mega_moe",
"aiter_triton_mxfp4_bf16",
"aiter_triton_mxfp4_mxfp4",
"flydsl",
"hpc",
"emulation",
Expand Down Expand Up @@ -329,6 +330,8 @@ class KernelConfig:
DeepSeek-V4 only)
- "aiter_triton_mxfp4_bf16": Use the AITER Triton MXFP4 W4A16
(moe_gemm_a16w4) MoE kernel (ROCm gfx942/gfx950/gfx1250)
- "aiter_triton_mxfp4_mxfp4": Use the AITER Triton/Gluon MXFP4 W4A4
(moe_gemm_a4w4) MoE kernel (ROCm gfx1250)
- "flydsl": Use AMD FlyDSL kernels (ROCm only)
- "rdna3": Use the fused RDNA3 W4A16 HIP kernel (ROCm gfx1100 only)
- "hpc": Use HPC kernels (FP8 and Hopper only)
Expand Down
39 changes: 38 additions & 1 deletion vllm/model_executor/kernels/linear/scaled_mm/aiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
rocm_aiter_ops,
)
from vllm.logger import init_logger
from vllm.model_executor.layers.quantization.input_quant_fp8 import QuantFP8
from vllm.model_executor.layers.quantization.utils.fp8_utils import (
_upcast_e8m0_to_fp32,
)
Expand Down Expand Up @@ -399,6 +400,26 @@ def __init__(self, config: FP8ScaledMMLinearLayerConfig):
rocm_aiter_ops.is_triton_gemm_w8a8_tuned(n, k) or _on_gfx1250
)

self.use_bpreshuffle = (
_on_gfx1250
and n % 16 == 0
and k % 128 == 0
and bool(rocm_aiter_ops.is_triton_blockscale_bpreshuffle_gemm_tuned(n, k))
)
if self.use_bpreshuffle:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should we consider creating a AiterBpreshuffledFp8BlockScaledMMKernel backend?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just trying to keep the PR length somewhat manageable but that is a good suggestion I can take it as a follow up

# The tuned preshuffle configs expect a column-major group scale.
act_scale_descriptor = config.activation_quant_key.scale
self.quant_fp8 = QuantFP8(
static=act_scale_descriptor.static,
group_shape=act_scale_descriptor.group_shape,
num_token_padding=self.get_output_padding(),
use_ue8m0=False,
column_major_scales=True,
)
logger.info_once(
"Using aiter A8W8 blockscale B-preshuffle GEMM for N=%d K=%d", n, k
)

def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
super().process_weights_after_loading(layer)

Expand All @@ -410,6 +431,18 @@ def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
if ws is not None and ws.dtype == torch.float8_e8m0fnu:
replace_parameter(layer, attr, _upcast_e8m0_to_fp32(ws).contiguous())

if getattr(layer, "is_bmm", False):
self.use_bpreshuffle = False

if self.use_bpreshuffle:
w = FP8BlockParams.from_layer(layer).weight
replace_parameter(
layer,
FP8BlockParams.WEIGHT,
rocm_aiter_ops.shuffle_weight(w.data, layout=(16, 16)),
)
layer.aiter_bpreshuffled = True

@classmethod
def is_supported(cls, compute_capability=None):
if (
Expand Down Expand Up @@ -464,7 +497,11 @@ def apply_block_scaled_mm(
Bs = Bs.to(torch.float32)

out_dtype = self.config.out_dtype
if self.use_triton:
if self.use_bpreshuffle:
gemm_a8w8_blockscale_op = (
rocm_aiter_ops.triton_gemm_a8w8_blockscale_preshuffle
)
elif self.use_triton:
gemm_a8w8_blockscale_op = rocm_aiter_ops.triton_gemm_a8w8_blockscale
else:
gemm_a8w8_blockscale_op = rocm_aiter_ops.gemm_a8w8_blockscale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def _aiter_w4a16_silu_via_a8w4(
from aiter.ops.triton.moe_op_gemm_a8w4 import moe_gemm_a8w4

from vllm.model_executor.layers.quantization.utils.mxfp4_utils import (
should_use_cdna4_mx_scale_swizzle,
get_aiter_mx_scale_swizzle,
)

swz = "CDNA4_SCALE" if should_use_cdna4_mx_scale_swizzle() else None
swz = get_aiter_mx_scale_swizzle()
quant_dtype = torch.float8_e4m3fn

g1_gammas = gammas if apply_router_weight_on_input else None
Expand Down Expand Up @@ -160,7 +160,11 @@ def aiter_triton_kernel_w4a16_moe_forward(
gating_output,
topk,
score_mode=score_mode,
bias=e_score_correction_bias,
bias=(
e_score_correction_bias.float()
if e_score_correction_bias is not None
else None
),
renorm=renormalize,
routed_scaling_factor=(
routed_scaling_factor if routed_scaling_factor is not None else 1.0
Expand Down
Loading
Loading