Skip to content

[ASM] Fix LDS races in gfx950 FP8 QH16 qseqlen1 persistent MLA decode - #7622

Merged
kaiyang-1 merged 1 commit into
mainfrom
akaratza_mla_qh16_ps_prefetch_barrier
Nov 10, 2026
Merged

kaiyang-1 merged 1 commit into
mainfrom
akaratza_mla_qh16_ps_prefetch_barrier

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes three LDS races in the gfx950 FP8 QH16 qseqlen1 persistent MLA decode kernels: hsa/gfx950/mla/mla_a8w8_qh16_qseqlen1_gqaratio16_ps.co and mla_a8w8_qh16_qseqlen1_gqaratio16_lse_ps.co. Both are binary patches with the same file size. The PR also adds a regression check to op_tests/test_mla_persistent.py.

Motivation

These kernels run persistent fp8 MLA decode with 16 heads and 1 query token, for example a 128-head model with TP 8. Under load, some heads of some rows get wrong output. The error is silent. With return_lse=True, a row can be wrong for almost all 16 heads at once.

check_fp8_gqa16_multi_tile_batch (added here): 128 rows, kv_len 257..383 (3 KV tiles), with a copy on a side stream. Wrong (row, query, head) outputs per run:

Kernel main this PR
qseqlen1_gqaratio16_ps 537 to 2625, 16 of 16 runs fail (2 GPUs) 40 of 40 runs pass (2 GPUs)
qseqlen1_gqaratio16_lse_ps 8 to 443, 16 of 16 runs fail 40 of 40 runs pass

We also see wrong rows on main with no other work on the GPU: 67 of 400 calls (_ps) and 29 of 400 calls (_lse_ps) of 128 rows each.

Root cause, from the disassembly. The kernels have the same LDS layout as the non-persistent kernel (#7617): two KV slots at 0x4000 and 0x16000, 0x4800 bytes per wave.

  • A: KV prefetch over a slot that other waves still read. At the end of a loop half, all waves read V from one slot with ds_read_b64_tr_b8. These reads include rows that other waves loaded. The next loop half starts the global_load_lds prefetch into that slot with no s_barrier. A fast wave overwrites rows that a slow wave did not read yet. This is the race that [ASM] [Bugfix] Fix LDS race in gfx950 FP8 QH16 qseqlen1 MLA decode #7617 fixes in the non-persistent kernel.
  • B: P write over the row-max scratch. The P write (ds_write_b64 v34, LDS 0..0x800) and the row-max reads (ds_read_b32 v37, LDS 0..0x400) are in the same barrier interval.
  • C: K registers used before their LDS reads complete. Waves 0 and 1 run one copy of the main loop, and waves 2 and 3 run a second copy. In the second copy, the K reads at the end of a half are in a different order (a[40:43], a[48:51], ..., a[72:75], a[44:47], ..., a[68:71]). The s_waitcnt lgkmcnt(4) at the top of the next half still lets the last 4 reads be in flight. The next two MFMAs read a[44:47] and a[52:55] without a wait. A static check of the wait counters along the loop paths finds this in the second copy only (.text 0x4918 and 0x5158 in _ps).

All three are necessary (_ps, 128 rows, 400 calls per run, heads with error > 0.1):

.co stream, 2 runs none (no other work), 2 runs
main 10522, 5997 833, 802
C only 2889, 4020 1404, 346
A + B 348, 438 380, 205
A + B + C (this PR) 0, 0 0, 0
A + B + C with the 10 new s_barrier changed to s_nop 4103, 13538 1336, 2021

_lse_ps gives the same picture (stream: main 655 and 708, this PR 0 and 0; A + B 11 and 8; s_nop control 5187 and 6707).

The _lse_ps whole-row failure: a one-hot probe (each head attends to one token, so o[h] == V[t_h], 1 row, 600 tokens, stream mode) gave 7 bad calls of 3000 on main and 0 of 3000 with this PR. In the bad calls, 13 of 16 heads on average are wrong, and 1853 of 1864 wrong 16-dim chunks are exact copies of KV rows that are not in the call. V is shared by all 16 heads, so when a slow wave reads V rows that a prefetch DMA already replaced, every head of that row is wrong. This is consistent with race A. The KV rows come from index entries that the call does not own (the probe takes its indices as a slice of a longer permutation). We did not prove which loop half overreads the indices.

Related work: #7617 fixes race A and the P-write race in the non-persistent kernel. #4638 (closed, no linked fix) reported nondeterministic Stage-1 output of qseqlen1_gqaratio16_ps for sparse decode.

Related: #7617 fixes the same class of race in the non-persistent qseqlen1 kernel. This PR and its two sibling PRs (#7621 for qseqlen2, #7623 for qseqlen4 v3) each add the same check_fp8_gqa16_multi_tile_batch helper to op_tests/test_mla_persistent.py; whichever merges second drops its copy. #7007 reports wrong results from the qseqlen2 and qseqlen4 kernels, and #4872 would route fp8 gqa16 qlen 2 to the qseqlen4 kernel. A separate bug is not fixed here: with more than one KV split per row, a few rows are still wrong on main and with these patches (stage 2 appears to merge split buffers that stage 1 did not write).

Changes

  • mla_a8w8_qh16_qseqlen1_gqaratio16_ps.co and mla_a8w8_qh16_qseqlen1_gqaratio16_lse_ps.co, binary patch. The SP3 source is not in the repo. The file size, the ELF layout and the branch targets do not change. There is no code motion.
    • A: before the first prefetch DMA of each of the 4 loop halves, s_waitcnt lgkmcnt(0); s_barrier; s_nop 0. The room comes from v_add_co_u32 v112, vcc, v112, v28 and v_addc_co_u32 v113, vcc, v113, 0, vcc. There v28 is 0 (s_mov_b32 s61, 0; v_mov_b32 v28, s61), so they do not change the address, and vcc is written again before it is read. (_ps: .text 0x38e0, 0x4128, 0x4990, 0x51d0. _lse_ps: 0x3804, 0x404c, 0x48b4, 0x50f4.)
    • B: s_barrier between the row-max reads and the P write, in the 4 loop halves and the 2 tail halves. The room comes from v_mov_b32 v28, v38; v_add_f32 v28, v39, v28, which becomes v_add_f32 v28, v39, v38 (same operands, same order). (_ps: 0x3df4, 0x463c, 0x4e8c, 0x56cc, 0x5c6c, 0x6098. _lse_ps: 0x3d18, 0x4560, 0x4db0, 0x55f0, 0x5b90, 0x5fbc.)
    • C: s_waitcnt lgkmcnt(4) becomes lgkmcnt(0) at the 2 loop-half tops of the loop copy of waves 2 and 3. (_ps: 0x4918, 0x5158. _lse_ps: 0x483c, 0x507c.)
  • op_tests/test_mla_persistent.py: add check_fp8_gqa16_multi_tile_batch(decode_qlen, persistent, return_lse). main() runs it on gfx950 for qlen 1, with and without LSE.

The kernel owners may prefer to rebuild the .co files from SP3 with the same barriers and wait. The new check covers that rebuild too.

Performance (if applicable)

mla_decode_fwd, fp8, 16 heads, run_perftest 200 iterations, kernel time in us (median over runs). Before is main, after is this PR. 6 interleaved rounds on each of 2 GPUs (12 pairs per shape). "Change" is the median of the per-pair ratios. Other jobs ran on the node at the same time, so single pairs vary a lot; the median is the useful number.

Hardware Workload/configuration Before After Change
MI350X qlen 1, persistent, bs 1, ctx 1024 16.05 16.04 -0.6%
MI350X qlen 1, persistent, bs 1, ctx 8192 23.87 23.64 -1.0%
MI350X qlen 1, persistent, bs 32, ctx 1024 19.76 19.46 -0.7%
MI350X qlen 1, persistent, bs 32, ctx 4096 30.80 30.85 +0.2%
MI350X qlen 1, persistent, bs 128, ctx 1024 30.87 31.12 +0.7%
MI350X qlen 1, persistent, bs 128, ctx 4096 69.56 69.95 +0.4%
MI350X qlen 1, persistent, bs 256, ctx 8192 238.69 238.41 -0.0%
MI350X qlen 1, persistent, LSE, bs 1, ctx 1024 16.08 15.91 -2.5%
MI350X qlen 1, persistent, LSE, bs 1, ctx 8192 23.79 22.99 +0.4%
MI350X qlen 1, persistent, LSE, bs 32, ctx 1024 19.67 19.51 -0.4%
MI350X qlen 1, persistent, LSE, bs 32, ctx 4096 30.91 30.87 +0.5%
MI350X qlen 1, persistent, LSE, bs 128, ctx 1024 31.13 31.18 +0.1%
MI350X qlen 1, persistent, LSE, bs 128, ctx 4096 70.01 70.08 +0.3%
MI350X qlen 1, persistent, LSE, bs 256, ctx 8192 238.34 238.61 +0.2%

All medians are within -2.5% and +0.7%, which is within run-to-run noise. Each loop half gets 2 more barriers (A and B), and 2 loop-half tops of waves 2 and 3 now wait for all LDS reads.

Testing

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

The .co files are gfx950 only, so MI250X and MI300X do not apply.

Documentation

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

The change fixes a kernel bug. The API and the behavior do not change.

Dependencies

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

Breaking Changes

None.

PR Self-Review

Reviewed revision

TODO: fill in from the PR Self-Review comment.

Behavior and intent

The qseqlen1 persistent kernels now synchronize all waves before a wave overwrites an LDS region that other waves can still read, and they wait for all K reads before the first MFMA of a loop half. Before, some heads of some rows were wrong and nondeterministic under load.

Validation and unverified scope

MI350X (gfx950), PyTorch 2.13.0+rocm10.0.0, aiter main 581579a.

Every patched run below counts the (row, query, head) outputs with relative error above 0.1 against an fp64 reference. Logs and scripts: /app/kanban/vteam-158/pr66322_deps/qh16_cold_cache/siblings/r3/.

  • 10 loops on each of 2 GPUs, in 3 modes (no other work, a 256 MiB read before each call, copies on a side stream), 200 calls of 128 rows per run: 0 wrong outputs in 12000 calls for each kernel. Some heads have an error between 0.05 and 0.1 (55 and 73 heads in 12000 calls). This is fp8 rounding.
  • Bitwise check: with 4 rows and no other work, main and this PR give the same bits for 28 of 28 calls, for both kernels.
  • One-hot probe on _lse_ps (1 row, 600 tokens, stream): main 7 of 3000 calls bad, this PR 0 of 3000.
  • DCP-like and long-context shapes, no other work: kv_len 300 to 8200 with 1 to 32 splits per row. _ps: main has wrong rows in every shape with more than 1 split (for example 624 heads in 200 calls at 64 rows, kv_len 1000, 4 splits). This PR: 0 in every shape.
  • python3 op_tests/test_mla_persistent.py -n 16,1 -d fp8 -kvd fp8 with and without -lse: the new check passes. The sweep has the same 13 of 64 rows above 0.05 decode:err as main (short contexts of 21 and 64 tokens, max 0.17 on both).

Not verified, and not changed by this PR:

  • mla_a8w8_qh16_qseqlen1_gqaratio16_msk0_ps.co and _msk0_lse_ps.co have the same code and the same three races. The kernel table maps a 1-token non-causal call to the causal kernel, and our non-causal test loaded _ps, so we could not run them. We did not change them.
  • With more than 1 KV split per row, _lse_ps on main and with this PR gives a few wrong rows (for example 186 heads in 200 calls at 64 rows, kv_len 1000, 4 splits, against 765 on main). A second call with the same inputs is correct. This looks like the merge of a split that stage 1 did not write (the bug class of [Bugfix] MLA decode: merge only the splits gfx950 fp8 gqa16 stage 1 writes #7613), not an LDS race. We did not fix it here.
  • gfx942 kernels: not tested.
  • No end-to-end model accuracy run.

PR-specific question

TODO: answer from the PR Self-Review comment.

Changed op tests

op_tests/test_mla_persistent.py: check_fp8_gqa16_multi_tile_batch runs 64 calls of 128 rows with 3 KV tiles each, next to a copy on a side stream, and compares every (row, query, head) output with an fp32 reference. The existing sweeps use small batches and no concurrent work, so they pass on main. This check fails on main in every run and passes with this PR. It takes about 1.5 s per kernel.

This PR and the qseqlen2 and qseqlen4 PRs add the same helper function. Each PR calls it only for its own kernels. The second PR to merge must drop the duplicate helper.

AI assistance (Claude Code) was used for the analysis and the patch. A human reviewed the change.

mla_a8w8_qh16_qseqlen1_gqaratio16_ps.co and _lse_ps.co have the races
of the non-persistent kernel (#7617) and one more:

- A: the next-tile KV prefetch (global_load_lds) of a loop half writes
  the LDS slot that other waves can still read. Before the first
  prefetch DMA of each of the 4 loop halves, add
  "s_waitcnt lgkmcnt(0); s_barrier; s_nop 0". The room comes from the
  add of v28 to the DMA address and its carry add. v28 is 0 there, so
  they do nothing, and vcc is written again before it is read.
- B: the P write (ds_write_b64 v34, LDS 0..0x800) can overwrite the
  row-max scratch (LDS 0..0x400) before all waves read it. Add
  s_barrier between the row-max reads and the P write, in the 4 loop
  halves and the 2 tail halves. The room comes from folding
  "v_mov v28, v38; v_add_f32 v28, v39, v28" into
  "v_add_f32 v28, v39, v38" (same operands, same order).
- C: waves 2 and 3 run a second copy of the main loop. There the K
  reads at the end of a half are in a different order, and
  "s_waitcnt lgkmcnt(4)" at the top of the next half leaves a[44:47]
  and a[52:55] in flight. The next two MFMAs read them. Use
  lgkmcnt(0) at these 2 loop-half tops.

The file size, the ELF layout and the branch targets do not change.
There is no code motion.

Add check_fp8_gqa16_multi_tile_batch to test_mla_persistent.py. It runs
128 rows of 3 KV tiles next to a copy on a side stream, with and
without LSE. On main it fails in every run. With these .co files it
passes.

Co-authored-by: Claude <[email protected]>
Signed-off-by: Andreas Karatzas <[email protected]>
@AndreasKaratzas AndreasKaratzas added bug Something isn't working ASM labels Nov 8, 2026
@AndreasKaratzas AndreasKaratzas self-assigned this Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
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 gfx1201 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 7622 --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.

@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 411f59798e89 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — PR-specific question is too short to show concrete reasoning (7 units; need 14)

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

@zufayu
zufayu requested a review from kaiyang-1 November 10, 2026 01:24
@kaiyang-1
kaiyang-1 merged commit 714e194 into main Nov 10, 2026
@kaiyang-1
kaiyang-1 deleted the akaratza_mla_qh16_ps_prefetch_barrier branch November 10, 2026 04:11
zhiding512 pushed a commit that referenced this pull request Nov 13, 2026
The 10 .co files changed on this branch were also rebuilt on main
(#7574 for the BF16 QH32 gqaratio96 kernels, #7622 for the FP8 QH16
qseqlen1 PS kernels). Take main's version of all of them; the LTD clamp
is re-applied on top of main in the next commit.
zhiding512 pushed a commit that referenced this pull request Nov 13, 2026
The last SUB_KV tile of a work item runs full width. Its out-of-range lanes
got page id 0 from the OOB buffer_load of kv_indices and read KV slot 0.
Their softmax weight is 0, but P*V still computes 0 * V, so a NaN in slot 0
(e.g. a reused or never-written block) turned whole output rows into NaN.

Rebuild from poc_kl_merg mmd/fix/mla_kv_page0_nan (d9381a8), which clamps
every page-table address, prefetches included, to the last valid entry of
the work item:

  mla_a16w16_qh32_qseqlen4_gqaratio96{,_lse}{,_msk0}{,_cprr}_ps
  mla_a16w16_qh32_qseqlen4_gqaratio32{,_lse}{,_msk0}{,_cprr}_ps
  mla_a16w16_qh64_qseqlen1_gqaratio64{,_cprr}_v3_ps, ..._lse_cprr_v3_ps
  mla_a8w8_qh32_qseqlen4_gqaratio32{,_lse}{,_cprr}_ps
  mla_a8w8_qh16_qseqlen4_gqaratio16{,_lse}{,_cprr}_v3_ps
  mla_a8w8_qh32_qseqlen4_gqaratio8{,_lse}_ps
  mla_a16w16_qh16_qseqlen4_gqaratio16{,_lse}_ps, mla_a8w8_qh16_qseqlen4_gqaratio16_ps

Each .co differs from main's only by the added clamp instructions (no
instruction removed or changed). With NaN written into an unreferenced
KV slot 0, main's .co files return NaN rows and these stay clean; clean
outputs match main bit for bit except for the FP8 QH16 qseqlen4 v3 kernels,
which are already nondeterministic run to run on main.

Not rebuilt: mla_a8w8_qh16_qseqlen1_gqaratio16{,_lse}_ps (the SP3 source
lacks the #7622 LDS fixes, which were patched into the .co directly) and
mla_a16w16_qh64_qseqlen1_gqaratio64_lse_v3_ps (its SP3 source has a
different LSE sanitize bound than the shipped .co).
zhiding512 pushed a commit that referenced this pull request Nov 13, 2026
Rebuild mla_a8w8_qh16_qseqlen1_gqaratio16{,_lse}_ps from poc_kl_merg
mmd/fix/mla_kv_page0_nan (d06974a), which now carries the #7622 LDS race
fixes in the SP3 source as well as the KV slot 0 page-table clamp.

Both .co files are main's (#7622) plus only the clamp instructions. With NaN
written into an unreferenced KV slot 0 main returns NaN rows and these stay
clean; clean outputs match main bit for bit, and #7622's multi-tile race test
passes (the pre-#7622 .co fails it on the same machine).
shengnxu pushed a commit that referenced this pull request Nov 15, 2026
… OOB read page0 data (#7872)

* fix the nan error

* mla: keep only the LTD-clamp .co files built from verified SP3 sources

Narrow 8081b4e to the kernels whose fixed SP3 source is committed in
poc_kl_merg mmd/fix/mla_kv_page0_nan and verified:
  MLA_A8W8_QH16_1TG_4W_16mx1_32nx4_PS.sp3 (e52636d)
    mla_a8w8_qh16_qseqlen1_gqaratio16{,_lse}_ps
  MLA_A16W16_QH32_1TG_4W_32mx4_32nx1_PS_gqaratio96.sp3 (fd1911a)
    mla_a16w16_qh32_qseqlen4_gqaratio96{,_lse}{,_msk0}{,_cprr}_ps

Each kept .co is instruction-identical to a rebuild from that source, and the
pre-fix .co is instruction-identical to a rebuild from the pre-fix source, so
the only change is the page-table clamp that stops OOB tail lanes from reading
KV slot 0. With NaN written into slot 0, the old .co files produce NaN output
and the kept ones stay bit-identical to clean runs.

Every other .co touched by 8081b4e goes back to its previous version, and
the files it added (including the unregistered qh32ctl A/B control) are removed.

* mla: clamp page-table reads in gfx950 MLA PS kernels (KV slot 0 NaN)

The last SUB_KV tile of a work item runs full width. Its out-of-range lanes
got page id 0 from the OOB buffer_load of kv_indices and read KV slot 0.
Their softmax weight is 0, but P*V still computes 0 * V, so a NaN in slot 0
(e.g. a reused or never-written block) turned whole output rows into NaN.

Rebuild from poc_kl_merg mmd/fix/mla_kv_page0_nan (d9381a8), which clamps
every page-table address, prefetches included, to the last valid entry of
the work item:

  mla_a16w16_qh32_qseqlen4_gqaratio96{,_lse}{,_msk0}{,_cprr}_ps
  mla_a16w16_qh32_qseqlen4_gqaratio32{,_lse}{,_msk0}{,_cprr}_ps
  mla_a16w16_qh64_qseqlen1_gqaratio64{,_cprr}_v3_ps, ..._lse_cprr_v3_ps
  mla_a8w8_qh32_qseqlen4_gqaratio32{,_lse}{,_cprr}_ps
  mla_a8w8_qh16_qseqlen4_gqaratio16{,_lse}{,_cprr}_v3_ps
  mla_a8w8_qh32_qseqlen4_gqaratio8{,_lse}_ps
  mla_a16w16_qh16_qseqlen4_gqaratio16{,_lse}_ps, mla_a8w8_qh16_qseqlen4_gqaratio16_ps

Each .co differs from main's only by the added clamp instructions (no
instruction removed or changed). With NaN written into an unreferenced
KV slot 0, main's .co files return NaN rows and these stay clean; clean
outputs match main bit for bit except for the FP8 QH16 qseqlen4 v3 kernels,
which are already nondeterministic run to run on main.

Not rebuilt: mla_a8w8_qh16_qseqlen1_gqaratio16{,_lse}_ps (the SP3 source
lacks the #7622 LDS fixes, which were patched into the .co directly) and
mla_a16w16_qh64_qseqlen1_gqaratio64_lse_v3_ps (its SP3 source has a
different LSE sanitize bound than the shipped .co).

* mla: clamp page-table reads in the FP8 QH16 qseqlen1 PS kernels too

Rebuild mla_a8w8_qh16_qseqlen1_gqaratio16{,_lse}_ps from poc_kl_merg
mmd/fix/mla_kv_page0_nan (d06974a), which now carries the #7622 LDS race
fixes in the SP3 source as well as the KV slot 0 page-table clamp.

Both .co files are main's (#7622) plus only the clamp instructions. With NaN
written into an unreferenced KV slot 0 main returns NaN rows and these stay
clean; clean outputs match main bit for bit, and #7622's multi-tile race test
passes (the pre-#7622 .co fails it on the same machine).

---------

Co-authored-by: guoliang <[email protected]>
AndreasKaratzas added a commit that referenced this pull request Nov 15, 2026
#7872 rebuilt four of the FP8 QH16 qseqlen4 v3_ps kernels (v3_ps,
lse_v3_ps, cprr_v3_ps, lse_cprr_v3_ps) with the KV page-table clamp.
Resolve each by taking main's binary and re-applying this branch's
rotation (the a[120:127] MFMA moved ahead of the six ds_read_b128 that
overwrite a[104:127], 4 windows of 76 bytes per file). main vs merged
differs only by those rotations; file size, ELF headers and branch
targets are unchanged. The msk0 variants were not touched by main and
keep this branch's versions.

op_tests/test_mla_persistent.py: run both the qlen 1 (#7622) and qlen 4
multi-tile batch checks.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andreas Karatzas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASM bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants