Skip to content

[HIP] [FlyDSL] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input - #8011

Open
lirui927 wants to merge 22 commits into
ROCm:mainfrom
lirui927:perf/gfx1250-m3-qknorm
Open

lirui927 wants to merge 22 commits into
ROCm:mainfrom
lirui927:perf/gfx1250-m3-qknorm

Conversation

@lirui927

@lirui927 lirui927 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What it does

fused_qknorm_idxrqknorm (qk-norm, partial NeoX RoPE and the KV / index-cache write) gets faster on gfx1250 with the same outputs, can take the unreduced split-K partials of qkv, refuses bad arguments with an exception instead of aborting, and gains a query, fused_qknorm_idxrqknorm_supports. The branch contains main up to 4122ef5 and reuses the helpers #8472 added to this op.

  1. Faster on gfx1250, outputs bitwise unchanged.
    • The warp index is wave-uniform (readfirstlane), so the per-token tables are read with scalar loads; all independent loads are issued first.
    • Lane exchanges use DPP / v_permlanex16 in the original xor pairing order (a gfx12 branch in main's xorLane<M>); the RoPE partner is a DPP move for rotary_dim 64 only, as on main.
    • bf16 rounding uses v_cvt_pk_bf16_f32 (main's pfPackBf16).
    • Rows and cache rows are written with packed stores that claim no alignment (memcpy). The one-row kernel without the insert writes a lane's row with two 32-bit stores: one 64-bit store was up to 0.26 µs slower than main per call in a HIP graph at M ≤ 64.
    • Launches of at least 128 rows per CU take 4 rows per warp (every mode except the fp4 caches and fused qkv_partials; a reduce-first call can take them).
  2. qkv_partials (new optional argument): the fp32 [splits, >= num_tokens, row] split-K partials of a bf16 qkv (2, 4 or 8 splits).
    • The kernel sums them the way the gfx1250 split-K reduce kernel (gemm_a8w8_splitk_reduce) does (fp32, split order, one round to nearest even), writes the reduced row back into qkv and continues from it, so the GEMM in front ([FlyDSL] [Perf] Let the consumer finish a gfx1250 PTPC split-K GEMM #7449) can skip its reduce launch.
    • This module flushes denormals. A lane whose partials or running sums leave the normal range redoes its sum exactly in double, so the results stay bitwise.
    • Fused in the op's own pass in bf16 insert mode with every qkv slot processed, no fp4 cache and no fp8 q_out. Any other call reduces the partials into qkv first with a small kernel doing the same sum, then runs as on a reduced qkv. A caller passes the partials of any deferred qkv and does not need to know which modes fuse them.
  3. The multi-row and fused-partials kernels exist on gfx1250 only. Only the gfx1250 device pass builds them (static_assert elsewhere), and the host launches them only on a device that loads that code object. gfx942, gfx950 and gfx1250-strict run one row per warp and reduce the partials first; reduceQkvPartialsKernel is built everywhere.
  4. Errors instead of aborts. Arguments the op refuses (head_dim, rotary_dim, qkv / positions / cache / partials layout, dtype and device) raise RuntimeError before anything launches. The C++ entry checks the operands, so the Python fp8-cache asserts are gone, and with them the bug that an index-less layer (num_index_heads=0) with an fp8 KV cache was asked for index operands.
  5. fused_qknorm_idxrqknorm_supports(...) takes the op's arguments and returns whether the op takes the call. It runs the op with check_only=True: the wrapper's checks and every host check of the C++ entry run as for the real call, then the entry returns before the device guard and any launch. A refusal there is a quiet ValueError (AiterThrowGuard(/*quiet=*/true), opt-in), so only refusals answer False; a JIT build or load failure raises. It answers for the generic entry, leaves a parked QKV front ([FlyDSL] [Perf] MiniMax-M3.1 TP4 decode QKV front as one op: one-launch (1-64 rows) + split-K (65-128 rows) GEMM / norm / RoPE / NVFP4 insert #8607) parked, and does not take the raw NVFP4 front ([HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472). Eager only: under torch.compile the C++ checks do not run.
  6. The fp8 arch check matches the kernel. It counts an fp8 KV cache, an fp8 index cache and an e4m3 q_out / index_q_out only when the kernel writes them, treats gfx1250-strict as gfx1250, and looks the arch up only for an fp4 or fp8 store (assume_constant_result), so the default path costs what main's does and traces under torch.compile(fullgraph=True).

Benefit

MI455X (gfx1250), one idle GPU, image rocm/fw-bringup:gfx1250-minimax-m3-20261112, against main 4122ef5, interleaved. Measured at 56ee759, whose device code is the head's (ISA comparison under Testing). MiniMax-M3 TP4 per-rank shapes: 16 q, 1 KV and 1 index head, rotary 64.

Kernel time (run_perftest profiler time, median of 3 rounds, µs; a script outside the tree):

cache M main (min-max) head (min-max) head vs main
auto 1 2.72 (2.72-2.78) 2.12 (2.12-2.14) 1.28x
auto 16 3.33 (3.29-3.34) 2.61 (2.59-2.62) 1.28x
auto 64 3.71 (3.69-3.71) 2.71 (2.71-2.73) 1.37x
auto 512 6.56 (6.54-6.57) 4.73 (4.73-4.76) 1.39x
auto 2048 11.77 (11.69-11.80) 7.98 (7.95-8.09) 1.47x
auto 8192 31.51 (31.49-31.54) 17.65 (17.57-17.69) 1.79x
fp8_e4m3 1 2.89 (2.88-2.90) 2.22 (2.20-2.27) 1.30x
fp8_e4m3 16 3.43 (3.42-3.48) 2.69 (2.68-2.71) 1.28x
fp8_e4m3 64 4.04 (3.84-4.05) 2.79 (2.77-2.80) 1.45x
fp8_e4m3 512 6.39 (6.35-6.40) 4.93 (4.74-4.94) 1.30x
fp8_e4m3 2048 12.70 (12.67-12.70) 9.67 (9.60-9.77) 1.31x
fp8_e4m3 8192 32.46 (32.45-32.51) 19.40 (19.35-19.41) 1.67x

HIP graph, µs per call (median of 5 rounds):

case M main head head vs main
in place, no index head 1 1.872 1.345 1.39x
in place, no index head 16 1.932 1.353 1.43x
in place, no index head 64 2.012 1.395 1.44x
in place, no index head 2048 8.355 4.371 1.91x
in place, 1 index head 16 1.977 1.366 1.45x
insert, auto cache 16 2.585 1.833 1.41x

The in-place outputs are bitwise equal to main's in every case above. The op test's --minimax_benchmark (eager calls, mostly launch overhead) shows 0.97–1.02x of main up to M = 2048 and 1.08–1.25x at M = 8192.

qkv_partials has no baseline on main. In the op test's partials table on MI455X, run_perftest gives about 2.3–2.9 µs without partials and 3.8–4.3 / 5.0–5.9 / 7.9–8.5 µs with 2 / 4 / 8 splits; those inputs carry many edge-value columns, which take the exact (double) path, so these are upper bounds. The reduce launch it replaces costs 1.6–2.6 µs (#7449).

Cost, JIT build of the module for one arch from a clean build dir on CPU: gfx1250 62 s (main 28 s), gfx950 35 s (main 30 s), gfx942 36 s. fusedQKNormIdxrQKNormKernel instances: gfx1250 1160 (680 one-row, 432 multi-row, 48 that fuse qkv_partials), gfx942 / gfx950 680, as on main; plus one reduce kernel on every arch.

Testing

  • MI455X at the head (one idle GPU, the image above, module JIT-built for gfx1250 in the run):
    • python3 op_tests/test_fused_qknorm_idxrqknorm.py exits 0: every summary row passed; arg_reject, q_fp8_out and the qkv_partials* rows err 0, the eight 1639-token cases included. The fused 2-split partials take 3.8-4.3 µs, as at 56ee759.
    • python3 op_tests/test_fused_qknorm_idxrqknorm.py --minimax_tp4 exits 1 in pa_sparse_block_score_decode ("requires gfx950 architecture"), a case and an op this PR does not change.
    • python3 op_tests/test_fused_qknorm_nvfp4.py skips ("tested on gfx950 only"); python3 -m pytest -q -rs op_tests/test_flydsl_qkv_chain.py: 1 passed, 256 skipped ("gfx950 only").
  • Device assembly, per function, head vs cd5d83a (= 56ee759): gfx1250 1160 generic kernels, 2 prefill kernels, the reduce kernel and flush_cache; gfx950 and gfx942 680 + 2 + 2: all identical in body and descriptor.
  • Head vs main: the prefill kernels are identical on the three archs; every generic instance differs on every arch (one shared body). On gfx942 / gfx950: no scratch, occupancy unchanged, VGPR median 26 → 28.
  • Host pass of the kernel file at the head (--cuda-host-only -fsyntax-only): no errors. The JIT module builds for gfx1250, gfx950, gfx942 and gfx942;gfx950 at 56ee759.
  • Parked-front check: op_tests/test_flydsl_qkv_chain.py now asks fused_qknorm_idxrqknorm_supports before the real call and asserts the parked QKV front stays parked (gfx950 only: it skips on MI455X, so the added assertion has not run on hardware; first run is MI35X CI). The former mock-only tests/test_fused_qknorm_fronts.py (3 passed at 0e66537) and its split_tests.sh line are removed.
  • black and ruff are clean on the four changed Python files.
  • gfx942 / gfx950: MI300X and MI35X CI passed the op test at 30e2b20, before the re-port onto [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472; timing there is from CI logs only (reviewed at 30e2b20: MI35X 0.93–0.985x of main at M = 16384 on the same host class, MI300X fused_kernel_us at or below main's).

Not covered

  • op_tests/test_flydsl_qkv_chain.py (this PR's added assertion) and op_tests/test_fused_qknorm_nvfp4.py skip on gfx1250: no hardware run from us, they need MI35X CI. The JIT module build for gfx950 / gfx942 was not repeated at the head.
  • gfx1250-strict (MI450 A0): not compiled and not run. Its device pass builds no multi-row and no fused-partials kernel, so the host launches neither there (partials are reduced first); it also keeps the 64-bit row store and the software bf16 rounding in the one-row kernel, which was not timed on A0.
  • gfx942 / gfx950 run this branch's body with [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472's helpers, which no GPU has run yet; CI at the head is the first run, and the CI-log timing against current main is open until then. qkv_partials off gfx1250 (reduce first) runs only in CI.
  • The reduce-first path is checked for bits only and not timed. No current caller defers the GEMM in front of those modes at decode sizes.
  • The NVFP4 kernels (gfx950 only) were not run by us; their refusal cases ran on MI455X with the arch faked to gfx950.
  • Why a 64-bit row store is slow on gfx1250 only when the rows are read again soon is inferred (it looks like an L2 effect of full-line wave stores), not measured.

Dependencies

None to merge. #7449 (GEMM side, no shared files) produces the partials this op consumes. ROCm/ATOM#2988 and ROCm/ATOM#3405 (fused_qknorm_idxrqknorm_supports) call the op directly once this PR is merged. #8607's parked QKV front is a second, gfx950 / NVFP4-only way to leave the split-K sum to this op; qkv_partials stays the explicit one for a bf16 qkv on gfx1250. #8290 edits the same files; whichever lands second needs a rebase.

PR Self-Review

Reviewed revision

8b7ea11

Behavior and intent

  • gfx1250 speed-up with the same outputs: wave-uniform warp index with scalar table loads, loads issued up front, DPP / permlanex16 lane exchanges in the original xor order, v_cvt_pk_bf16_f32, packed stores, 4 rows per warp from 128 rows per CU. Kernel time vs main is 1.28x–1.79x on MiniMax-M3 TP4 shapes.
  • New optional qkv_partials (fp32 [splits, >= num_tokens, row], 2 / 4 / 8 splits): summed as gemm_a8w8_splitk_reduce does, bitwise under denormal flushing through an exact double redo, the reduced row written back into qkv. Fused on gfx1250 in bf16 insert mode with every qkv slot, no fp4 cache and no fp8 q_out; any other call reduces first with a small kernel doing the same sum.
  • The 4-rows-per-warp and fused-partials kernels are instantiated only in the gfx1250 device pass and launched only on a device that loads that code object. gfx942, gfx950 and gfx1250-strict run one row per warp and reduce partials first.
  • Refused arguments raise RuntimeError before any launch. fused_qknorm_idxrqknorm_supports runs the same checks with check_only, where a refusal is a quiet ValueError; build and load failures raise.
  • The Python fp8 arch check counts only the stores the kernel makes and looks the arch up only for fp4 / fp8 stores, so the default path has main's cost.

Validation and unverified scope

  • scratch_np/isa_host.sh <tree> <arch> <out.s> (host hipcc --cuda-device-only -S, JIT flags) and isacmp.py, this revision vs cd5d83a, for gfx1250, gfx950, gfx942: every kernel identical in body and descriptor (1160 + 2 + 2, 680 + 2 + 2, 680 + 2 + 2).
  • scratch_np/isa_host.sh <tree> gfx1250 <out> "--cuda-host-only -fsyntax-only": no errors.
  • black --check and ruff check --no-cache on op_tests/test_flydsl_qkv_chain.py at the head: clean; its new assertions run on gfx950 only and have not run.
  • python -m black --check and ruff check --no-cache on the four changed Python files: clean.
  • MI455X at this revision, one idle GPU: python3 op_tests/test_fused_qknorm_idxrqknorm.py exits 0 (every summary row passed; the qkv_partials table has err 0 in every row); python3 op_tests/test_fused_qknorm_idxrqknorm.py --minimax_tp4 exits 1 in pa_sparse_block_score_decode ("requires gfx950 architecture"), which this PR does not change; python3 op_tests/test_fused_qknorm_nvfp4.py and python3 -m pytest -q -rs op_tests/test_flydsl_qkv_chain.py skip on gfx1250 (1 passed, 256 skipped).
  • MI455X at 56ee759 (same device code), one idle GPU: kernel and HIP-graph times in the Benefit section; in-place outputs bitwise equal to main's.
  • At 56ee759, CPU: aiter.jit.core.build_module builds for gfx1250 (62 s), gfx950 (35 s), gfx942 (36 s), gfx942;gfx950 (61 s).
  • Unverified: op_tests/test_flydsl_qkv_chain.py (the assertion this PR adds) and op_tests/test_fused_qknorm_nvfp4.py on hardware (both skip on gfx1250; MI35X CI); the JIT module build for gfx950 / gfx942 at this revision; gfx1250-strict (judged from the arch macros only, not compiled, not run on A0); gfx942 / gfx950 on hardware with [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472's helpers, qkv_partials there, and their timing against current main; the NVFP4 kernels.

PR-specific question

The kernel body is shared by all archs; what protects gfx942 / gfx950, which run changed code this PR's author cannot execute?

Changed op tests

  • op_tests/test_flydsl_qkv_chain.py (two assertions added to the existing deferred-front insert helper)
    • Covers: fused_qknorm_idxrqknorm_supports on a call with a parked QKV front returns True and leaves the front parked; the real call that follows still consumes it.
    • Before this PR: fused_qknorm_idxrqknorm_supports does not exist.
    • Not redundant: no other test asks the capability query while a front is parked. It replaces a mock-only test file, so no CI list change is needed.
  • op_tests/test_fused_qknorm_idxrqknorm.py (extended, not duplicated)
    • Covers: a dense fp8 per-token case (num_index_heads=0); the qkv_partials* modes (sparse and dense layers, page-16 fp8 per-token / bf16 / page-128 caches, 2 / 4 / 8 splits, subnormal and tie sums in every head, overflow / NaN sums in one token), bit for bit against the op on the reduced qkv; qkv_partials_reject for the reduce-first modes and the refused partials; arg_reject: each refused argument raises in process, on a faked gfx1100 the two fp8-store calls are refused and the two calls that write no fp8 are taken, and all four are taken on a faked gfx1250-strict, supports() answers quietly and does not hide a load failure; on gfx1250 eight cases above 128 rows per CU, most with a row count that is not a multiple of 4, for the 4-rows-per-warp path and its tail rows.
    • Before this PR: the dense fp8 case trips the Python asserts; the partials modes fail because the argument does not exist; a refused argument aborts the test process.
    • Not redundant: no other test covers index-less fp8 layers, the partials input or the multi-row path.
  • op_tests/test_fused_qknorm_nvfp4.py (refusal harness only; the NVFP4 write cases are unchanged)
    • Covers: the NVFP4 contract violations raise RuntimeError with their own message before any launch, in this process; the --reject child-process entry is removed. On gfx950, supports() on the raw-front shape returns True and leaves the outputs untouched (not run here: no gfx950).
    • Before this PR: a failed host check aborted, so each case ran in a child process.
    • Not redundant: it is the only test of the NVFP4 refusals.

@lirui927
lirui927 force-pushed the perf/gfx1250-m3-qknorm branch from cd9fc7f to 0acef7c Compare November 16, 2026 05:35
@lirui927
lirui927 changed the base branch from xiaobingsuper/m3-mi455-perf-stack to main November 16, 2026 05:35
@lirui927
lirui927 force-pushed the perf/gfx1250-m3-qknorm branch from 0acef7c to ff79769 Compare November 16, 2026 06:36
@lirui927 lirui927 changed the title [HIP] [Perf] gfx1250: faster fused_qknorm_idxrqknorm for MiniMax-M3 [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, several rows per warp for large launches Nov 16, 2026
@lirui927
lirui927 force-pushed the perf/gfx1250-m3-qknorm branch from ff79769 to ea2cca7 Compare November 16, 2026 08:07
@lirui927 lirui927 changed the title [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, several rows per warp for large launches [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input Nov 16, 2026
lirui927 pushed a commit that referenced this pull request Nov 16, 2026
…ials as input (#8011)

Squash of #8011 at ea2cca7, by @lirui927.

#8011 brings the split-K partials consumer of 87a9321 (an earlier
#7449) to the optimized kernel, so the kernel and wrapper are
taken whole from #8011; the header and pybind already match.
lirui927 pushed a commit to ROCm/ATOM that referenced this pull request Nov 16, 2026
…m_idxrqknorm on gfx1250 (#3405)

Port of #3405 at 310014b, by @lirui927,
with the prefill split at 512 tokens (the crossover measured with page 128).
Needs ROCm/aiter#8011.

On top of the PR, for the stack's deferred split-K QKV: the decode insert
passes the partials to fused_qknorm_idxrqknorm when the kernel takes them
(aiter_qknorm_takes_partials) and reduces them first otherwise, as before.
@lirui927
lirui927 force-pushed the perf/gfx1250-m3-qknorm branch from ea2cca7 to e0c7c77 Compare November 16, 2026 14:32
@lirui927
lirui927 marked this pull request as ready for review November 16, 2026 14:40
@lirui927
lirui927 requested a review from a team November 16, 2026 14:40
@github-actions github-actions Bot added the HIP label Nov 16, 2026
@aiter-bot

aiter-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 8b7ea113964f · 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

- gfx1250 speed-up with the same outputs: wave-uniform warp index with scalar table loads, loads issued up front, DPP / `permlanex16` lane exchanges in the original xor order, `v_cvt_pk_bf16_f32`, packed stores, 4 rows per warp from 128 rows per CU. Kernel time vs main is 1.28x–1.79x on MiniMax-M3 TP4 shapes.
- New optional `qkv_partials` (fp32 `[splits, >= num_tokens, row]`, 2 / 4 / 8 splits): summed as `gemm_a8w8_splitk_reduce` does, bitwise under denormal flushing through an exact double redo, the reduced row written back into `qkv`. Fused on gfx1250 in bf16 insert mode with every qkv slot, no fp4 cache and no fp8 `q_out`; any other call reduces first with a small kernel doing the same sum.
- The 4-rows-per-warp and fused-partials kernels are instantiated only in the gfx1250 device pass and launched only on a device that loads that code object. gfx942, gfx950 and gfx1250-strict run one row per warp and reduce partials first.
- Refused arguments raise `RuntimeError` before any launch. `fused_qknorm_idxrqknorm_supports` runs the same checks with `check_only`, where a refusal is a quiet `ValueError`; build and load failures raise.
- The Python fp8 arch check counts only the stores the kernel makes and looks the arch up only for fp4 / fp8 stores, so the default path has main's cost.

Validation and unverified scope

- `scratch_np/isa_host.sh <tree> <arch> <out.s>` (host `hipcc --cuda-device-only -S`, JIT flags) and `isacmp.py`, this revision vs cd5d83ad, for gfx1250, gfx950, gfx942: every kernel identical in body and descriptor (1160 + 2 + 2, 680 + 2 + 2, 680 + 2 + 2).
- `scratch_np/isa_host.sh <tree> gfx1250 <out> "--cuda-host-only -fsyntax-only"`: no errors.
- `black --check` and `ruff check --no-cache` on `op_tests/test_flydsl_qkv_chain.py` at the head: clean; its new assertions run on gfx950 only and have not run.
- `python -m black --check` and `ruff check --no-cache` on the four changed Python files: clean.
- MI455X at this revision, one idle GPU: `python3 op_tests/test_fused_qknorm_idxrqknorm.py` exits 0 (every summary row `passed`; the `qkv_partials` table has err 0 in every row); `python3 op_tests/test_fused_qknorm_idxrqknorm.py --minimax_tp4` exits 1 in `pa_sparse_block_score_decode` ("requires gfx950 architecture"), which this PR does not change; `python3 op_tests/test_fused_qknorm_nvfp4.py` and `python3 -m pytest -q -rs op_tests/test_flydsl_qkv_chain.py` skip on gfx1250 (1 passed, 256 skipped).
- MI455X at 56ee759c (same device code), one idle GPU: kernel and HIP-graph times in the Benefit section; in-place outputs bitwise equal to main's.
- At 56ee759c, CPU: `aiter.jit.core.build_module` builds for gfx1250 (62 s), gfx950 (35 s), gfx942 (36 s), `gfx942;gfx950` (61 s).
- Unverified: `op_tests/test_flydsl_qkv_chain.py` (the assertion this PR adds) and `op_tests/test_fused_qknorm_nvfp4.py` on hardware (both skip on gfx1250; MI35X CI); the JIT module build for gfx950 / gfx942 at this revision; gfx1250-strict (judged from the arch macros only, not compiled, not run on A0); gfx942 / gfx950 on hardware with #8472's helpers, `qkv_partials` there, and their timing against current main; the NVFP4 kernels.

PR-specific question

The kernel body is shared by all archs; what protects gfx942 / gfx950, which run changed code this PR's author cannot execute?
- The changes keep the reduction pairing order and the rounding, and the gfx942 / gfx950 device code compiles without scratch at unchanged occupancy.
- MI300X and MI35X CI ran `op_tests/test_fused_qknorm_idxrqknorm.py` at 30e2b20f and it passed; CI at this revision has to pass again, because the body now sits on #8472's helpers.

Changed op tests

- `op_tests/test_flydsl_qkv_chain.py` (two assertions added to the existing deferred-front insert helper)
  - Covers: `fused_qknorm_idxrqknorm_supports` on a call with a parked QKV front returns True and leaves the front parked; the real call that follows still consumes it.
  - Before this PR: `fused_qknorm_idxrqknorm_supports` does not exist.
  - Not redundant: no other test asks the capability query while a front is parked. It replaces a mock-only test file, so no CI list change is needed.
- `op_tests/test_fused_qknorm_idxrqknorm.py` (extended, not duplicated)
  - Covers: a dense fp8 per-token case (`num_index_heads=0`); the `qkv_partials*` modes (sparse and dense layers, page-16 fp8 per-token / bf16 / page-128 caches, 2 / 4 / 8 splits, subnormal and tie sums in every head, overflow / NaN sums in one token), bit for bit against the op on the reduced `qkv`; `qkv_partials_reject` for the reduce-first modes and the refused partials; `arg_reject`: each refused argument raises in process, one row per clause of the Python fp8 gate on a faked gfx1100, `supports()` answers quietly and does not hide a load failure; on gfx1250 eight cases above 128 rows per CU, most with a row count that is not a multiple of 4, for the 4-rows-per-warp path and its tail rows.
  - Before this PR: the dense fp8 case trips the Python asserts; the partials modes fail because the argument does not exist; a refused argument aborts the test process.
  - Not redundant: no other test covers index-less fp8 layers, the partials input or the multi-row path.
- `op_tests/test_fused_qknorm_nvfp4.py` (refusal harness only; the NVFP4 write cases are unchanged)
  - Covers: the NVFP4 contract violations raise `RuntimeError` with their own message before any launch, in this process; the `--reject` child-process entry is removed. On gfx950, `supports()` on the raw-front shape returns True and leaves the outputs untouched (not run here: no gfx950).
  - Before this PR: a failed host check aborted, so each case ran in a child process.
  - Not redundant: it is the only test of the NVFP4 refusals.

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.

@lirui927
lirui927 requested a review from valarLip November 16, 2026 14:52
lirui927 and others added 3 commits November 17, 2026 02:07
…8 layer

With an fp8 KV cache the Python op asserted the index norm weights and
the index cache even for a layer without index heads (num_index_heads
0, a dense attention layer), where the kernel uses none of them. Only
ask for them when the layer has an index branch.

Adds a dense fp8 per-token case to the op test.

Signed-off-by: lirui927 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fusedQKNormIdxrQKNormKernel (qk-norm, partial NeoX RoPE and the KV /
index-cache write), with the same outputs:

- token and slot are wave-uniform on gfx12 (readfirstlane): scalar
  loads of the per-token tables, scalar branches on the slot kind
- every independent load goes out first (row, norm weight, position),
  the cos/sin loads as soon as the position arrives, the cache slot last
- one 64-bit store per lane for 16-bit rows, one 32-bit store for fp8
  K / index-cache rows
- warp reductions and RoPE partners with DPP / permlanex16 on gfx12, in
  the original xor pairing order
- bf16 rounding with v_cvt_pk_bf16_f32 on gfx1250 (the same bits as
  hip_bfloat16 for every non-NaN FP32 result)
- on gfx1250, launches of 128 or more (token, slot) rows per CU take 4
  rows per warp, in every mode but the fp4 caches (gfx950 only); other
  archs get a trap stub for that instantiation, which the launcher never
  selects there

The restructuring is shared by every arch: gfx942 and gfx950 compile to
different (not yet measured) code too.

Signed-off-by: lirui927 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
qkv_partials (optional, last argument): the fp32 [splits, >= num_tokens,
row] split-K partials of a bf16 qkv whose GEMM left them unreduced (2,
4 or 8 splits), so that the GEMM can skip its reduce kernel. Each lane
sums its elements as the gfx1250 split-K reduce kernel
(gemm_a8w8_splitk_reduce) does: fp32, split order, one round to nearest
even. It writes them back into qkv and goes on from them, so every
output is what reduce + qknorm produce. This module flushes f32
denormals and the reduce kernel does not, so a lane whose partials or
running sums leave the normal range redoes its sum exactly in double.

Supported: bf16 insert mode with every qkv slot processed, no fp4 cache
or fp8 q_out (refused on the host). The partials load has its own
instances (48, one row per warp); the other instances compile to the
same code as without this change.

The op test checks every output bitwise against the op on the reduced
qkv (a CPU fp32 sum in split order), with edge values (subnormal,
overflowing, NaN and tie sums), q to q_out and in place, and the
refused calls.

Signed-off-by: lirui927 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lirui927
lirui927 force-pushed the perf/gfx1250-m3-qknorm branch from e0c7c77 to 46fb3f4 Compare November 17, 2026 02:07
lirui927 pushed a commit to lirui927/ATOM that referenced this pull request Nov 17, 2026
…heir consumers

With ROCm/aiter#7449, aiter.gemm_a8w8_bpreshuffle_splitk_deferred leaves the
fp32 partials unreduced when the tuned gfx1250 PTPC GEMM splits K and M is at
most max_m; the consumer claims them (aiter.splitk_partials) and reduces them
as it reads the output.

- LinearBase.splitk_consumer_max_m (0 = off) routes the per-token FP8
  bpreshuffle GEMM through it. Not while a token graph records: its replay
  would run the consumer, an eager region, without the partials.
- MiniMax-M3 sets it on gfx1250 to ATOM_SPLITK_CONSUMER_REDUCE_MAX_M
  (default 64, 0 = off) for the QKV projections whose attention impl claims
  the partials in rope_cache (not under Ulysses SP, whose head exchange reads
  qkv first) and for the dense MLP's gate/up.
- PagedAttentionImpl.rope_cache hands them to triton_fused_norm_rope_cache;
  SparseMHAPagedAttentionImpl.rope_cache to aiter.fused_qknorm_idxrqknorm
  (qkv_partials, ROCm/aiter#8011) when that op takes them: the index branch
  runs, no fp4 cache, and an aiter with the argument. Every other path
  finishes qkv with the standalone reduce first. A dummy run releases them.
- swiglu_oai_split_reducing, an opaque op, claims a gate/up's partials at run
  time and reduces them in the activation kernel.

An aiter without #7449 never defers; one with #7449 but without #8011 defers
and reduces in the sparse layers with the standalone kernel, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lirui927 pushed a commit to lirui927/ATOM that referenced this pull request Nov 17, 2026
… decode

For a Gemma q/k norm layer with a plain NeoX RoPE and head_dim 128 (the
MiniMax-M3 dense layers), PagedAttentionImpl.rope_cache hands a decode batch
to aiter fused_qknorm_idxrqknorm on gfx1250 instead of
triton_fused_norm_rope_cache: one insert launch writes q and the normed,
roped K and V into the SHUFFLE cache, per-token FP8 or bf16. k and v are
not written back; the decode backends read only the cache.

It needs ROCm/aiter#8011, which lets a layer without index heads insert
into an FP8 cache (earlier versions assert index operands there) and
brings the faster gfx1250 kernel; ATOM reads that off
aiter.FUSED_QKNORM_IDXRQKNORM_SUPPORTS_INDEXLESS_FP8. Without it nothing
changes. The op aborts on arguments it refuses, so
_takes_aiter_gemma_norm_rope checks what the KV pool does not guarantee.

tests/model_ops/test_gemma_qknorm_rope_aiter_gpu.py runs rope_cache against
the Triton kernel (q, the dequantized K/V cache; pages of 16 and 128; CUDA
graph padding rows) and checks the route each batch takes.

Signed-off-by: lirui927 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efused arguments

A call whose mode does not sum the split-K partials in the op's own pass (no
insert, the index branch skipped, an fp4 cache, an e4m3 q_out) now reduces
them into qkv first with the same sum, so a caller passes the partials of
any deferred qkv without restating which modes fuse them. The fused
instantiations are unchanged (gfx1250 ISA identical).

Refused arguments (head_dim, rotary_dim, qkv / positions / cache layout and
dtype) now raise RuntimeError before anything launches instead of aborting
the process, so callers need not pre-check them; the test checks the
refusals in process. The fp8 arch check counts gfx1250-strict as gfx1250 and
also covers fp8 KV and index caches, which opus would store as zeros on
gfx11, as it already did an e4m3 q_out.

Drop FUSED_QKNORM_IDXRQKNORM_SUPPORTS_INDEXLESS_FP8: it existed only for a
caller to probe; callers raise their aiter floor instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lirui927

Copy link
Copy Markdown
Contributor Author

Follow-up for ROCm/ATOM#2988 and #3405 (ATOM must not probe aiter or restate its rules), in 8335393:

  • qkv_partials is now accepted in every mode. Where the op cannot sum the partials in its own pass (no insert, skip_index_branch, fp4 caches, an e4m3 q_out), it first reduces them into qkv with a small kernel that does the same sum, then runs as on a reduced qkv. Callers just pass the partials. The fused instantiations are unchanged (all 1160 gfx1250 instances have identical ISA).
  • Refused arguments now raise RuntimeError before anything launches (AiterThrowGuard) instead of aborting the process. This covers head_dim, rotary_dim, qkv / positions / cache layout and dtype. The fp8 arch check counts gfx1250-strict as gfx1250 and now also covers fp8 KV / index caches, which opus would store as zeros on gfx11.
  • FUSED_QKNORM_IDXRQKNORM_SUPPORTS_INDEXLESS_FP8 is dropped. It existed only so ATOM could probe for it; ATOM raises its aiter floor instead. The two existing flags on main stay.
  • Test: qkv_partials_reject now checks the non-fused modes bitwise against the reduced-qkv call. A new arg_reject mode checks that each refused argument raises in process, and the reject harness no longer needs a child process. On MI455X: 28/28 cases pass, versus 27/27 at the previous head.

A caller with another path can ask whether the op takes a call instead of
restating its limits. The query runs the op itself with check_only: the
Python wrapper's checks and every host check of the C++ entry run as for
the real call, then it returns before the device guard and any launch. One
set of checks serves both the refusal (RuntimeError) and the query (False).
The reject harness asks the query for every case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lirui927

Copy link
Copy Markdown
Contributor Author

Added fused_qknorm_idxrqknorm_supports(...) in f646b7e, so a caller that has another path can ask instead of restating the op's limits:

  • It takes the op's own arguments and returns a bool. It runs the op with a new check_only=True: the Python wrapper's checks and every host check of the C++ entry run exactly as for the real call, then the entry returns before the device guard and any launch. One set of checks serves both the refusal (RuntimeError) and the query (False); there is no second copy of the rules.
  • The reject harness asks the query for every case: True for each accepted call, False for each refused one (arg_reject, qkv_partials_reject, the mxfp4 rejects).
  • Host-only change: all 1160 gfx1250 kernel instances keep identical ISA.
  • perf(mha): Gemma q/k norm + RoPE + KV write through aiter fused_qknorm_idxrqknorm on gfx1250 ATOM#3405 is being narrowed (update pushed after its TP4 run) to the long-prefill norm + RoPE route (non-insert mode). It uses this query to keep head_dim-256 layers on their own path. It doesn't depend on the index-less fp8 insert fix in commit 1, which stays as a real fix for fp8 inserts of dense layers.

lirui927 pushed a commit to lirui927/ATOM that referenced this pull request Nov 17, 2026
…easured choice

Drop the FUSED_QKNORM_IDXRQKNORM_SUPPORTS_INDEXLESS_FP8 probe, the copy of
fused_qknorm_idxrqknorm's argument limits (head_dim, rotary_dim, qkv,
positions, cache layout and dtype) and the getattr/hasattr checks on the
rotary module: with ROCm/aiter#8011 the op raises on anything it refuses
instead of aborting. ATOM keeps only its own choices: the route is opt-in
per model (`aiter_gemma_norm_rope`, set by the MiniMax-M3 dense layers it
was measured on), on the gfx1250 family (aiter's is_gfx1250_family, so
gfx1250-strict counts), into its SHUFFLE cache layout. Needs aiter with
#8011.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ Action required before merge (5)

Scope is fine: the perf rework, qkv_partials and fused_qknorm_idxrqknorm_supports belong together. ROCm/ATOM#3405 is waiting on this PR. It uses supports() as its only gate, so the query has to reject exactly what the launch path rejects, and do it quietly.

  1. Reject a non-fp16/bf16 qkv before the check_only return. The only dtype gate is AITER_DISPATCH_FLOATING16_TYPES_rmTorch at fused_qknorm_idxrqknorm.cu:2086, after if(check_only) return; at :2058. As a result, supports() returns True for an fp32 qkv and then the op raises. Add AITER_CHECK(qkv.dtype() == AITER_DTYPE_bf16 || qkv.dtype() == AITER_DTYPE_fp16, ...) with the other checks, plus an arg_reject case.
  2. Stop supports() from turning build or load failures into False. fused_qknorm_idxrqknorm.py:221 catches every RuntimeError, which includes the JIT build failure (raise_build_error in aiter/jit/core.py) and the pybind ABI-mismatch error. A broken install then looks like "unsupported", and the caller falls back silently on every call. Either load the module outside the try, or raise a dedicated refusal exception and catch only that.
  3. Keep check_only quiet. check_fail (aiter_hip_common.h) writes [AITER] file:line ... to stderr before it throws, even under AiterThrowGuard. Every False from supports() therefore prints a line: ATOM#3405 asks for each head_dim-256 layer on every long prefill. Skip the print when the check is a query, or print only on the abort path.
  4. Raise RuntimeError instead of bare assert in the fp8-cache branch (fused_qknorm_idxrqknorm.py:171-183). The comment at :130 promises RuntimeError. Under python -O these asserts vanish, so supports() answers True and the C++ entry rejects the call later.
  5. Add a correctness case for the 4-rows-per-warp path. kRows=4 is used only when there are at least 128 * CUs rows (.cu:1393-1398). The largest non-fp4 default case is 64 tokens, and --minimax_tp4 uses 3, so the new path and its tail rows (min(row_token, num_tokens - 1), .cu:957) never run in the op test. Add a gfx1250-gated default case above the threshold whose row count is not a multiple of 4.

Also note: gfx942/gfx950 now run changed shared code that has not been executed there yet. Please merge only after aiter-test (MI300X / MI35X) has run op_tests/test_fused_qknorm_idxrqknorm.py green; it was still pending at review time. Non-blocking: the kRows=4 instances are built for every arch but trap off gfx1250, which accounts for most of the 680 -> 1160 instance growth and the 23 s -> 63 s JIT build. Nit: the message at .cu:1649 does not mention num_index_heads.


Reviewed at f646b7e.

- A non-fp16/bf16 qkv is refused with the other host checks, so check_only
  (and fused_qknorm_idxrqknorm_supports) sees it.
- Under check_only a refusal raises ValueError (std::invalid_argument from
  the C++ entry), and supports() catches only that: a JIT build or module
  load failure raises instead of reading as "not supported". Real calls
  still raise RuntimeError.
- AiterThrowGuard(quiet): a failed check throws without the stderr line;
  the entry uses it under check_only. Other guards are unchanged.
- The Python fp8-cache asserts are dropped: the C++ entry checks the same
  operands (slot_mapping, V cache, index operands, k/v scales) under the
  throw guard, so they raise RuntimeError, also under python -O.
- Test: gfx1250 cases above 128 rows per CU with a row count that is not a
  multiple of 4 (the 4-rows-per-warp path and its tail), a float32 qkv
  refusal, supports() quiet on stderr for every refused case, and a load
  failure raising through supports().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lirui927

Copy link
Copy Markdown
Contributor Author

Thanks. New commit 930db88 (one commit on top of 30e2b20). Item by item:

1. gfx1250 in-place small-M slowdown: found and fixed. The cause is the row store, not the load order.

  • Cause. The one-row non-insert kernel (the in-place call) wrote each lane's row back with one global_store_b64, so a wave filled two whole 128 B lines in one instruction. Main used four global_store_d16_hi_b16. We bisected on MI455X. The test kernel was a gfx1250-only copy of the one-row in-place body, with main's or this PR's version of each piece selected by -D switches. Timing: 57-call HIP graph, µs per call, median of 3 interleaved rounds. All outputs were bitwise equal to the head's.
body M=1 M=16 M=64 1 idx head, M=16
main 1.688 1.789 1.861 1.840
30e2b20 1.709 2.009 2.143 2.074
main's pieces 1.733 1.859 1.930 1.906
main's pieces + b64 store only 1.976 2.271 2.387 2.313
PR's pieces 1.668 2.021 2.128 2.029
PR's pieces, 4 × 16-bit stores 1.414 1.523 1.587 1.563
PR's pieces, 2 × 32-bit stores 1.325 1.365 1.421 1.401

Each other piece, flipped alone in either direction, moved the time by ≤ 0.17 µs, and this PR's version was mostly the faster one. The pieces were the load order with sched_barrier, warpUniform, the DPP / permlanex16 reduction, and the RoPE partner. Hardware vs software bf16 rounding made no difference, and neither did a non-temporal hint on the b64 store; only the store width mattered.

  • Mechanism (inferred, not measured directly). With cold, rotated inputs the store width makes no difference (head 2.40 / 2.71 / 2.83 µs vs fix 2.39 / 2.73 / 2.82 at M = 1 / 16 / 64). The cost appears only when the rows are read again soon: in graph replays, whose 57 × 73 KB of qkv fit in L2, and in warm run_perftest. This fits gfx1250 handling a full-line wave store differently from partial-line stores in L2.
  • Fix. storeElems / storeIndexQElems take a kSplitStore template flag. On __gfx1250__ it writes the row as two 32-bit stores. The flag is set only for the kRows == 1 stores of the non-insert branch: Q/K rows and the index-Q row, in place or into q_out / index_q_out. Plain C++ stores get merged back into one b64, even with a sched_barrier between them, so an empty asm volatile that takes the address keeps them apart. A comment in the code explains this. We did not split the store in the multi-row kernel too: one round of that worsened its graph time at M = 2048 (4.52 → 4.96 µs).
  • A/B. MI455X, 57-call HIP graph, µs per call, 5 interleaved rounds, median. M3 TP4 per-rank shapes (16 q, 1 kv, rotary 64, bf16). Outputs bitwise equal across main, 30e2b20 and the fix.
mode M main 30e2b20 930db88 vs main
in place, 0 idx heads 1 1.679 1.699 1.352 −0.327
in place, 0 idx heads 16 1.794 2.011 1.407 −0.387
in place, 0 idx heads 64 1.866 2.130 1.464 −0.402
in place, 0 idx heads 2048 7.892 4.516 4.517 −3.375
in place, 1 idx head 16 1.839 2.021 1.426 −0.413
insert, bf16 cache 16 2.466 1.910 1.915 −0.551
  • Coverage. The table has 1 index head at M = 16 only, and bf16 only. We planned the 1-index-head M = 1 / 64 / 2048 rows and fp16 rows, but the GPU host became unavailable before they ran. The table above is 5 rounds on device code identical to this commit (checked by ISA). 3 more rounds on the pushed commit itself agree within 0.01 µs in place (insert 1.952 vs 1.949 at 30e2b20).
  • ISA scope. On gfx1250 only the 216 non-insert kRows = 1 instances change: two global_store_b32 instead of one global_store_b64, same VGPRs (18/20), no scratch. The insert, multi-row and fused-partials instances are byte-identical. gfx942 / gfx950 are identical to 30e2b20, because the split is under #if defined(__gfx1250__).
  • Tests. The full op_tests/test_fused_qknorm_idxrqknorm.py passes on MI455X after a clean JIT rebuild.

2. Self-Review / Testing (description only)

  • "Changed op tests" now lists op_tests/test_fused_qknorm_nvfp4.py. It is a refusal harness: the 10 NVFP4 refusals and one accepted call, now run in process.
  • Mutation replay: corrected. The replay covered arg_reject only. Deleting the q_out clause was already caught on gfx950 by check_mxfp4_reject's (q8, "gfx1100", …) row (test:2390), so before 30e2b20 three of the four clauses had no failing row.
  • NVFP4: the kernels were not run by us. The 10 refusals were run on MI455X with the arch faked to gfx950.
  • The Benefit / Not covered sections now have the in-place HIP-graph table above, in place of the "gap is open" text.

3. Squash text

The last commit message now carries the corrected squash text, using your wording: "gfx942 / gfx950 build the same 680 one-row instances as main, from the reworked shared body (VGPR median 26 -> 28, occupancy unchanged); the multi-row and fused-partials kernels are gfx1250-only (static_assert elsewhere)". It also now mentions the two 32-bit stores in the one-row non-insert kernel.

@lirui927
lirui927 requested a review from valarLip November 23, 2026 07:51
lirui927 pushed a commit to lirui927/ATOM that referenced this pull request Nov 23, 2026
…heir consumers

With ROCm/aiter#7449, aiter.gemm_a8w8_bpreshuffle_splitk_deferred leaves the
fp32 partials unreduced when the tuned gfx1250 PTPC GEMM splits K and M is at
most max_m; the consumer claims them (aiter.splitk_partials) and reduces them
as it reads the output.

- LinearBase.splitk_consumer_max_m (0 = off) routes the per-token FP8
  bpreshuffle GEMM through it. Not while a token graph records: its replay
  would run the consumer, an eager region, without the partials.
- MiniMax-M3 sets it on gfx1250 to ATOM_SPLITK_CONSUMER_REDUCE_MAX_M
  (default 64, 0 = off) for the QKV projections whose attention impl claims
  the partials in rope_cache (not under Ulysses SP, whose head exchange reads
  qkv first) and for the dense MLP's gate/up.
- PagedAttentionImpl.rope_cache hands them to triton_fused_norm_rope_cache;
  SparseMHAPagedAttentionImpl.rope_cache to aiter.fused_qknorm_idxrqknorm
  (qkv_partials, ROCm/aiter#8011) when that op takes them: the index branch
  runs, no fp4 cache, and an aiter with the argument. Every other path
  finishes qkv with the standalone reduce first. A dummy run releases them.
- swiglu_oai_split_reducing, an opaque op, claims a gate/up's partials at run
  time and reduces them in the activation kernel.

An aiter without #7449 never defers; one with #7449 but without #8011 defers
and reduces in the sparse layers with the standalone kernel, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lirui927
lirui927 marked this pull request as draft November 27, 2026 08:19
lirui927 and others added 4 commits November 30, 2026 08:49
main brings ROCm#8472 (NVFP4 prefill kernel, raw NVFP4 entry, gfx950 lane exchanges and
converts in the generic kernel) and ROCm#8607 (deferred QKV front in the wrapper).

Conflicts, resolved mechanically:
- csrc/include/rocm_ops.hpp: both sides (qkv_partials / check_only arguments of
  fused_qknorm_idxrqknorm, main's fused_qknorm_nvfp4_raw binding).
- csrc/kernels/fused_qknorm_idxrqknorm.cu
  - includes: the union.
  - norm / rope helpers: both sets, each written out in full. main's xorLane, warpSum32,
    NormRopeOperands, loadNormWeights, loadRopeOperands and normAndRope (the prefill
    kernel uses all but the two loaders) next to this branch's shflXor, warpReduceSum /
    warpReduceMax,
    NormRopeInputs, loadCosSin, rotateElems, ropeElems and normAndRope. The two
    normAndRope differ in the operand type.
  - fusedQKNormIdxrQKNormKernel: this branch's body, plus one line: the NVFP4 V store
    passes the lane's loaded row, which main's storeNvfp4VToken now takes.
  - the prefill kernel, its launcher, fused_qknorm_nvfp4_raw and the NVFP4 store
    helpers are main's, untouched.
The host entry, the launcher, the header, the wrapper and the tests merged without
conflict.

At this commit the generic kernel does not yet use main's helpers: off gfx12 its lane
exchanges are ds_bpermute again, and its packed loads still assume 8 B aligned norm
weights and cos/sin, which main's prefill launcher hands to it unaligned. The wrapper's
two new fronts (deferred QKV front, raw NVFP4 front) return before check_only and
qkv_partials are looked at. The following commits fix these.

Device assembly (CPU compile, JIT flags): on gfx1250 1152 of the 1160 generic instances
and reduceQkvPartialsKernel are identical to 0af322d's; the 8 NVFP4 instances take
main's store helpers. The prefill kernel is identical to main's on gfx1250, gfx950 and
gfx942.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ly calls, the raw front out of qkv_partials calls

main's wrapper now has two fronts that launch and return before the generic entry: a
QKV projection parked by gemm_a8w8_qkv_front, and the raw NVFP4 entry. Merged as they
were, fused_qknorm_idxrqknorm_supports() (check_only) launched the kernel and consumed a
parked projection, and a raw-front call with qkv_partials ran on the unreduced qkv.

- A check_only call does not take the parked front (it stays parked) and does not take
  the raw front. The raw front is not taken with qkv_partials either: the generic entry
  reduces them. The two tests sit after block_size == 128 in the raw front's chain, so
  no other call pays for them.
- The supports() docstring and the wrapper comment say that the answer and the C++
  checks are the generic entry's; a front checks its own operands when it runs.
- tests/test_fused_qknorm_fronts.py (no GPU, entries mocked; added to the CI test
  list in split_tests.sh): which entry takes a plain call, a check_only call, a call
  with qkv_partials, and both with a parked front. Each of the three gate clauses,
  deleted, fails a row.
- op_tests/test_fused_qknorm_nvfp4.py (gfx950): on the shape that takes the raw front,
  supports() answers True and leaves sentinel-filled outputs untouched, and a call with
  qkv_partials on a NaN qkv gives the bytes of the call on the reduced qkv, qkv
  included. Two comments of main's that this branch makes wrong are corrected: the
  refusals run in this process, and the arch query no longer breaks a
  torch.compile(fullgraph=True) trace of the wrapper (checked on CPU with the C++ op
  mocked; no test in the tree asserts it).

Not handled: a parked front together with qkv_partials. One GEMM cannot produce both
(the parked projection is gfx950's FlyDSL front, the partials come from a split-K GEMM
that has run), and the parked front would ignore the partials.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ed stores on main's helpers

After the merge the file had two sets of lane-exchange helpers. One is left:

- main's xorLane<M> gets a gfx12 branch (DPP row_xmask for 1/2/4/8, v_permlanex16 for
  16), which is the body of this branch's shflXor; shflXor is gone. warpSum32 takes its
  first step through xorLane<16> off gfx950, warpReduceMax is written on xorLane, and
  this branch's normAndRope / ropeElems call warpSum32 / xorLane. warpReduceSum has no
  caller left and is back to main's text.
- roundPackElems' gfx1250 branch calls main's pfPackBf16 (the same v_cvt_pk_bf16_f32
  conversion) instead of its own copy.
- The packed row and cache stores go through memcpy (storePacked): one 64-bit or 32-bit
  store that claims no alignment for a row or cache that starts at an odd element.

Device assembly against the merge commit (CPU compile, JIT flags):
- gfx942: all 680 generic instances identical.
- gfx1250: 1152 of 1160 generic instances identical. The 8 NVFP4 instances, which the
  Python op refuses off gfx950, change because main's nvQuantLane calls xorLane.
- gfx950: every generic instance changes as intended: the norm sum is main's
  v_permlane16_swap + DPP sum again (as on main), and the fp8 per-token scale's
  warpReduceMax takes DPP for xor 8/4/2/1 where main has five ds_bpermute. The latter
  is new on gfx950 and has not run there.
- The prefill kernel is identical to main's on the three archs.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…re main's

The second copy of the norm / rope helpers goes: NormRopeInputs, loadCosSin,
rotateElems, ropeElems and this branch's normAndRope are deleted, and the kernel
carries main's NormRopeOperands per row and calls main's loadNormWeights,
loadRopeOperands and normAndRope from its own prologue (row, weight, position,
barrier, cos/sin, slot: unchanged). unpackRawElems is main's pfUnpack.

Three changes to main's helpers, none of which the prefill kernel sees (its device
assembly is identical to main's on gfx1250, gfx950 and gfx942):
- loadNormWeights / loadRopeOperands read the lane's 8 bytes with one memcpy each
  instead of four element loads. Only the generic kernel calls them. No alignment is
  claimed, which matters because main's prefill launcher sends norm weights and cos/sin
  caches that are not 8 B aligned to this kernel; this branch's explicit uint2 loads did
  claim it. The row load is a memcpy too.
- normAndRope tests rotary_dim == 64 once per lane instead of once per element (the
  arithmetic and its order are unchanged).

The RoPE partner by DPP is now main's rule: rotary_dim 64 only. This branch's gfx12
cases for rotary_dim 8, 16, 32 and 128 are gone; those take __shfl, as on main. The op
test gets a 4-rows-per-warp case with rotary_dim 128 for that path (gfx1250).

Device assembly against the previous commit (CPU compile, JIT flags), gfx1250, mean per
instance: one-row kernels 871 -> 747 instructions (one rope case instead of five), the
same 4 global loads, VGPRs 20 -> 20 median (max 26 -> 28), no scratch, occupancy
unchanged; 4-row kernels 1331 -> 1505 instructions, the same 16 global loads, all of
them now issued before the first row is processed, VGPRs 50 -> 52 median. Not run on a
GPU: this commit changes the measured gfx1250 code and has to be timed against its
parent.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lirui927

Copy link
Copy Markdown
Contributor Author

Re-ported onto current main. Main now has #8472 and #8607 on this op, and the branch conflicted with them. The history you reviewed is untouched: 0af322d31 stays, and there are four commits on top.

  1. 551ea4ee merge of main (4122ef5). Mechanical. The generic kernel body is this branch's plus one line (the NVFP4 V store passes the loaded row, which [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472's storeNvfp4VToken now takes). The prefill kernel, its launcher, the raw NVFP4 entry and the NVFP4 helpers are main's. Both sets of norm / rope and lane-exchange helpers are kept here; the next commits remove ours. git show --remerge-diff 551ea4ee shows the resolution.
  2. 151db133 wrapper. Main's two new fronts (the parked QKV front of [FlyDSL] [Perf] MiniMax-M3.1 TP4 decode QKV front as one op: one-launch (1-64 rows) + split-K (65-128 rows) GEMM / norm / RoPE / NVFP4 insert #8607, the raw NVFP4 front of [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472) launched before check_only and qkv_partials were looked at, so supports() would have launched and consumed a parked projection, and a raw-front call would have ignored the partials. Both are gated, with a GPU-free pytest (tests/test_fused_qknorm_fronts.py, one row per gate clause) and two gfx950 rows in test_fused_qknorm_nvfp4.py.
  3. de8bd18f lane exchanges, bf16 rounding, packed stores on main's helpers. shflXor becomes a gfx12 branch of main's xorLane; roundPackElems calls main's pfPackBf16.
  4. 56ee759c norm / rope operands and normAndRope are main's. Our copy is deleted. Two small changes in main's helpers: the two loaders use one unaligned 8-byte load each, and normAndRope tests rotary_dim == 64 once per lane.

What I could check without a GPU (device assembly compiled on CPU with the JIT flags):

gfx1250 gfx950 gfx942
merge vs 0af322d31 1152 / 1160 generic instances identical (the other 8 are NVFP4) - -
commit 3 vs merge 1152 / 1160 identical changes: main's DPP norm sum again 680 / 680 identical
commit 4 vs commit 3 all generic instances change all change all change
prefill kernel vs main, every commit identical identical identical

What is and is not verified:

  • MI455X is re-run at the head. The op test exits 0, the fronts pytest gives 5 passed, and the in-place outputs are bitwise equal to main's. Against current main the head is 1.26x to 1.79x faster in kernel time and 1.39x to 1.91x in a HIP graph; commit 4 is 0.99x to 1.05x of commit 3. The new tables are at the top of the Benefit section; the older ones below them are against the main of 11-16 and are kept as history.
  • gfx942 / gfx950 run our body with [HIP] [Perf] fused_qknorm_idxrqknorm: early loads, hardware converts, DPP exchanges, xor-atomic V nibbles and a prefill variant #8472's helpers, which neither PR has run. On gfx950 the technique counts per instance are not worse than main's (ds_bpermute 5.1 -> 4.2, DPP 9.0 -> 10.1, the NVFP4 instances keep the 2 xor atomics), VGPR median 26 -> 28, no scratch, occupancy unchanged. The CI comparison you asked for has to be redone against current main, including the NVFP4 write-modes table.

Two things behave differently from what you reviewed:

  • The DPP RoPE partner on gfx12 is now main's rule, rotary_dim 64 only. Our cases for 8 / 16 / 32 / 128 are gone; those take __shfl, as on main.
  • supports() answers for the generic entry. A call that one of main's fronts would serve is judged by that front when it runs.

One design point for you: the alternative to one shared body is main's body verbatim off gfx1250 and ours on gfx1250, which makes gfx942 / gfx950 byte-identical to main at the cost of about 450 duplicated lines. I kept the shared body, as reviewed. Say if you prefer the split.

The op no longer takes the split-K partials of qkv: a caller reduces them and passes
qkv, as on main.

- The qkv_partials argument is gone from the Python op, the C++ entry and the pybind
  signature, with its host checks, the fused-partials kernel instances (kPartials), the
  reduce kernel and the exact-sum helpers that existed for them.
- The kernel instances that remain compile to the same device code as before (gfx1250
  and gfx950, compared per instance); only the trailing kernel argument is gone.
- The wrapper keeps the check_only gates of the two fronts; the raw front's
  qkv_partials gate goes with the argument.
- Tests: the qkv_partials modes, their summary table and helpers are removed
  (check_rejects runs the edited call itself); the fronts test and the nvfp4 raw-front
  test keep their check_only rows.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lirui927 lirui927 changed the title [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250 Dec 2, 2026
This reverts commit be2f8e2: the split-K
partials input stays in this PR. The tree is that of 56ee759.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lirui927 lirui927 changed the title [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250 [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input Dec 2, 2026
lirui927 and others added 3 commits December 2, 2026 07:07
…here the code object has them

The multi-row kernels and the fused split-K partials load are built by the gfx1250 device
pass only, but the host took both when get_gpu_arch() said gfx1250, and that helper reports
a gfx1250-strict device as gfx1250 under AITER_GFX1250_A0_ALLOW_ASM=1. The strict code
object has neither kernel, so such a launch would fail there.

One rule now serves both passes (kHasGfx1250Kernels for what is built,
deviceHasGfx1250Kernels() for what is launched; the host asks the device for its own arch
name). gfx1250-strict runs one row per warp and reduces split-K partials first, like
gfx942 / gfx950. Host only: no device code changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…t scalar branch

Every quantized cache is fp8 next to a 16-bit model dtype, so the packed 32-bit store is the
only quantizing branch any kernel instantiates; the per-element fallback is deleted and the
condition is a static_assert. Device assembly unchanged on gfx1250, gfx950 and gfx942.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ready covers

op_tests/test_fused_qknorm_idxrqknorm.py (2903 -> 2888 lines):
- arg_reject: the fp8 gate keeps the combined fp8-cache refusal, the fp8 index_q_out
  refusal and the two calls that write no fp8 and must be taken; the three rows that
  existed to fail when one clause is deleted are dropped, as are positions_2d and
  cache_4d (positions_int32 and cache_dtype reach the same checks' tensors).
- qkv_partials_reject: short_rows and unaligned stay (they guard the kernel's loads);
  3_splits and fp16_partials are dropped.
- qkv_partials at 64 tokens is dropped (1, 17 and 33 tokens stay). The fused and the
  reduce-first paths are still compared bit for bit with the op on the reduced qkv.

tests/test_fused_qknorm_fronts.py (100 -> 84 lines): the two mock tests of the raw NVFP4
front under check_only and with qkv_partials are dropped; op_tests/test_fused_qknorm_nvfp4.py
checks both on the device (outputs untouched; the bytes of the reduced qkv). The parked
front has no device test, so its two tests stay.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lirui927

lirui927 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

review-pr scan (ROCm/aiter main, .claude/skills/review-pr at ea578b4), run locally on the posted head cd5d83a with REVIEW_AUTO_VALIDATE=0; no GPU.

Card

ROCm/aiter PR #8011 — [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input

Speeds up the fused qk-norm / rope / cache-insert kernel on gfx1250 (cheaper lane exchanges and stores, and four rows per warp for large launches), lets it take the unreduced split-K partials of qkv and sum them in its own pass, moves the argument checks into the C++ entry so a refusal raises instead of aborting, and adds a fused_qknorm_idxrqknorm_supports query.

Review (advisory): ⚠️ NEEDS WORK
Validation (deterministic): NOT RUN — REVIEW_AUTO_VALIDATE=0 and two candidate targets (op_tests/test_fused_qknorm_idxrqknorm.py, op_tests/test_fused_qknorm_nvfp4.py); an environment gap, not a PR defect
Perf (advisory): NOT RUN — no GPU used for this review; the body reports MI455X kernel time against main at 56ee759, whose tree is the head's (1.26x–1.79x, 3 interleaved rounds)
Size: 1978 lines / 10 files — over the review bar
Design (advisory): SPLIT — four seams: (1) host-side refusals in the C++ entry, check_only and fused_qknorm_idxrqknorm_supports with the quiet AiterThrowGuard; (2) the one-row kernel body shared by all archs (gfx12 lane exchanges, packed stores, bf16 rounding, slot split); (3) the gfx1250-only 4-rows-per-warp kernels and their launch gate; (4) the qkv_partials input (fused split-K sum on gfx1250, reduce-first kernel elsewhere)
Human: recommend valarLip review whether fused_qknorm_idxrqknorm should take the split-K partials of qkv as an input and fuse their sum on gfx1250 only, and whether capability queries should run the op with check_only

⚠️ [inferred] csrc/kernels/fused_qknorm_idxrqknorm.cu:40 takes the 4-rows-per-warp launch (line 2267) and the fused-partials launch (line 2994) when get_gpu_arch() == "gfx1250", but get_gpu_arch() reports a gfx1250-strict device as gfx1250 under AITER_GFX1250_A0_ALLOW_ASM=1, and the strict device pass (__gfx1250_strict__, not __gfx1250__) builds neither a kRows=4 nor a kPartials kernel (line 2259). On such a device a call with at least 128 rows per CU, or an insert call with qkv_partials, would launch a kernel its code object does not contain; is that a failed launch there? Author must make the host condition and the device #if follow one rule, so that both kernels are launched only where they were built and strict reduces the partials first.
⚠️ [inferred] csrc/kernels/fused_qknorm_idxrqknorm.cu changes the body every gfx942 / gfx950 instance runs, and there is no base-vs-head timing on those archs: the only timing is from CI logs at an older head, before the body was re-ported onto main's new helpers (cross-host 3–18% slower at M = 16384 on MI35X, same-host-class 0.93–0.985x of main, neither interleaved). Author must get green MI300X and MI35X runs of the op test at the head and post the fused_kernel_us comparison with main from those logs (or an interleaved timing on MI355X) before merge.
📝 [verified] The kernel-time tables come from a script outside the tree; the in-tree --minimax_benchmark of op_tests/test_fused_qknorm_idxrqknorm.py mostly measures launch overhead, by the body's own account. Reviewer should ask for the timing command to be reproducible from the tree, or for the script to be attached.

Scan log

  files=10  types=17  rules=31/68
    [modified-kernel     ] A1 A4 B2 D1 D8 P6
    [new-routing-value   ] A4 B4 C4
    [dispatch-change     ] A4 B1 B3 B4 A3
    [tier1-import-chain  ] STEP4 E5 C5
    [api-signature       ] B6 E1 E5
    [fp8-quant           ] C1 C2 D1
    [perf                ] P1 P2 P3 P5 P6
    [invariant-removed   ] D4 B7
    [layout-contiguity   ] D8 B7
    [alignment           ] B7 B2 D8
    [temp-script         ] HK1
    [incomplete-code     ] HK7
    [test-reference-dtype] HK10
    [conditional-binding ] D1b
    [defaulted-param     ] E2
    [tp-shapes           ] P4
    [scattered-diff      ] HK2
APPLIES: the diff still applies to 4abcfc1b05f97325d55694801e3d286862a9742a
1978 lines / 10 files
UNRUN-TEST: tests/test_fused_qknorm_fronts.py
  no CI job scans this directory -- op_tests is shard-scanned at maxdepth 1 and op_tests/triton_tests recursively, nothing else
IMPORTS RESOLVED: every first-party import the diff adds exists in the merge target or in this diff
SIBLINGS: no variant of a changed function still carries a changed line
KERNEL TESTS: no new kernel file without a collectible test
GUARDS DELETED -- 0 returned unchanged, 14 returned in changed form, 3 gone.
ANSWERS COMPLETE: 6/6
DIAGNOSTIC COMPLETE: 6/6
CORE FILES ASSESSED: 2/2 backbone files (1 tier-1), 0 gap(s)
LEDGER COMPLETE: 31/31 rules adjudicated with evidence
CARD NAILED DOWN: 3 findings, each traced to an adjudication and anchored in a changed file; every FIRE accounted for
REFUTATIONS COMPLETE: 7 attempted, 3 survived, 4 killed before reaching the card
INDEPENDENTLY REFUTED: 3 judged, 3 defended, 0 killed by a reader who had not seen the reasoning
DESIGN ROUTED: size 1978 lines / 10 files -- over the review bar

Note on UNRUN-TEST: tests/test_fused_qknorm_fronts.py: the PR adds the file to the explicit list in .github/scripts/split_tests.sh, which aiter_test.sh runs through pytest, so CI does run it.

The fired rules on the new head (<SHA after push>)

Finding on the card On the new head
Multi-row and fused-partials launches wider than the built kernels (gfx1250-strict under the A0 asm opt-in) Fixed by reading: the host asks the device for its own arch name and both passes follow one stated rule (kHasGfx1250Kernels / deviceHasGfx1250Kernels()); strict reduces partials first. Device code identical on gfx1250 (1160 + 4), gfx950 and gfx942 (680 + 4). Not compiled for strict, not run on A0.
gfx942 / gfx950 run a changed body with no timing or run at the head Open: needs CI at the new head (MI300X with ci:mi300x, MI35X) and the fused_kernel_us comparison.
Timing script outside the tree Open: text only.

One rule changes verdict on the new head: the scan's "shared chip_info helpers are the ISA gate" rule would fire on the added gcnArchName read in the kernel file. It is deliberate: the shared C++ helper get_gpu_arch() is the one that folds gfx1250-strict into gfx1250.

…) in the QKV chain test

The mock-only tests/test_fused_qknorm_fronts.py and its line in
split_tests.sh go: test_flydsl_qkv_chain.py already parks a real QKV front
and has fused_qknorm_idxrqknorm take it, so the capability query is asked
there, before the real call, and must leave the front parked. The raw front
under check_only is checked on a device in test_fused_qknorm_nvfp4.py.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lirui927
lirui927 marked this pull request as ready for review December 2, 2026 12:05
@github-actions github-actions Bot changed the title [HIP] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input [HIP] [FlyDSL] [Perf] fused_qknorm_idxrqknorm: faster on gfx1250, split-K partials as input Dec 2, 2026
@github-actions github-actions Bot added the FlyDSL label Dec 2, 2026
@lirui927

lirui927 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Status of the open review items at 8b7ea113 (valarLip's reviews of 11-17 to 11-20). Line numbers are at that head: .cu = csrc/kernels/fused_qknorm_idxrqknorm.cu, .py = aiter/ops/fused_qknorm_idxrqknorm.py, test = op_tests/test_fused_qknorm_idxrqknorm.py. The branch contains main up to 4122ef51 and sits on #8472's helpers.

  1. gfx1250 non-insert slowdown at small M (11-20 12:43, item 1): fixed on gfx1250. The one-row non-insert kernel writes a lane's row with two 32-bit stores (.cu:273-285). HIP graph on MI455X against main, in place with no index head: 1.39x / 1.43x / 1.44x at M = 1 / 16 / 64, and 1.45x with one index head at M = 16 (measured at 56ee759c, whose device code is the head's; table in the description). Not done for gfx1250-strict: the switch is under __gfx1250__, so a strict build keeps the one 64-bit store; that build was not compiled or timed.
  2. Description text (11-20 12:43, items 2 and 3): fixed. op_tests/test_fused_qknorm_nvfp4.py is under "Changed op tests"; the NVFP4 text says the kernels were not run and the refusals ran with the arch faked; the gfx942 / gfx950 text says they build the same 680 one-row instances as main from the reworked shared body (VGPR median 26 → 28, occupancy unchanged).
  3. gfx1250-only kernels (11-18 item 1, 11-19 item 4): fixed, and one more case closed since the last review. On a gfx1250-strict device with AITER_GFX1250_A0_ALLOW_ASM=1, get_gpu_arch() reports gfx1250, so the host took the 4-rows-per-warp launch and fused the partials although the strict device pass builds neither kernel. The host now asks the device for its own arch name, and the device #if and the host condition are one rule (kHasGfx1250Kernels / deviceHasGfx1250Kernels(), .cu:40-61, :1047, :2265-2268, :2995). On strict a call runs one row per warp and reduces qkv_partials first, as on gfx942 / gfx950. Device code is unchanged by this: every kernel on gfx1250, gfx950 and gfx942 is identical to cd5d83ad in body and descriptor.
  4. kRows=4 and fused-partials tests (11-17 item 5, 11-19 item 6): present (test:2647-2668, make_partials at test:2423). The multi-row cases take their token count from the launcher's threshold (128 rows per CU), so on gfx1250 they run above it with a row count that is not a multiple of 4. They compare values only: reduce-first and fused give the same bits, so the test does not notice if the launcher stops taking the multi-row or the fused path.
  5. fp8-gate rows in arg_reject (11-20 06:02 item 2, "one gfx1100 row per clause"): not kept. The test was trimmed in this rework to cases that call the op and compare with the reference. For a faked gfx1100 the gate now has two refused rows (the fp8 caches, an fp8 index_q_out with the index branch on) and two taken rows (the index-less calls), and the same four on a faked gfx1250-strict (test:2578-2593). The rows that existed only to fail when a single clause is deleted are gone, so deleting one of those clauses no longer fails a row of its own. The description's "one row per clause" wording predates this.
  6. Parked-front check: the mock-only tests/test_fused_qknorm_fronts.py is removed. op_tests/test_flydsl_qkv_chain.py now asks fused_qknorm_idxrqknorm_supports before the real call and asserts the parked QKV front stays parked.
  7. Other items of the 11-17 and 11-19 reviews (fp32 qkv refused before the check_only return, supports() catching only ValueError at .py:553-555, quiet check_only at .cu:3390, no asserts in the fp8 branch, partials test able to fail on normalized outputs, device check of every tensor at .cu:2941-2958, no arch query on the default path): unchanged since the earlier replies, still fixed at this head.

What ran at this head, on one idle MI455X (gfx1250), rocm/fw-bringup:gfx1250-minimax-m3-20261112:

  • python3 op_tests/test_fused_qknorm_idxrqknorm.py: exit 0, every summary row passed; arg_reject, q_fp8_out and the qkv_partials* rows err 0, the eight 1639-token multi-row cases included.
  • python3 op_tests/test_fused_qknorm_idxrqknorm.py --minimax_tp4: exit 1 in pa_sparse_block_score_decode ("requires gfx950 architecture"), a case and an op this PR does not change.
  • python3 op_tests/test_fused_qknorm_nvfp4.py: skips ("tested on gfx950 only"). python3 -m pytest -q -rs op_tests/test_flydsl_qkv_chain.py: 1 passed, 256 skipped ("gfx950 only").

CI at this head (the first runs of the shared body on #8472's helpers off gfx1250; all 8 MI300X and 8 MI35X Standard Tests shards are green):

  • MI35X: op_tests/test_fused_qknorm_idxrqknorm.py passed (shard 4), op_tests/test_fused_qknorm_nvfp4.py passed (shard 2), op_tests/test_flydsl_qkv_chain.py 193 passed, 64 skipped (shard 6). The last one is the only hardware run of the assertion in item 6; it skips on gfx1250.
  • MI300X: op_tests/test_fused_qknorm_idxrqknorm.py passed (shard 4).

Still open:

@lirui927
lirui927 requested a review from valarLip December 3, 2026 07:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:mi300x Run MI300X standard and OPUS CI on PRs FlyDSL HIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants