Skip to content

[HIP] [MoE] Qwen3.8-Flash-Next MXFP4 TP2/TP4: aux shape gates and FlyDSL rows for padded inter_dim, M>=1024 - #8123

Merged
yifehuan merged 3 commits into
ROCm:mainfrom
mjkvaak-amd:qwen3-8-flash-fp4-fmoe-tp2-i384
Nov 18, 2026
Merged

yifehuan merged 3 commits into
ROCm:mainfrom
mjkvaak-amd:qwen3-8-flash-fp4-fmoe-tp2-i384

Conversation

@mjkvaak-amd

@mjkvaak-amd mjkvaak-amd commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds MXFP4 aux shape-gate entries and tuned FlyDSL 2-stage rows for the Qwen3.8-Flash-Next MoE in the shapes vLLM passes at TP2 (inter_dim=384) and TP4 (inter_dim=256), both with intermediate_pad=64. The rows cover M = 1024..16384, so through M bucketing they serve runtime M = 513..16384, which is prefill. For M <= 512, the rows keyed at the true widths 320 and 160 (#5757, #7901) remain in charge; #7611 is what reaches them.

Motivation

moe_intermediate_size=640 gives 320 per rank at TP2 and 160 at TP4. vLLM pads W4A4 MoE weights to a multiple of 128, so AITER sees 384 and 256. Neither width has tuned rows, and neither aux shape ((513, 2560, 512, 11) and (513, 2560, 256, 11)) is gated. As a result every FlyDSL MXMOE row is rejected, and each prefill batch runs the heuristic fallback (flydsl_moe1_afp4_wfp4_*).

Not a duplicate: I searched the open PRs for Qwen3.8-Flash-Next, 2560/384, 2560/256 and inter_dim. #5757 and #7901 add rows at the true widths for M <= 512, and none of the others covers the padded widths.

Changes

There are no M <= 512 rows on purpose. The winners there are BM16 f16in (inline-sort) kernels, and _mxfp4_inline_sort_unsupported discards those under any pad. vLLM always sets a pad here, so the rows would never run, and they would also shadow #7611's retry at inter_dim - pad. All ten shipped rows are non-inline-sort (BM 32/64/128).

This does not help decode, and it does not cover TP1 (inter_dim=640, which needs no pad).

Performance (if applicable)

Kernel benchmark: fmoe_pad_bench.py (attached under Validation below) times one whole fused_moe call, including sorting, activation quantization and both stages, set up the way vLLM sets it up.

  • Arms. MI355X, image vllm/vllm-openai-rocm:nightly-rocm100-8ca766326652 (AITER 0.1.29), one GPU per arm. The before arm is the image unchanged. The after arm bind-mounts two files over the installed package: moe_mxfp4_aux.py with this PR's gate entries, and this PR's qwen3_8_flash_fp4_tuned_fmoe.csv. Nothing else differs.
  • Inputs. H=2560, E=513, top-k 11, SiLU, bf16 input quantized per 1x32 to MXFP4 inside the call. Gate, up and down weights are random bf16 at the true width (320 at TP2, 160 at TP4). They are zero-padded to 384 or 256 the way vLLM stores them (gate and up halves padded separately, w2 padded along K), then quantized per 1x32 to fp4x2 and shuffled. intermediate_pad=64. Routing comes from random scores through fused_topk, so expert load is close to uniform. The seed is fixed per M.
  • Timing. Two eager warm-up calls, then a CUDA graph capturing max(4, min(50, 20000 // M)) back-to-back calls (39 at M=512, 4 at M>=4096), one warm-up replay and 9 timed replays with HIP events. A run reports the median replay time divided by the calls per graph.
  • Rounds.
    • TP2: 2 rounds, with the arms running at the same time on two GPUs and swapping GPUs between rounds. The table shows the mean; the two rounds differ by at most 2% (4096 before, 8192 after).
    • TP4: 4 rounds across four GPUs. The table shows the median because single runs had outliers: before round 1 at M=1024 (160 µs against 142–146), and after round 2 at M=1024, 2048 and 8192 (321, 177 and 487 µs against 128, 167–168 and 420–424). Every other run is within 3% of the median.
    • TP2 M=768 is a single run per arm, because the other two runs hit OOM from another job on the GPU.
  • Dispatch check. AITER_LOG_MORE=1. In the before arm every M logs no tuned FlyDSL config ... heuristic FlyDSL fallback. In the after arm M>=1024 logs this PR's kernel names, and M=512 logs the fallback in both arms. M=512 is the control: it has no row here.
M TP2 before → after µs TP2 change TP4 before → after µs TP4 change
512 (control) 172.5 → 171.9 flat 120.2 → 120.7 flat
768 (M=1024 row) 182.0 → 154.7 -15% 130.4 → 120.6 -8%
1024 192.0 → 161.0 -16% 145.5 → 128.0 -12%
2048 258.8 → 198.4 -23% 213.2 → 167.6 -21%
4096 401.9 → 325.3 -19% 349.7 → 256.5 -27%
8192 723.2 → 497.7 -31% 618.9 → 422.3 -32%
16384 1401.0 → 827.6 -41% 1081.2 → 650.6 -40%

The relative L2 error against an fp32 MoE computed at the true width is unchanged to the fourth decimal at every M: about 0.289, which is the combined W4A4 quantization error and is identical in both arms. At TP4, passing the true pad of 96, as vllm#64025 would, gives the same times and errors.

Serving, TP2: vLLM in the same image, with the arms side by side on two GPU pairs and swapped between 2 rounds. Each cell is the mean of the two rounds' medians.

--max-num-batched-tokens TTFT 8k in, c64 (ms) TTFT 32k in, c8 (ms) Decode 8k in / 512 out, c64 (out tok/s)
4096 24104 → 23594 (-2.1%) 10510 → 10288 (-2.1%) 939 → 955 (+1.7%)
8192 20200 → 19753 (-2.2%) 7060 → 6911 (-2.1%) 951 → 964 (+1.4%), one wave
16384 13675 → 13481 (-1.4%) 8153 → 8031 (-1.5%) 944 → 946 (+0.2%)
  • The decode cell sends two waves of 64 requests. At MBT 8192 that showed -5.6%: with faster prefill, the second wave lines up differently and leaves a decode-only tail in the tuned arm. A single wave (64 prompts) removes the alignment effect, so that is what the table shows.
  • Decode-only steps (M <= 512) use the same kernels in both arms.
  • An 8k in, c16 cell was also run. It is the first cell after server start and has only 32 prompts, so it swings by -15% to +25% between rounds and is left out.

Accuracy: GSM8K 5-shot chat, n = 1319, flexible-extract.

  • TP2: 0.9644 → 0.9629; 18 items correct only before and 16 only after; exact McNemar p = 0.86.
  • TP4: 0.9636 → 0.9621; 21 before only and 19 after only; p = 0.875.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Config data and shape lists only.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None.

PR Self-Review

Reviewed revision

01f2011

Behavior and intent

Prefill-sized MXFP4 MoE calls for Qwen3.8-Flash-Next at TP2 (inter_dim=384) and TP4 (inter_dim=256), with intermediate_pad=64 and M in 513..16384, now run tuned FlyDSL 2-stage kernels. Before this PR they ran the heuristic fallback, because the padded widths had no rows and no aux gate.

Validation and unverified scope

python3 -m pytest -q op_tests/test_mxfp4_moe_aux_codegen.py passes (3 tests) with both new shapes. The kernel A/B uses fmoe_pad_bench.py (below), run with and without this PR's files in the rounds described under Performance, using TRUE_INTER=320 INTER=384 for TP2 and TRUE_INTER=160 INTER=256 for TP4. The serving A/B and GSM8K results are listed above.

Remaining and unverified:

  • The TP4 serving A/B is not reported. Another job shared one of the four GPUs during both arms, both stalled, and the numbers are not usable.
  • MI250X and MI300X are not tested; the rows are gfx950-only.
  • The kernel A/B uses uniform random routing, not the model's real routing.
  • TP2 serving has 2 rounds per MBT setting, and the MBT 8192 one-wave decode cell has 1.
fmoe_pad_bench.py
"""Graph-replayed AITER fused_moe for Flash-Next TP2 as vLLM calls it.

    python3 fmoe_pad_bench.py <tag>

The true per-rank intermediate width is TRUE_INTER (TP2: 320, TP4: 160). Weights
are zero-padded to INTER (384, 256) the way vLLM stores them (gate and up halves
each padded, w2 K tail padded) and fused_moe gets intermediate_pad=PAD, by
default INTER - TRUE_INTER. vLLM's aiter_moe_pads rounds the pad down to a
multiple of 64, so it passes 64 at both TP2 and TP4. Each output is compared against an fp32 MoE computed from the
unpadded bf16 weights at width TRUE_INTER. Which tuned rows apply is decided by the
CSV and aux gate installed in the container, not here.
"""

import json
import os
import sys

import torch
import torch.nn.functional as F

import aiter
from aiter import QuantType, dtypes, get_torch_quant
from aiter.fused_moe import fused_moe, fused_topk
from aiter.ops.shuffle import shuffle_weight
from aiter.utility import fp4_utils

tag = sys.argv[1]
H, E, TOPK = 2560, 513, 11
TRUE = int(os.environ.get("TRUE_INTER", "320"))
INTER = int(os.environ.get("INTER", "384"))
PAD = int(os.environ.get("PAD", INTER - TRUE))
TOKENS = [int(t) for t in os.environ.get("TOKENS", "512,1024,2048,4096,8192,16384").split(",")]
torch.manual_seed(0)
g1 = torch.randn(E, TRUE, H, dtype=torch.bfloat16, device="cuda") / 16
u1 = torch.randn(E, TRUE, H, dtype=torch.bfloat16, device="cuda") / 16
w2t = torch.randn(E, H, TRUE, dtype=torch.bfloat16, device="cuda") / 16
w1 = torch.zeros(E, 2 * INTER, H, dtype=torch.bfloat16, device="cuda")
w1[:, :TRUE], w1[:, INTER : INTER + TRUE] = g1, u1
w2 = torch.zeros(E, H, INTER, dtype=torch.bfloat16, device="cuda")
w2[:, :, :TRUE] = w2t
tq = get_torch_quant(QuantType.per_1x32)
w1q, w1s = tq(w1, quant_dtype=dtypes.fp4x2)
w2q, w2s = tq(w2, quant_dtype=dtypes.fp4x2)
del w1, w2
w1q = shuffle_weight(w1q.view(E, 2 * INTER, H // 2), layout=(16, 16))
w2q = shuffle_weight(w2q.view(E, H, INTER // 2), layout=(16, 16))
w1s, w2s = fp4_utils.e8m0_shuffle(w1s), fp4_utils.e8m0_shuffle(w2s)
kw = dict(w1_scale=w1s, w2_scale=w2s, quant_type=QuantType.per_1x32,
          activation=aiter.ActivationType.Silu, intermediate_pad=PAD)


def reference(x, tw, ti):
    ref = torch.zeros(x.shape[0], H, dtype=torch.float32, device="cuda")
    xf = x.float()
    for e in torch.unique(ti).tolist():
        tok, slot = (ti == e).nonzero(as_tuple=True)
        y = (F.silu(xf[tok] @ g1[e].float().t()) * (xf[tok] @ u1[e].float().t())) @ w2t[e].float().t()
        ref.index_add_(0, tok, y * tw[tok, slot].float().unsqueeze(1))
    return ref


res = {}
for M in TOKENS:
    g = torch.Generator(device="cuda").manual_seed(M)
    x = torch.randn(M, H, dtype=torch.bfloat16, device="cuda", generator=g)
    score = torch.randn(M, E, dtype=torch.bfloat16, device="cuda", generator=g)
    tw, ti = fused_topk(x, score, TOPK, True)
    fn = lambda: fused_moe(x, w1q, w2q, tw, ti, **kw)
    out = fn().float()
    torch.cuda.synchronize()
    ref = reference(x, tw, ti)
    rel = ((out - ref).norm() / ref.norm()).item()
    finite = bool(torch.isfinite(out).all())
    reps = max(4, min(50, 20000 // M))
    s = torch.cuda.Stream()
    s.wait_stream(torch.cuda.current_stream())
    with torch.cuda.stream(s):
        for _ in range(2):
            fn()
    torch.cuda.current_stream().wait_stream(s)
    graph = torch.cuda.CUDAGraph()
    with torch.cuda.graph(graph):
        for _ in range(reps):
            fn()
    graph.replay()
    torch.cuda.synchronize()
    times = []
    for _ in range(9):
        a, b = torch.cuda.Event(enable_timing=True), torch.cuda.Event(enable_timing=True)
        a.record()
        graph.replay()
        b.record()
        b.synchronize()
        times.append(a.elapsed_time(b) * 1e3 / reps)
    times.sort()
    res[M] = {"us": times[len(times) // 2], "us_min": times[0], "rel_l2": rel, "finite": finite}
    print(f"{tag} M={M:6d} {res[M]['us']:9.1f} us  rel_l2 {rel:.4f}  finite {finite}", flush=True)
    del graph

json.dump(res, open(f"pad_{tag}.json", "w"), indent=1)

PR-specific question

Which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?

  • Selection. Only the exact tuned-row key reaches the new kernels: (gfx950, cu_num=256, padded M, 2560, inter_dim 384 or 256, 513, 11, Silu, bf16 out, fp4x2 activations and weights, per_1x32, g1u1, doweight_stage1=0). Everything else misses and keeps today's path. get_padded_M maps runtime M to the next power of two, so the rows serve M = 513..16384. M <= 512 has no row here, and M >= 16385 uses the heuristic as before.
  • The gates. They are the codegen's rounding of 384 to 512 and of 256 to 256, and they make is_mxfp4_moe_shape_supported true for these four-tuples only. test_mxfp4_moe_aux_codegen.py checks that the gate list and the codegen SHAPES agree.
  • Invariant. get_2stage_cfgs still validates every tuned MXMOE row and falls back on any failure. It checks the sort block_m against GEMM1 BM and GEMM2, the registered aux shape, the input dtype for inline_quant, stage-2 bias, and EP expert_mask. No shipped row is inline-sort, so the padding rejection in _mxfp4_inline_sort_unsupported does not apply, and the rows run with the pad vLLM passes, as the kernel A/B shows.

Changed op tests

None.

Co-authored-by: Cursor [email protected]

… rows for inter_dim=384, M>=1024

vLLM stores the TP2 MoE intermediate (320) padded to 384 with
intermediate_pad=64. Add (513, 2560, 512, 11) to the MXFP4 aux shape gate
and tuned 2-stage FlyDSL rows for M = 1024..16384. Smaller M is left to
the 320-keyed rows that ROCm#7611 reaches: the inline-sort winners at M <= 512
are rejected under a pad and would shadow them.

Signed-off-by: Mikko Tukiainen <[email protected]>
Co-authored-by: Cursor <[email protected]>
@mjkvaak-amd
mjkvaak-amd requested a review from a team November 17, 2026 18:14
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 8123 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot changed the title [Config][MoE] Qwen3.8-Flash-Next MXFP4 TP2: aux shape gate and FlyDSL rows for inter_dim=384, M>=1024 [HIP] [MoE] Qwen3.8-Flash-Next MXFP4 TP2: aux shape gate and FlyDSL rows for inter_dim=384, M>=1024 Nov 17, 2026
@github-actions github-actions Bot added the HIP label Nov 17, 2026
@aiter-bot

aiter-bot commented Nov 17, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 01f20112ef6d · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

Prefill-sized MXFP4 MoE calls for Qwen3.8-Flash-Next at TP2 (`inter_dim=384`) and TP4 (`inter_dim=256`), with `intermediate_pad=64` and M in 513..16384, now run tuned FlyDSL 2-stage kernels. Before this PR they ran the heuristic fallback, because the padded widths had no rows and no aux gate.

Validation and unverified scope

`python3 -m pytest -q op_tests/test_mxfp4_moe_aux_codegen.py` passes (3 tests) with both new shapes. The kernel A/B uses `fmoe_pad_bench.py` (below), run with and without this PR's files in the rounds described under Performance, using `TRUE_INTER=320 INTER=384` for TP2 and `TRUE_INTER=160 INTER=256` for TP4. The serving A/B and GSM8K results are listed above.

Remaining and unverified:

- The TP4 serving A/B is not reported. Another job shared one of the four GPUs during both arms, both stalled, and the numbers are not usable.
- MI250X and MI300X are not tested; the rows are gfx950-only.
- The kernel A/B uses uniform random routing, not the model's real routing.
- TP2 serving has 2 rounds per MBT setting, and the MBT 8192 one-wave decode cell has 1.

<details>
<summary>fmoe_pad_bench.py</summary>

```python
"""Graph-replayed AITER fused_moe for Flash-Next TP2 as vLLM calls it.

    python3 fmoe_pad_bench.py <tag>

The true per-rank intermediate width is TRUE_INTER (TP2: 320, TP4: 160). Weights
are zero-padded to INTER (384, 256) the way vLLM stores them (gate and up halves
each padded, w2 K tail padded) and fused_moe gets intermediate_pad=PAD, by
default INTER - TRUE_INTER. vLLM's aiter_moe_pads rounds the pad down to a
multiple of 64, so it passes 64 at both TP2 and TP4. Each output is compared against an fp32 MoE computed from the
unpadded bf16 weights at width TRUE_INTER. Which tuned rows apply is decided by the
CSV and aux gate installed in the container, not here.
"""

import json
import os
import sys

import torch
import torch.nn.functional as F

import aiter
from aiter import QuantType, dtypes, get_torch_quant
from aiter.fused_moe import fused_moe, fused_topk
from aiter.ops.shuffle import shuffle_weight
from aiter.utility import fp4_utils

tag = sys.argv[1]
H, E, TOPK = 2560, 513, 11
TRUE = int(os.environ.get("TRUE_INTER", "320"))
INTER = int(os.environ.get("INTER", "384"))
PAD = int(os.environ.get("PAD", INTER - TRUE))
TOKENS = [int(t) for t in os.environ.get("TOKENS", "512,1024,2048,4096,8192,16384").split(",")]
torch.manual_seed(0)
g1 = torch.randn(E, TRUE, H, dtype=torch.bfloat16, device="cuda") / 16
u1 = torch.randn(E, TRUE, H, dtype=torch.bfloat16, device="cuda") / 16
w2t = torch.randn(E, H, TRUE, dtype=torch.bfloat16, device="cuda") / 16
w1 = torch.zeros(E, 2 * INTER, H, dtype=torch.bfloat16, device="cuda")
w1[:, :TRUE], w1[:, INTER : INTER + TRUE] = g1, u1
w2 = torch.zeros(E, H, INTER, dtype=torch.bfloat16, device="cuda")
w2[:, :, :TRUE] = w2t
tq = get_torch_quant(QuantType.per_1x32)
w1q, w1s = tq(w1, quant_dtype=dtypes.fp4x2)
w2q, w2s = tq(w2, quant_dtype=dtypes.fp4x2)
del w1, w2
w1q = shuffle_weight(w1q.view(E, 2 * INTER, H // 2), layout=(16, 16))
w2q = shuffle_weight(w2q.view(E, H, INTER // 2), layout=(16, 16))
w1s, w2s = fp4_utils.e8m0_shuffle(w1s), fp4_utils.e8m0_shuffle(w2s)
kw = dict(w1_scale=w1s, w2_scale=w2s, quant_type=QuantType.per_1x32,
          activation=aiter.ActivationType.Silu, intermediate_pad=PAD)


def reference(x, tw, ti):
    ref = torch.zeros(x.shape[0], H, dtype=torch.float32, device="cuda")
    xf = x.float()
    for e in torch.unique(ti).tolist():
        tok, slot = (ti == e).nonzero(as_tuple=True)
        y = (F.silu(xf[tok] @ g1[e].float().t()) * (xf[tok] @ u1[e].float().t())) @ w2t[e].float().t()
        ref.index_add_(0, tok, y * tw[tok, slot].float().unsqueeze(1))
    return ref


res = {}
for M in TOKENS:
    g = torch.Generator(device="cuda").manual_seed(M)
    x = torch.randn(M, H, dtype=torch.bfloat16, device="cuda", generator=g)
    score = torch.randn(M, E, dtype=torch.bfloat16, device="cuda", generator=g)
    tw, ti = fused_topk(x, score, TOPK, True)
    fn = lambda: fused_moe(x, w1q, w2q, tw, ti, **kw)
    out = fn().float()
    torch.cuda.synchronize()
    ref = reference(x, tw, ti)
    rel = ((out - ref).norm() / ref.norm()).item()
    finite = bool(torch.isfinite(out).all())
    reps = max(4, min(50, 20000 // M))
    s = torch.cuda.Stream()
    s.wait_stream(torch.cud

[truncated in readiness report; see the PR description for the full answer]

PR-specific question

> Which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?

- **Selection.** Only the exact tuned-row key reaches the new kernels: `(gfx950, cu_num=256, padded M, 2560, inter_dim 384 or 256, 513, 11, Silu, bf16 out, fp4x2 activations and weights, per_1x32, g1u1, doweight_stage1=0)`. Everything else misses and keeps today's path. `get_padded_M` maps runtime M to the next power of two, so the rows serve M = 513..16384. M <= 512 has no row here, and M >= 16385 uses the heuristic as before.
- **The gates.** They are the codegen's rounding of 384 to 512 and of 256 to 256, and they make `is_mxfp4_moe_shape_supported` true for these four-tuples only. `test_mxfp4_moe_aux_codegen.py` checks that the gate list and the codegen `SHAPES` agree.
- **Invariant.** `get_2stage_cfgs` still validates every tuned MXMOE row and falls back on any failure. It checks the sort `block_m` against GEMM1 BM and GEMM2, the registered aux shape, the input dtype for `inline_quant`, stage-2 bias, and EP `expert_mask`. No shipped row is inline-sort, so the padding rejection in `_mxfp4_inline_sort_unsupported` does not apply, and the rows run with the pad vLLM passes, as the kernel A/B shows.

Changed op tests

None.

Co-authored-by: Cursor <[email protected]>

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

… rows for inter_dim=256, M>=1024

TP4 stores the per-rank MoE intermediate (160) padded to 256. Gate
(513, 2560, 256, 11) and add tuned 2-stage FlyDSL rows for M = 1024..16384,
with the same scope as the TP2 rows: smaller M is left to the 160-keyed
rows that ROCm#7611 reaches.

Signed-off-by: Mikko Tukiainen <[email protected]>
Co-authored-by: Cursor <[email protected]>
@mjkvaak-amd mjkvaak-amd changed the title [HIP] [MoE] Qwen3.8-Flash-Next MXFP4 TP2: aux shape gate and FlyDSL rows for inter_dim=384, M>=1024 [Config][MoE] Qwen3.8-Flash-Next MXFP4 TP2/TP4: aux shape gates and FlyDSL rows for padded inter_dim, M>=1024 Nov 17, 2026
@github-actions github-actions Bot changed the title [Config][MoE] Qwen3.8-Flash-Next MXFP4 TP2/TP4: aux shape gates and FlyDSL rows for padded inter_dim, M>=1024 [HIP] [MoE] Qwen3.8-Flash-Next MXFP4 TP2/TP4: aux shape gates and FlyDSL rows for padded inter_dim, M>=1024 Nov 17, 2026
@zufayu
zufayu self-requested a review November 18, 2026 01:23
@zufayu zufayu self-assigned this Nov 18, 2026

@yifehuan yifehuan left a comment

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.

LGTM

@yifehuan
yifehuan merged commit d6d60ef into ROCm:main Nov 18, 2026
vstakhov-amd added a commit that referenced this pull request Nov 18, 2026
Resolve the conflict with #8123, which added tuned FlyDSL rows for
intermediate 384 at 1024..16384 tokens to the Flash MXFP4 config:
- keep the FlyDSL 8192 row. It serves 4097..8192 tokens, where the
  producer is 3% faster at 8192 but 8-22% slower at 4097..6000;
- the producer replaces the FlyDSL 16384 row and keeps its new 32768
  row, so intermediate 384 uses it from 8193 tokens, as intermediate
  640 already does.

The intermediate 640 rows, both code objects and the manifest rows are
unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants