Skip to content

[FlyDSL] pa_decode: zero V rows past the context before PV - #7092

Merged
coderfeli merged 2 commits into
mainfrom
lingzha/pa-decode-mask-unowned-kv
Oct 30, 2026
Merged

coderfeli merged 2 commits into
mainfrom
lingzha/pa-decode-mask-unowned-kv

Conversation

@ZLkanyo009

@ZLkanyo009 ZLkanyo009 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Symptom

ATOM #2635 found that decode paged attention lets KV rows no sequence owns reach the output. Since ROCm/ATOM#2519, Qwen3.5 GDN prefix checkpoints are copied into MHA KV blocks as PAGE images, and at fp8 those image bytes are often NaN encodings. ROCm/ATOM#2635 works around it in ATOM: pools holding state images never hand out block 0, and released units are zeroed before reuse. As discussed there, this PR fixes it at the kernel level for FlyDSL pa_decode.

On aiter main, Qwen3.5-35B-A3B-FP8 with ATOM_PA_FLYDSL=1 (ATOM main, without ROCm/ATOM#2635) scores 0.06 on GSM8K. The same server with this PR scores 0.97 (numbers below).

Root cause

  • The FlyDSL work plan only emits ceil(context_len / 256) tiles per sequence, so only the last tile of a sequence holds tokens at or past context_len. In that tile, pages past the sequence are pinned to block 0, and the unwritten tail of the last page is read as is.
  • K is fine, because scores of invalid tokens are replaced with -inf.
  • V is not. P is exactly 0 for those tokens, but 0 * NaN = NaN in the PV MFMA, so a single NaN byte in such a row turns the whole output row into NaN.
  • Per-token FP8 V scales have the same hole through P * v_scale.
  • The pa_decode_kernel.py docstring stated this as a caller contract: "Masked V bytes must remain finite ... callers must leave the unwritten tail of the last owned page finite."

Fix

The change is Python/FlyDSL only, in kernels/pa_decode/{op_lds,pipeline}.py.

  • Boundary tile only. tile_valid < 256 is wave-uniform. On that tile, each lane builds 64-bit byte masks for its V operands once, from the context length (tail_masks). Each head chunk ANDs its V operands with them right before its own PV (mask_v_chunk).
  • Full tiles run unchanged. Fully out-of-range tiles were never loaded in the first place; that is unchanged.
  • Byte-granular masks. One condition covers bf16 and fp8, trans_v and plain V, page 16/64/128, pinned block-0 pages and unwritten tails.
  • Per-token scales. Per-token K/V scales at or past the context are staged as 0.
  • Clean input is bit-identical. Valid tokens see the same data and the same instruction order, so output on clean input matches main bit for bit. The probe compares all 468 zero-filled outputs against main: all identical.
  • Not covered:
    • The two gfx1250 pipelines. I have no gfx1250 to test on, so the docstring keeps the contract there and the new test skips on gfx1250.
    • BUFFER_KV (MTP4 fused with a KV cache larger than 2 GiB) goes through the same mask_v_chunk, but the probe does not build a cache that large.

Why the overhead is small, and what was tried

Kernel time, fixed vs main, on the matrix described below (513 shapes, 3 alternating rounds, median per shape). All of these produce correct output except the E1 diagnostic.

variant what shapes geomean worst shapes > +3%
A one branch on the boundary tile that masks the whole tile's V (all 4 head chunks) 513 -0.57% +7.9% 45
B masks computed in the branch, AND outside it 72 +0.30% +6.1% 26
E1 (diagnostic) B's structure with a never-taken branch: cost of branch + ANDs alone 24 +1.95% +3.3% 4
A3 masks once per boundary tile; each head chunk ANDs right before its PV 513 -0.32% +6.8% 29
A4 A3 with a cheaper per-dword mask (0xFFFFFFFF >> clamp(32(d+1) - valid_bits, 0, 32): v_add, v_med3, v_lshrrev_b64) 513 -0.39% +40.8% 24
this PR A4's masks, except A3's for bf16 with page >= 64 513 -0.58% +5.0% 16
  • A waits vmcnt(0) for the whole tile's V before its first PV, so PV no longer overlaps the V loads. Per-chunk masking keeps the load pipeline intact.
  • A4 regresses bf16 page 64/128 at large batch × long context by 40%.
    • Those kernels already use 444 VGPRs on main.
    • A4's live masks make the allocator spill 16 loop-invariant 64-bit values (private segment 40 B → 164 B).
    • The reloads sit on the same in-order vmcnt chain as the V loads.
    • A3's mask form does not spill there.
  • The remaining cost is on tiny bf16 page-16 calls (8–30 µs), where each CTA has a single tile and that tile is always the boundary tile.
    • Each lane has to clear 128 V dwords, and there are too few MFMAs to hide that.
    • The cost is 0.3–1 µs per call. E1 shows that the branch plus the ANDs alone account for most of it.
    • Going lower would need loads that return 0 by themselves (e.g. buffer loads with out-of-range offsets). That would change the V load path of every full tile, so I did not do it here.
  • What ATOM's Qwen3.5 actually routes to FlyDSL is per-token FP8 KV with page 16 (q35b-tp1 fp8tok bs16): +0.66% geomean / +2.9% worst at qlen 1, and +1.19% / +2.5% with MTP-3 (qlen 4). Per-token scales are zeroed with a few selects per lane on every tile, outside the boundary branch.

Tests

  • New op test op_tests/test_flydsl_pa_decode.py::test_pa_decode_unowned_kv_rows, 72 cases:

    • fp8 per-tensor (trans_v and plain V), fp8 per-token, bf16
    • page 16/64/128
    • (qlen, kv heads, GQA, head) = (1, 1, 8, 128), (4, 2, 8, 256), (4, 1, 16, 128)
    • NaN and Inf fills

    Lengths are {1, 17, 255, 257, 1000}, block 0 is unowned, and the block table has 2 padded columns. Every row no sequence owns is filled (and its per-token scale too, when there is one). The test asserts the output is finite and bit-identical to the zero-filled run.

    • On main, 54 of 72 fail. The 18 passes are fp8 per-tensor with the "inf" fill: e4m3 has no Inf, so that fill uses the finite ±448.
    • With this PR, all 72 pass.
  • Existing tests: test_flydsl_pa_decode.py passes 124/124 on main and 196/196 here (124 + 72). triton_tests/test_pa_decode_gluon.py passes 43/43 on both.

  • Wider probe: 468 FlyDSL shapes. On main all 468 fail; with this PR all 468 pass. It covers:

    • fp8 per-tensor (trans_v and plain V), fp8 per-token, bf16
    • page 16/64/128
    • head 64/128/256 with GQA 4/8/16
    • qlen 1–4, PS and partitioned plans, sliding window
    • block 0 both owned and unowned
    • NaN, Inf and random-byte fills

    It also hits D256_PIPE, MTP4_FUSED, MTP4_PREFETCH_V, PAGE16_VPIPE, prefetch_v and M_TILES 1–4.

Kernel performance

gfx950 (MI355X), one GPU, main and this PR alternating in the same window, 3 rounds, median per shape. Same-tree noise (main round 1 vs the other two) was -0.29% geomean, +5.1% max.

Shapes:

  • Models: Qwen3.5-35B-A3B TP1 (2 KV heads, GQA 8, head 256) and Qwen3.5-397B-A17B TP8 (1 KV head, GQA 4) / TP4 (GQA 8).
  • KV: fp8 per-tensor and bf16. 35B also runs fp8 per-token and MTP-3 (qlen 4).
  • Page: 16/64/128.
  • Batch × context: batch 1/4/16/64/256 × context 1k/4k/16k/64k, with batch × context ≤ 4M. Each sequence length is ctx - U[0, 255], so most sequences end mid-tile.
  • Plan and timing: ATOM's head-256 plan (64 partitions max, budget 256). Each call is replayed 20× in one CUDA graph, median of 7 replays.

Geomean -0.58%, worst +5.0%; 16 of 513 shapes above +3%. An earlier independent run of the same code gave -0.83% / +4.7% / 13.

model KV block qlen n geomean worst
q35b-tp1 bf16 bs128 q1 19 -4.73% +3.39%
q35b-tp1 bf16 bs16 q1 19 +1.19% +3.80%
q35b-tp1 bf16 bs64 q1 19 -5.42% +3.46%
q35b-tp1 fp8 bs128 q1 19 -0.14% +1.78%
q35b-tp1 fp8 bs128 q4 19 +0.02% +1.71%
q35b-tp1 fp8 bs16 q1 19 +0.26% +1.81%
q35b-tp1 fp8 bs16 q4 19 -0.18% +1.06%
q35b-tp1 fp8 bs64 q1 19 +0.01% +1.06%
q35b-tp1 fp8 bs64 q4 19 -0.07% +1.13%
q35b-tp1 fp8tok bs128 q1 19 +1.07% +3.32%
q35b-tp1 fp8tok bs128 q4 19 +0.29% +3.44%
q35b-tp1 fp8tok bs16 q1 19 +0.66% +2.88%
q35b-tp1 fp8tok bs16 q4 19 +1.19% +2.51%
q35b-tp1 fp8tok bs64 q1 19 -0.13% +3.32%
q35b-tp1 fp8tok bs64 q4 19 +0.34% +1.61%
q397b-tp4 bf16 bs128 q1 19 -3.11% +1.63%
q397b-tp4 bf16 bs16 q1 19 +1.53% +5.01%
q397b-tp4 bf16 bs64 q1 19 -3.15% +1.77%
q397b-tp4 fp8 bs128 q1 19 +0.16% +1.95%
q397b-tp4 fp8 bs16 q1 19 +0.21% +1.89%
q397b-tp4 fp8 bs64 q1 19 -0.24% +0.87%
q397b-tp8 bf16 bs128 q1 19 -2.93% +2.44%
q397b-tp8 bf16 bs16 q1 19 +1.10% +4.11%
q397b-tp8 bf16 bs64 q1 19 -3.33% +2.48%
q397b-tp8 fp8 bs128 q1 19 +0.08% +3.61%
q397b-tp8 fp8 bs16 q1 19 +0.23% +2.08%
q397b-tp8 fp8 bs64 q1 19 -0.21% +1.74%

The bf16 page 64/128 groups get 3–5% faster. That is a scheduling side effect in kernels that sit at the register limit (fewer s_waitcnt vmcnt in the ISA), not something this change is meant to buy.

All 513 shapes
shape main µs this PR µs change
q35b-tp1-bf16-bs128-q1-b1-c1024 8.45 8.53 +0.97%
q35b-tp1-bf16-bs128-q1-b1-c16384 12.51 11.31 -9.57%
q35b-tp1-bf16-bs128-q1-b1-c4096 8.64 8.84 +2.29%
q35b-tp1-bf16-bs128-q1-b1-c65536 32.44 28.59 -11.86%
q35b-tp1-bf16-bs128-q1-b16-c1024 11.53 10.13 -12.13%
q35b-tp1-bf16-bs128-q1-b16-c16384 104.57 96.13 -8.07%
q35b-tp1-bf16-bs128-q1-b16-c4096 26.21 25.73 -1.82%
q35b-tp1-bf16-bs128-q1-b16-c65536 373.21 347.69 -6.84%
q35b-tp1-bf16-bs128-q1-b256-c1024 102.41 94.71 -7.51%
q35b-tp1-bf16-bs128-q1-b256-c16384 1408.13 1400.72 -0.53%
q35b-tp1-bf16-bs128-q1-b256-c4096 369.00 354.27 -3.99%
q35b-tp1-bf16-bs128-q1-b4-c1024 8.50 8.79 +3.39%
q35b-tp1-bf16-bs128-q1-b4-c16384 26.79 26.39 -1.49%
q35b-tp1-bf16-bs128-q1-b4-c4096 11.74 10.61 -9.59%
q35b-tp1-bf16-bs128-q1-b4-c65536 104.49 96.21 -7.93%
q35b-tp1-bf16-bs128-q1-b64-c1024 25.56 25.41 -0.61%
q35b-tp1-bf16-bs128-q1-b64-c16384 367.77 350.96 -4.57%
q35b-tp1-bf16-bs128-q1-b64-c4096 100.86 93.41 -7.39%
q35b-tp1-bf16-bs128-q1-b64-c65536 1378.79 1372.82 -0.43%
q35b-tp1-bf16-bs16-q1-b1-c1024 8.40 8.63 +2.67%
q35b-tp1-bf16-bs16-q1-b1-c16384 11.09 11.31 +1.98%
q35b-tp1-bf16-bs16-q1-b1-c4096 8.58 8.83 +2.89%
q35b-tp1-bf16-bs16-q1-b1-c65536 28.77 29.87 +3.80%
q35b-tp1-bf16-bs16-q1-b16-c1024 10.17 10.30 +1.20%
q35b-tp1-bf16-bs16-q1-b16-c16384 100.53 99.22 -1.30%
q35b-tp1-bf16-bs16-q1-b16-c4096 24.35 24.76 +1.67%
q35b-tp1-bf16-bs16-q1-b16-c65536 363.27 362.59 -0.19%
q35b-tp1-bf16-bs16-q1-b256-c1024 99.44 98.66 -0.79%
q35b-tp1-bf16-bs16-q1-b256-c16384 1426.63 1421.52 -0.36%
q35b-tp1-bf16-bs16-q1-b256-c4096 358.82 359.88 +0.29%
q35b-tp1-bf16-bs16-q1-b4-c1024 8.42 8.72 +3.54%
q35b-tp1-bf16-bs16-q1-b4-c16384 25.11 25.45 +1.35%
q35b-tp1-bf16-bs16-q1-b4-c4096 10.39 10.59 +1.92%
q35b-tp1-bf16-bs16-q1-b4-c65536 98.22 99.41 +1.22%
q35b-tp1-bf16-bs16-q1-b64-c1024 23.68 24.13 +1.88%
q35b-tp1-bf16-bs16-q1-b64-c16384 353.47 355.54 +0.58%
q35b-tp1-bf16-bs16-q1-b64-c4096 98.08 98.66 +0.59%
q35b-tp1-bf16-bs16-q1-b64-c65536 1422.16 1418.91 -0.23%
q35b-tp1-bf16-bs64-q1-b1-c1024 8.39 8.36 -0.26%
q35b-tp1-bf16-bs64-q1-b1-c16384 12.70 11.15 -12.16%
q35b-tp1-bf16-bs64-q1-b1-c4096 8.57 8.69 +1.40%
q35b-tp1-bf16-bs64-q1-b1-c65536 32.84 28.25 -13.96%
q35b-tp1-bf16-bs64-q1-b16-c1024 11.68 10.36 -11.32%
q35b-tp1-bf16-bs64-q1-b16-c16384 108.62 97.87 -9.90%
q35b-tp1-bf16-bs64-q1-b16-c4096 26.09 25.76 -1.25%
q35b-tp1-bf16-bs64-q1-b16-c65536 379.70 359.07 -5.43%
q35b-tp1-bf16-bs64-q1-b256-c1024 110.09 97.32 -11.60%
q35b-tp1-bf16-bs64-q1-b256-c16384 1406.61 1414.91 +0.59%
q35b-tp1-bf16-bs64-q1-b256-c4096 382.72 355.79 -7.04%
q35b-tp1-bf16-bs64-q1-b4-c1024 8.33 8.62 +3.46%
q35b-tp1-bf16-bs64-q1-b4-c16384 26.89 26.05 -3.12%
q35b-tp1-bf16-bs64-q1-b4-c4096 11.86 10.65 -10.20%
q35b-tp1-bf16-bs64-q1-b4-c65536 106.46 98.64 -7.35%
q35b-tp1-bf16-bs64-q1-b64-c1024 24.88 24.40 -1.92%
q35b-tp1-bf16-bs64-q1-b64-c16384 371.05 359.67 -3.07%
q35b-tp1-bf16-bs64-q1-b64-c4096 102.12 94.42 -7.54%
q35b-tp1-bf16-bs64-q1-b64-c65536 1409.47 1413.71 +0.30%
q35b-tp1-fp8-bs128-q1-b1-c1024 7.28 7.24 -0.52%
q35b-tp1-fp8-bs128-q1-b1-c16384 8.42 8.47 +0.55%
q35b-tp1-fp8-bs128-q1-b1-c4096 7.40 7.47 +0.95%
q35b-tp1-fp8-bs128-q1-b1-c65536 20.03 18.99 -5.20%
q35b-tp1-fp8-bs128-q1-b16-c1024 7.44 7.51 +0.91%
q35b-tp1-fp8-bs128-q1-b16-c16384 43.20 43.65 +1.04%
q35b-tp1-fp8-bs128-q1-b16-c4096 16.70 16.61 -0.54%
q35b-tp1-fp8-bs128-q1-b16-c65536 180.57 180.58 +0.00%
q35b-tp1-fp8-bs128-q1-b256-c1024 43.58 43.03 -1.24%
q35b-tp1-fp8-bs128-q1-b256-c16384 703.33 700.89 -0.35%
q35b-tp1-fp8-bs128-q1-b256-c4096 189.93 189.26 -0.35%
q35b-tp1-fp8-bs128-q1-b4-c1024 7.11 7.20 +1.32%
q35b-tp1-fp8-bs128-q1-b4-c16384 17.43 17.29 -0.84%
q35b-tp1-fp8-bs128-q1-b4-c4096 7.55 7.65 +1.33%
q35b-tp1-fp8-bs128-q1-b4-c65536 43.74 44.17 +0.99%
q35b-tp1-fp8-bs128-q1-b64-c1024 16.47 16.31 -0.97%
q35b-tp1-fp8-bs128-q1-b64-c16384 186.57 186.37 -0.11%
q35b-tp1-fp8-bs128-q1-b64-c4096 42.51 43.27 +1.78%
q35b-tp1-fp8-bs128-q1-b64-c65536 709.05 700.18 -1.25%
q35b-tp1-fp8-bs128-q4-b1-c1024 9.27 9.10 -1.81%
q35b-tp1-fp8-bs128-q4-b1-c16384 11.18 10.99 -1.65%
q35b-tp1-fp8-bs128-q4-b1-c4096 9.53 9.39 -1.47%
q35b-tp1-fp8-bs128-q4-b1-c65536 22.65 22.91 +1.17%
q35b-tp1-fp8-bs128-q4-b16-c1024 10.26 10.15 -1.15%
q35b-tp1-fp8-bs128-q4-b16-c16384 47.06 47.86 +1.71%
q35b-tp1-fp8-bs128-q4-b16-c4096 19.92 19.87 -0.22%
q35b-tp1-fp8-bs128-q4-b16-c65536 186.94 188.95 +1.08%
q35b-tp1-fp8-bs128-q4-b256-c1024 55.20 55.80 +1.08%
q35b-tp1-fp8-bs128-q4-b256-c16384 710.38 712.11 +0.24%
q35b-tp1-fp8-bs128-q4-b256-c4096 200.88 201.43 +0.27%
q35b-tp1-fp8-bs128-q4-b4-c1024 9.31 9.22 -0.92%
q35b-tp1-fp8-bs128-q4-b4-c16384 20.27 20.27 +0.03%
q35b-tp1-fp8-bs128-q4-b4-c4096 10.33 10.14 -1.84%
q35b-tp1-fp8-bs128-q4-b4-c65536 47.87 48.67 +1.67%
q35b-tp1-fp8-bs128-q4-b64-c1024 19.46 19.56 +0.51%
q35b-tp1-fp8-bs128-q4-b64-c16384 190.95 192.95 +1.04%
q35b-tp1-fp8-bs128-q4-b64-c4096 47.88 47.88 -0.00%
q35b-tp1-fp8-bs128-q4-b64-c65536 700.67 705.50 +0.69%
q35b-tp1-fp8-bs16-q1-b1-c1024 7.29 7.30 +0.14%
q35b-tp1-fp8-bs16-q1-b1-c16384 8.96 8.96 -0.09%
q35b-tp1-fp8-bs16-q1-b1-c4096 7.53 7.53 +0.03%
q35b-tp1-fp8-bs16-q1-b1-c65536 22.20 22.44 +1.08%
q35b-tp1-fp8-bs16-q1-b16-c1024 8.12 8.16 +0.52%
q35b-tp1-fp8-bs16-q1-b16-c16384 58.33 58.12 -0.34%
q35b-tp1-fp8-bs16-q1-b16-c4096 17.24 17.56 +1.81%
q35b-tp1-fp8-bs16-q1-b16-c65536 245.41 244.24 -0.48%
q35b-tp1-fp8-bs16-q1-b256-c1024 52.74 53.04 +0.56%
q35b-tp1-fp8-bs16-q1-b256-c16384 992.77 991.64 -0.11%
q35b-tp1-fp8-bs16-q1-b256-c4096 246.75 246.88 +0.05%
q35b-tp1-fp8-bs16-q1-b4-c1024 7.37 7.45 +1.11%
q35b-tp1-fp8-bs16-q1-b4-c16384 17.98 18.11 +0.75%
q35b-tp1-fp8-bs16-q1-b4-c4096 8.19 8.25 +0.68%
q35b-tp1-fp8-bs16-q1-b4-c65536 58.76 58.58 -0.30%
q35b-tp1-fp8-bs16-q1-b64-c1024 15.96 16.09 +0.81%
q35b-tp1-fp8-bs16-q1-b64-c16384 243.49 243.16 -0.14%
q35b-tp1-fp8-bs16-q1-b64-c4096 57.78 57.40 -0.65%
q35b-tp1-fp8-bs16-q1-b64-c65536 971.34 967.15 -0.43%
q35b-tp1-fp8-bs16-q4-b1-c1024 9.30 9.25 -0.60%
q35b-tp1-fp8-bs16-q4-b1-c16384 11.61 11.60 -0.09%
q35b-tp1-fp8-bs16-q4-b1-c4096 9.59 9.54 -0.54%
q35b-tp1-fp8-bs16-q4-b1-c65536 26.34 26.37 +0.11%
q35b-tp1-fp8-bs16-q4-b16-c1024 10.59 10.68 +0.85%
q35b-tp1-fp8-bs16-q4-b16-c16384 61.00 60.74 -0.42%
q35b-tp1-fp8-bs16-q4-b16-c4096 21.34 21.29 -0.22%
q35b-tp1-fp8-bs16-q4-b16-c65536 248.20 246.78 -0.57%
q35b-tp1-fp8-bs16-q4-b256-c1024 63.42 64.09 +1.06%
q35b-tp1-fp8-bs16-q4-b256-c16384 1033.24 1029.13 -0.40%
q35b-tp1-fp8-bs16-q4-b256-c4096 268.01 266.14 -0.70%
q35b-tp1-fp8-bs16-q4-b4-c1024 9.68 9.51 -1.78%
q35b-tp1-fp8-bs16-q4-b4-c16384 21.11 21.25 +0.67%
q35b-tp1-fp8-bs16-q4-b4-c4096 10.61 10.59 -0.26%
q35b-tp1-fp8-bs16-q4-b4-c65536 61.95 61.67 -0.44%
q35b-tp1-fp8-bs16-q4-b64-c1024 20.55 20.74 +0.96%
q35b-tp1-fp8-bs16-q4-b64-c16384 263.75 262.64 -0.42%
q35b-tp1-fp8-bs16-q4-b64-c4096 61.14 60.93 -0.34%
q35b-tp1-fp8-bs16-q4-b64-c65536 955.53 952.48 -0.32%
q35b-tp1-fp8-bs64-q1-b1-c1024 7.01 6.94 -1.00%
q35b-tp1-fp8-bs64-q1-b1-c16384 8.88 8.84 -0.45%
q35b-tp1-fp8-bs64-q1-b1-c4096 7.23 7.24 +0.11%
q35b-tp1-fp8-bs64-q1-b1-c65536 17.73 17.92 +1.06%
q35b-tp1-fp8-bs64-q1-b16-c1024 7.93 7.90 -0.45%
q35b-tp1-fp8-bs64-q1-b16-c16384 44.44 44.41 -0.06%
q35b-tp1-fp8-bs64-q1-b16-c4096 15.25 15.19 -0.39%
q35b-tp1-fp8-bs64-q1-b16-c65536 167.64 167.56 -0.05%
q35b-tp1-fp8-bs64-q1-b256-c1024 42.03 42.07 +0.11%
q35b-tp1-fp8-bs64-q1-b256-c16384 674.83 678.72 +0.58%
q35b-tp1-fp8-bs64-q1-b256-c4096 182.09 181.98 -0.06%
q35b-tp1-fp8-bs64-q1-b4-c1024 7.08 7.11 +0.54%
q35b-tp1-fp8-bs64-q1-b4-c16384 15.88 15.78 -0.60%
q35b-tp1-fp8-bs64-q1-b4-c4096 8.00 7.97 -0.28%
q35b-tp1-fp8-bs64-q1-b4-c65536 45.06 45.04 -0.06%
q35b-tp1-fp8-bs64-q1-b64-c1024 14.16 14.29 +0.92%
q35b-tp1-fp8-bs64-q1-b64-c16384 166.31 166.60 +0.18%
q35b-tp1-fp8-bs64-q1-b64-c4096 43.75 43.80 +0.11%
q35b-tp1-fp8-bs64-q1-b64-c65536 698.54 698.43 -0.02%
q35b-tp1-fp8-bs64-q4-b1-c1024 8.93 8.85 -0.83%
q35b-tp1-fp8-bs64-q4-b1-c16384 11.18 11.21 +0.30%
q35b-tp1-fp8-bs64-q4-b1-c4096 9.19 9.20 +0.11%
q35b-tp1-fp8-bs64-q4-b1-c65536 22.82 22.93 +0.46%
q35b-tp1-fp8-bs64-q4-b16-c1024 10.30 10.20 -0.93%
q35b-tp1-fp8-bs64-q4-b16-c16384 46.77 46.79 +0.02%
q35b-tp1-fp8-bs64-q4-b16-c4096 19.31 19.30 -0.03%
q35b-tp1-fp8-bs64-q4-b16-c65536 171.79 172.05 +0.15%
q35b-tp1-fp8-bs64-q4-b256-c1024 52.74 53.34 +1.13%
q35b-tp1-fp8-bs64-q4-b256-c16384 672.08 673.68 +0.24%
q35b-tp1-fp8-bs64-q4-b256-c4096 188.56 189.43 +0.46%
q35b-tp1-fp8-bs64-q4-b4-c1024 9.08 9.04 -0.37%
q35b-tp1-fp8-bs64-q4-b4-c16384 19.37 19.42 +0.30%
q35b-tp1-fp8-bs64-q4-b4-c4096 10.01 9.95 -0.56%
q35b-tp1-fp8-bs64-q4-b4-c65536 47.42 46.84 -1.21%
q35b-tp1-fp8-bs64-q4-b64-c1024 19.31 19.24 -0.39%
q35b-tp1-fp8-bs64-q4-b64-c16384 178.28 178.41 +0.07%
q35b-tp1-fp8-bs64-q4-b64-c4096 46.73 46.72 -0.04%
q35b-tp1-fp8-bs64-q4-b64-c65536 702.28 700.50 -0.25%
q35b-tp1-fp8tok-bs128-q1-b1-c1024 7.46 7.63 +2.36%
q35b-tp1-fp8tok-bs128-q1-b1-c16384 8.64 8.88 +2.75%
q35b-tp1-fp8tok-bs128-q1-b1-c4096 7.63 7.84 +2.75%
q35b-tp1-fp8tok-bs128-q1-b1-c65536 22.26 22.39 +0.58%
q35b-tp1-fp8tok-bs128-q1-b16-c1024 7.66 7.88 +2.90%
q35b-tp1-fp8tok-bs128-q1-b16-c16384 46.97 47.87 +1.91%
q35b-tp1-fp8tok-bs128-q1-b16-c4096 17.92 17.97 +0.28%
q35b-tp1-fp8tok-bs128-q1-b16-c65536 193.49 192.90 -0.30%
q35b-tp1-fp8tok-bs128-q1-b256-c1024 43.65 44.69 +2.38%
q35b-tp1-fp8tok-bs128-q1-b256-c16384 733.55 720.57 -1.77%
q35b-tp1-fp8tok-bs128-q1-b256-c4096 194.96 190.24 -2.42%
q35b-tp1-fp8tok-bs128-q1-b4-c1024 7.47 7.69 +2.89%
q35b-tp1-fp8tok-bs128-q1-b4-c16384 18.57 18.84 +1.48%
q35b-tp1-fp8tok-bs128-q1-b4-c4096 7.82 8.08 +3.32%
q35b-tp1-fp8tok-bs128-q1-b4-c65536 48.46 49.09 +1.30%
q35b-tp1-fp8tok-bs128-q1-b64-c1024 17.61 18.03 +2.38%
q35b-tp1-fp8tok-bs128-q1-b64-c16384 197.93 194.81 -1.58%
q35b-tp1-fp8tok-bs128-q1-b64-c4096 46.80 48.13 +2.86%
q35b-tp1-fp8tok-bs128-q1-b64-c65536 753.54 728.43 -3.33%
q35b-tp1-fp8tok-bs128-q4-b1-c1024 9.65 9.59 -0.64%
q35b-tp1-fp8tok-bs128-q4-b1-c16384 11.60 11.50 -0.88%
q35b-tp1-fp8tok-bs128-q4-b1-c4096 9.90 9.86 -0.46%
q35b-tp1-fp8tok-bs128-q4-b1-c65536 25.94 26.03 +0.33%
q35b-tp1-fp8tok-bs128-q4-b16-c1024 10.72 10.57 -1.36%
q35b-tp1-fp8tok-bs128-q4-b16-c16384 54.27 54.34 +0.12%
q35b-tp1-fp8tok-bs128-q4-b16-c4096 21.18 21.28 +0.45%
q35b-tp1-fp8tok-bs128-q4-b16-c65536 206.12 209.26 +1.53%
q35b-tp1-fp8tok-bs128-q4-b256-c1024 61.89 62.32 +0.69%
q35b-tp1-fp8tok-bs128-q4-b256-c16384 779.78 783.81 +0.52%
q35b-tp1-fp8tok-bs128-q4-b256-c4096 217.02 219.93 +1.34%
q35b-tp1-fp8tok-bs128-q4-b4-c1024 9.68 9.64 -0.41%
q35b-tp1-fp8tok-bs128-q4-b4-c16384 21.67 21.54 -0.64%
q35b-tp1-fp8tok-bs128-q4-b4-c4096 10.77 10.82 +0.45%
q35b-tp1-fp8tok-bs128-q4-b4-c65536 55.27 55.60 +0.60%
q35b-tp1-fp8tok-bs128-q4-b64-c1024 21.03 21.05 +0.09%
q35b-tp1-fp8tok-bs128-q4-b64-c16384 202.70 209.66 +3.44%
q35b-tp1-fp8tok-bs128-q4-b64-c4096 53.89 54.63 +1.37%
q35b-tp1-fp8tok-bs128-q4-b64-c65536 762.33 755.80 -0.86%
q35b-tp1-fp8tok-bs16-q1-b1-c1024 7.43 7.52 +1.21%
q35b-tp1-fp8tok-bs16-q1-b1-c16384 9.24 9.43 +2.01%
q35b-tp1-fp8tok-bs16-q1-b1-c4096 7.58 7.80 +2.88%
q35b-tp1-fp8tok-bs16-q1-b1-c65536 21.75 22.04 +1.34%
q35b-tp1-fp8tok-bs16-q1-b16-c1024 8.37 8.52 +1.77%
q35b-tp1-fp8tok-bs16-q1-b16-c16384 44.57 44.96 +0.87%
q35b-tp1-fp8tok-bs16-q1-b16-c4096 16.39 16.17 -1.32%
q35b-tp1-fp8tok-bs16-q1-b16-c65536 180.02 180.33 +0.17%
q35b-tp1-fp8tok-bs16-q1-b256-c1024 42.09 41.78 -0.72%
q35b-tp1-fp8tok-bs16-q1-b256-c16384 678.84 673.19 -0.83%
q35b-tp1-fp8tok-bs16-q1-b256-c4096 177.24 177.22 -0.01%
q35b-tp1-fp8tok-bs16-q1-b4-c1024 7.78 7.80 +0.21%
q35b-tp1-fp8tok-bs16-q1-b4-c16384 16.72 16.93 +1.22%
q35b-tp1-fp8tok-bs16-q1-b4-c4096 8.50 8.60 +1.11%
q35b-tp1-fp8tok-bs16-q1-b4-c65536 45.43 45.63 +0.42%
q35b-tp1-fp8tok-bs16-q1-b64-c1024 15.07 15.38 +2.08%
q35b-tp1-fp8tok-bs16-q1-b64-c16384 181.53 180.03 -0.83%
q35b-tp1-fp8tok-bs16-q1-b64-c4096 44.28 44.77 +1.11%
q35b-tp1-fp8tok-bs16-q1-b64-c65536 692.33 691.85 -0.07%
q35b-tp1-fp8tok-bs16-q4-b1-c1024 9.48 9.65 +1.86%
q35b-tp1-fp8tok-bs16-q4-b1-c16384 11.53 11.76 +1.96%
q35b-tp1-fp8tok-bs16-q4-b1-c4096 9.77 9.87 +1.02%
q35b-tp1-fp8tok-bs16-q4-b1-c65536 26.13 26.45 +1.22%
q35b-tp1-fp8tok-bs16-q4-b16-c1024 10.80 10.94 +1.31%
q35b-tp1-fp8tok-bs16-q4-b16-c16384 49.75 50.91 +2.34%
q35b-tp1-fp8tok-bs16-q4-b16-c4096 20.23 20.39 +0.80%
q35b-tp1-fp8tok-bs16-q4-b16-c65536 196.63 195.70 -0.47%
q35b-tp1-fp8tok-bs16-q4-b256-c1024 56.37 57.13 +1.37%
q35b-tp1-fp8tok-bs16-q4-b256-c16384 754.37 764.10 +1.29%
q35b-tp1-fp8tok-bs16-q4-b256-c4096 198.50 203.47 +2.51%
q35b-tp1-fp8tok-bs16-q4-b4-c1024 9.59 9.79 +2.04%
q35b-tp1-fp8tok-bs16-q4-b4-c16384 20.47 20.63 +0.79%
q35b-tp1-fp8tok-bs16-q4-b4-c4096 10.75 10.92 +1.62%
q35b-tp1-fp8tok-bs16-q4-b4-c65536 49.97 50.37 +0.79%
q35b-tp1-fp8tok-bs16-q4-b64-c1024 19.82 19.94 +0.62%
q35b-tp1-fp8tok-bs16-q4-b64-c16384 196.70 199.50 +1.43%
q35b-tp1-fp8tok-bs16-q4-b64-c4096 49.71 50.40 +1.39%
q35b-tp1-fp8tok-bs16-q4-b64-c65536 743.84 735.28 -1.15%
q35b-tp1-fp8tok-bs64-q1-b1-c1024 7.28 7.32 +0.47%
q35b-tp1-fp8tok-bs64-q1-b1-c16384 9.09 9.09 +0.00%
q35b-tp1-fp8tok-bs64-q1-b1-c4096 7.46 7.45 -0.11%
q35b-tp1-fp8tok-bs64-q1-b1-c65536 18.78 19.10 +1.69%
q35b-tp1-fp8tok-bs64-q1-b16-c1024 8.05 7.91 -1.74%
q35b-tp1-fp8tok-bs64-q1-b16-c16384 44.91 44.54 -0.81%
q35b-tp1-fp8tok-bs64-q1-b16-c4096 15.55 15.60 +0.35%
q35b-tp1-fp8tok-bs64-q1-b16-c65536 178.30 178.24 -0.04%
q35b-tp1-fp8tok-bs64-q1-b256-c1024 42.67 42.93 +0.60%
q35b-tp1-fp8tok-bs64-q1-b256-c16384 664.58 686.63 +3.32%
q35b-tp1-fp8tok-bs64-q1-b256-c4096 173.78 177.59 +2.19%
q35b-tp1-fp8tok-bs64-q1-b4-c1024 7.22 7.28 +0.75%
q35b-tp1-fp8tok-bs64-q1-b4-c16384 16.24 16.26 +0.14%
q35b-tp1-fp8tok-bs64-q1-b4-c4096 8.27 8.30 +0.34%
q35b-tp1-fp8tok-bs64-q1-b4-c65536 45.49 45.18 -0.69%
q35b-tp1-fp8tok-bs64-q1-b64-c1024 14.88 14.96 +0.52%
q35b-tp1-fp8tok-bs64-q1-b64-c16384 178.06 170.11 -4.47%
q35b-tp1-fp8tok-bs64-q1-b64-c4096 44.33 44.42 +0.18%
q35b-tp1-fp8tok-bs64-q1-b64-c65536 683.09 650.52 -4.77%
q35b-tp1-fp8tok-bs64-q4-b1-c1024 9.10 9.09 -0.11%
q35b-tp1-fp8tok-bs64-q4-b1-c16384 11.36 11.33 -0.26%
q35b-tp1-fp8tok-bs64-q4-b1-c4096 9.41 9.36 -0.45%
q35b-tp1-fp8tok-bs64-q4-b1-c65536 23.90 24.05 +0.62%
q35b-tp1-fp8tok-bs64-q4-b16-c1024 10.45 10.62 +1.61%
q35b-tp1-fp8tok-bs64-q4-b16-c16384 48.94 48.77 -0.33%
q35b-tp1-fp8tok-bs64-q4-b16-c4096 19.79 19.81 +0.09%
q35b-tp1-fp8tok-bs64-q4-b16-c65536 180.71 181.69 +0.54%
q35b-tp1-fp8tok-bs64-q4-b256-c1024 54.53 54.69 +0.30%
q35b-tp1-fp8tok-bs64-q4-b256-c16384 696.86 700.68 +0.55%
q35b-tp1-fp8tok-bs64-q4-b256-c4096 193.97 194.28 +0.16%
q35b-tp1-fp8tok-bs64-q4-b4-c1024 9.29 9.29 -0.04%
q35b-tp1-fp8tok-bs64-q4-b4-c16384 20.02 20.04 +0.09%
q35b-tp1-fp8tok-bs64-q4-b4-c4096 10.55 10.64 +0.78%
q35b-tp1-fp8tok-bs64-q4-b4-c65536 48.25 48.91 +1.36%
q35b-tp1-fp8tok-bs64-q4-b64-c1024 19.61 19.76 +0.81%
q35b-tp1-fp8tok-bs64-q4-b64-c16384 181.14 182.84 +0.94%
q35b-tp1-fp8tok-bs64-q4-b64-c4096 48.35 48.12 -0.48%
q35b-tp1-fp8tok-bs64-q4-b64-c65536 691.05 693.88 +0.41%
q397b-tp4-bf16-bs128-q1-b1-c1024 8.28 8.39 +1.30%
q397b-tp4-bf16-bs128-q1-b1-c16384 9.67 9.66 -0.08%
q397b-tp4-bf16-bs128-q1-b1-c4096 8.67 8.70 +0.35%
q397b-tp4-bf16-bs128-q1-b1-c65536 29.36 23.26 -20.78%
q397b-tp4-bf16-bs128-q1-b16-c1024 8.48 8.62 +1.63%
q397b-tp4-bf16-bs128-q1-b16-c16384 44.88 44.04 -1.87%
q397b-tp4-bf16-bs128-q1-b16-c4096 16.68 16.55 -0.78%
q397b-tp4-bf16-bs128-q1-b16-c65536 198.85 183.01 -7.96%
q397b-tp4-bf16-bs128-q1-b256-c1024 43.73 42.07 -3.80%
q397b-tp4-bf16-bs128-q1-b256-c16384 722.12 692.64 -4.08%
q397b-tp4-bf16-bs128-q1-b256-c4096 195.76 184.77 -5.62%
q397b-tp4-bf16-bs128-q1-b4-c1024 8.42 8.51 +1.07%
q397b-tp4-bf16-bs128-q1-b4-c16384 17.48 17.72 +1.35%
q397b-tp4-bf16-bs128-q1-b4-c4096 8.67 8.74 +0.85%
q397b-tp4-bf16-bs128-q1-b4-c65536 46.07 44.74 -2.88%
q397b-tp4-bf16-bs128-q1-b64-c1024 16.26 16.09 -1.07%
q397b-tp4-bf16-bs128-q1-b64-c16384 195.05 182.29 -6.54%
q397b-tp4-bf16-bs128-q1-b64-c4096 45.26 43.45 -3.99%
q397b-tp4-bf16-bs128-q1-b64-c65536 707.72 682.75 -3.53%
q397b-tp4-bf16-bs16-q1-b1-c1024 8.30 8.53 +2.84%
q397b-tp4-bf16-bs16-q1-b1-c16384 9.52 9.72 +2.10%
q397b-tp4-bf16-bs16-q1-b1-c4096 8.63 8.84 +2.43%
q397b-tp4-bf16-bs16-q1-b1-c65536 24.41 25.38 +3.97%
q397b-tp4-bf16-bs16-q1-b16-c1024 8.60 9.01 +4.72%
q397b-tp4-bf16-bs16-q1-b16-c16384 42.98 43.20 +0.50%
q397b-tp4-bf16-bs16-q1-b16-c4096 15.88 16.17 +1.81%
q397b-tp4-bf16-bs16-q1-b16-c65536 185.70 186.72 +0.55%
q397b-tp4-bf16-bs16-q1-b256-c1024 39.29 39.61 +0.81%
q397b-tp4-bf16-bs16-q1-b256-c16384 714.56 714.55 -0.00%
q397b-tp4-bf16-bs16-q1-b256-c4096 184.67 183.83 -0.46%
q397b-tp4-bf16-bs16-q1-b4-c1024 8.26 8.67 +5.01%
q397b-tp4-bf16-bs16-q1-b4-c16384 16.81 17.03 +1.30%
q397b-tp4-bf16-bs16-q1-b4-c4096 8.62 8.94 +3.76%
q397b-tp4-bf16-bs16-q1-b4-c65536 43.95 44.01 +0.12%
q397b-tp4-bf16-bs16-q1-b64-c1024 14.70 14.95 +1.71%
q397b-tp4-bf16-bs16-q1-b64-c16384 187.64 187.05 -0.31%
q397b-tp4-bf16-bs16-q1-b64-c4096 42.24 41.93 -0.73%
q397b-tp4-bf16-bs16-q1-b64-c65536 716.57 711.56 -0.70%
q397b-tp4-bf16-bs64-q1-b1-c1024 8.32 8.27 -0.58%
q397b-tp4-bf16-bs64-q1-b1-c16384 9.51 9.56 +0.55%
q397b-tp4-bf16-bs64-q1-b1-c4096 8.48 8.63 +1.72%
q397b-tp4-bf16-bs64-q1-b1-c65536 29.29 23.28 -20.54%
q397b-tp4-bf16-bs64-q1-b16-c1024 8.37 8.52 +1.77%
q397b-tp4-bf16-bs64-q1-b16-c16384 44.26 43.56 -1.57%
q397b-tp4-bf16-bs64-q1-b16-c4096 16.46 16.06 -2.41%
q397b-tp4-bf16-bs64-q1-b16-c65536 210.35 191.64 -8.90%
q397b-tp4-bf16-bs64-q1-b256-c1024 41.38 40.75 -1.54%
q397b-tp4-bf16-bs64-q1-b256-c16384 736.90 705.43 -4.27%
q397b-tp4-bf16-bs64-q1-b256-c4096 201.23 184.50 -8.31%
q397b-tp4-bf16-bs64-q1-b4-c1024 8.29 8.41 +1.47%
q397b-tp4-bf16-bs64-q1-b4-c16384 17.41 17.10 -1.81%
q397b-tp4-bf16-bs64-q1-b4-c4096 8.57 8.64 +0.82%
q397b-tp4-bf16-bs64-q1-b4-c65536 45.20 44.23 -2.13%
q397b-tp4-bf16-bs64-q1-b64-c1024 15.77 15.76 -0.04%
q397b-tp4-bf16-bs64-q1-b64-c16384 195.82 185.31 -5.37%
q397b-tp4-bf16-bs64-q1-b64-c4096 44.15 43.08 -2.44%
q397b-tp4-bf16-bs64-q1-b64-c65536 736.47 710.96 -3.46%
q397b-tp4-fp8-bs128-q1-b1-c1024 7.15 7.14 -0.14%
q397b-tp4-fp8-bs128-q1-b1-c16384 8.34 8.38 +0.50%
q397b-tp4-fp8-bs128-q1-b1-c4096 7.47 7.38 -1.18%
q397b-tp4-fp8-bs128-q1-b1-c65536 18.07 16.65 -7.84%
q397b-tp4-fp8-bs128-q1-b16-c1024 7.23 7.32 +1.25%
q397b-tp4-fp8-bs128-q1-b16-c16384 25.64 25.89 +0.98%
q397b-tp4-fp8-bs128-q1-b16-c4096 9.84 9.84 +0.04%
q397b-tp4-fp8-bs128-q1-b16-c65536 96.55 97.04 +0.50%
q397b-tp4-fp8-bs128-q1-b256-c1024 24.74 25.10 +1.47%
q397b-tp4-fp8-bs128-q1-b256-c16384 351.29 352.01 +0.21%
q397b-tp4-fp8-bs128-q1-b256-c4096 96.24 96.34 +0.10%
q397b-tp4-fp8-bs128-q1-b4-c1024 7.15 7.28 +1.82%
q397b-tp4-fp8-bs128-q1-b4-c16384 10.93 10.86 -0.57%
q397b-tp4-fp8-bs128-q1-b4-c4096 7.37 7.47 +1.38%
q397b-tp4-fp8-bs128-q1-b4-c65536 26.25 26.54 +1.10%
q397b-tp4-fp8-bs128-q1-b64-c1024 9.70 9.70 +0.00%
q397b-tp4-fp8-bs128-q1-b64-c16384 97.04 98.78 +1.80%
q397b-tp4-fp8-bs128-q1-b64-c4096 25.17 25.66 +1.95%
q397b-tp4-fp8-bs128-q1-b64-c65536 364.90 365.21 +0.08%
q397b-tp4-fp8-bs16-q1-b1-c1024 7.20 7.26 +0.86%
q397b-tp4-fp8-bs16-q1-b1-c16384 8.56 8.63 +0.75%
q397b-tp4-fp8-bs16-q1-b1-c4096 7.72 7.83 +1.40%
q397b-tp4-fp8-bs16-q1-b1-c65536 19.45 19.82 +1.89%
q397b-tp4-fp8-bs16-q1-b16-c1024 7.56 7.59 +0.45%
q397b-tp4-fp8-bs16-q1-b16-c16384 32.17 32.02 -0.45%
q397b-tp4-fp8-bs16-q1-b16-c4096 9.69 9.67 -0.23%
q397b-tp4-fp8-bs16-q1-b16-c65536 111.15 110.37 -0.70%
q397b-tp4-fp8-bs16-q1-b256-c1024 30.09 30.27 +0.58%
q397b-tp4-fp8-bs16-q1-b256-c16384 509.11 507.44 -0.33%
q397b-tp4-fp8-bs16-q1-b256-c4096 111.26 109.58 -1.51%
q397b-tp4-fp8-bs16-q1-b4-c1024 7.65 7.68 +0.47%
q397b-tp4-fp8-bs16-q1-b4-c16384 10.32 10.32 +0.00%
q397b-tp4-fp8-bs16-q1-b4-c4096 7.60 7.63 +0.39%
q397b-tp4-fp8-bs16-q1-b4-c65536 32.33 32.44 +0.33%
q397b-tp4-fp8-bs16-q1-b64-c1024 9.20 9.28 +0.85%
q397b-tp4-fp8-bs16-q1-b64-c16384 111.58 110.97 -0.55%
q397b-tp4-fp8-bs16-q1-b64-c4096 31.18 31.27 +0.30%
q397b-tp4-fp8-bs16-q1-b64-c65536 482.84 480.69 -0.45%
q397b-tp4-fp8-bs64-q1-b1-c1024 6.97 6.96 -0.20%
q397b-tp4-fp8-bs64-q1-b1-c16384 8.39 8.38 -0.12%
q397b-tp4-fp8-bs64-q1-b1-c4096 7.58 7.56 -0.16%
q397b-tp4-fp8-bs64-q1-b1-c65536 15.50 15.47 -0.19%
q397b-tp4-fp8-bs64-q1-b16-c1024 7.41 7.33 -1.16%
q397b-tp4-fp8-bs64-q1-b16-c16384 25.73 25.77 +0.13%
q397b-tp4-fp8-bs64-q1-b16-c4096 9.30 9.25 -0.56%
q397b-tp4-fp8-bs64-q1-b16-c65536 83.26 83.07 -0.23%
q397b-tp4-fp8-bs64-q1-b256-c1024 24.50 24.71 +0.87%
q397b-tp4-fp8-bs64-q1-b256-c16384 355.19 355.64 +0.13%
q397b-tp4-fp8-bs64-q1-b256-c4096 81.80 82.03 +0.28%
q397b-tp4-fp8-bs64-q1-b4-c1024 7.38 7.24 -1.95%
q397b-tp4-fp8-bs64-q1-b4-c16384 10.14 10.07 -0.69%
q397b-tp4-fp8-bs64-q1-b4-c4096 7.60 7.50 -1.42%
q397b-tp4-fp8-bs64-q1-b4-c65536 26.41 26.44 +0.10%
q397b-tp4-fp8-bs64-q1-b64-c1024 8.86 8.92 +0.72%
q397b-tp4-fp8-bs64-q1-b64-c16384 83.77 83.30 -0.56%
q397b-tp4-fp8-bs64-q1-b64-c4096 25.66 25.69 +0.13%
q397b-tp4-fp8-bs64-q1-b64-c65536 330.41 331.37 +0.29%
q397b-tp8-bf16-bs128-q1-b1-c1024 8.14 8.12 -0.25%
q397b-tp8-bf16-bs128-q1-b1-c16384 9.24 9.47 +2.44%
q397b-tp8-bf16-bs128-q1-b1-c4096 8.33 8.44 +1.39%
q397b-tp8-bf16-bs128-q1-b1-c65536 29.12 22.98 -21.08%
q397b-tp8-bf16-bs128-q1-b16-c1024 8.42 8.42 +0.00%
q397b-tp8-bf16-bs128-q1-b16-c16384 44.35 44.06 -0.64%
q397b-tp8-bf16-bs128-q1-b16-c4096 16.45 16.46 +0.05%
q397b-tp8-bf16-bs128-q1-b16-c65536 198.19 180.56 -8.89%
q397b-tp8-bf16-bs128-q1-b256-c1024 43.17 41.68 -3.45%
q397b-tp8-bf16-bs128-q1-b256-c16384 722.58 691.46 -4.31%
q397b-tp8-bf16-bs128-q1-b256-c4096 195.72 184.72 -5.62%
q397b-tp8-bf16-bs128-q1-b4-c1024 8.35 8.44 +1.10%
q397b-tp8-bf16-bs128-q1-b4-c16384 17.43 17.39 -0.28%
q397b-tp8-bf16-bs128-q1-b4-c4096 8.55 8.68 +1.54%
q397b-tp8-bf16-bs128-q1-b4-c65536 45.05 44.44 -1.35%
q397b-tp8-bf16-bs128-q1-b64-c1024 15.91 16.06 +0.98%
q397b-tp8-bf16-bs128-q1-b64-c16384 196.44 182.19 -7.26%
q397b-tp8-bf16-bs128-q1-b64-c4096 44.40 43.31 -2.45%
q397b-tp8-bf16-bs128-q1-b64-c65536 708.68 676.39 -4.56%
q397b-tp8-bf16-bs16-q1-b1-c1024 8.09 8.30 +2.50%
q397b-tp8-bf16-bs16-q1-b1-c16384 9.27 9.45 +1.90%
q397b-tp8-bf16-bs16-q1-b1-c4096 8.28 8.45 +2.00%
q397b-tp8-bf16-bs16-q1-b1-c65536 24.15 25.14 +4.11%
q397b-tp8-bf16-bs16-q1-b16-c1024 8.63 8.71 +0.88%
q397b-tp8-bf16-bs16-q1-b16-c16384 43.07 43.05 -0.04%
q397b-tp8-bf16-bs16-q1-b16-c4096 15.78 15.98 +1.25%
q397b-tp8-bf16-bs16-q1-b16-c65536 193.85 187.78 -3.13%
q397b-tp8-bf16-bs16-q1-b256-c1024 38.64 39.02 +0.98%
q397b-tp8-bf16-bs16-q1-b256-c16384 717.48 708.70 -1.22%
q397b-tp8-bf16-bs16-q1-b256-c4096 181.75 186.06 +2.37%
q397b-tp8-bf16-bs16-q1-b4-c1024 8.28 8.59 +3.72%
q397b-tp8-bf16-bs16-q1-b4-c16384 16.58 16.70 +0.68%
q397b-tp8-bf16-bs16-q1-b4-c4096 8.52 8.82 +3.52%
q397b-tp8-bf16-bs16-q1-b4-c65536 43.17 43.65 +1.10%
q397b-tp8-bf16-bs16-q1-b64-c1024 14.73 14.69 -0.24%
q397b-tp8-bf16-bs16-q1-b64-c16384 185.40 184.17 -0.67%
q397b-tp8-bf16-bs16-q1-b64-c4096 41.22 42.72 +3.65%
q397b-tp8-bf16-bs16-q1-b64-c65536 718.73 704.08 -2.04%
q397b-tp8-bf16-bs64-q1-b1-c1024 8.11 8.09 -0.20%
q397b-tp8-bf16-bs64-q1-b1-c16384 9.14 9.27 +1.38%
q397b-tp8-bf16-bs64-q1-b1-c4096 8.32 8.30 -0.26%
q397b-tp8-bf16-bs64-q1-b1-c65536 29.16 23.15 -20.61%
q397b-tp8-bf16-bs64-q1-b16-c1024 8.34 8.54 +2.35%
q397b-tp8-bf16-bs64-q1-b16-c16384 44.33 42.99 -3.01%
q397b-tp8-bf16-bs64-q1-b16-c4096 16.30 16.00 -1.82%
q397b-tp8-bf16-bs64-q1-b16-c65536 209.67 191.47 -8.68%
q397b-tp8-bf16-bs64-q1-b256-c1024 41.30 40.38 -2.22%
q397b-tp8-bf16-bs64-q1-b256-c16384 740.52 710.61 -4.04%
q397b-tp8-bf16-bs64-q1-b256-c4096 195.48 184.56 -5.59%
q397b-tp8-bf16-bs64-q1-b4-c1024 8.23 8.44 +2.48%
q397b-tp8-bf16-bs64-q1-b4-c16384 17.22 16.96 -1.50%
q397b-tp8-bf16-bs64-q1-b4-c4096 8.51 8.50 -0.05%
q397b-tp8-bf16-bs64-q1-b4-c65536 44.90 44.02 -1.95%
q397b-tp8-bf16-bs64-q1-b64-c1024 15.49 15.05 -2.80%
q397b-tp8-bf16-bs64-q1-b64-c16384 197.24 186.52 -5.43%
q397b-tp8-bf16-bs64-q1-b64-c4096 44.35 42.71 -3.70%
q397b-tp8-bf16-bs64-q1-b64-c65536 739.55 703.18 -4.92%
q397b-tp8-fp8-bs128-q1-b1-c1024 6.95 6.98 +0.40%
q397b-tp8-fp8-bs128-q1-b1-c16384 8.11 8.04 -0.84%
q397b-tp8-fp8-bs128-q1-b1-c4096 7.07 7.15 +1.13%
q397b-tp8-fp8-bs128-q1-b1-c65536 17.84 16.56 -7.17%
q397b-tp8-fp8-bs128-q1-b16-c1024 7.16 7.13 -0.47%
q397b-tp8-fp8-bs128-q1-b16-c16384 25.42 25.69 +1.07%
q397b-tp8-fp8-bs128-q1-b16-c4096 9.62 9.37 -2.60%
q397b-tp8-fp8-bs128-q1-b16-c65536 97.77 99.86 +2.14%
q397b-tp8-fp8-bs128-q1-b256-c1024 24.41 24.67 +1.07%
q397b-tp8-fp8-bs128-q1-b256-c16384 352.38 365.08 +3.61%
q397b-tp8-fp8-bs128-q1-b256-c4096 96.54 96.38 -0.17%
q397b-tp8-fp8-bs128-q1-b4-c1024 7.09 7.19 +1.35%
q397b-tp8-fp8-bs128-q1-b4-c16384 10.49 10.33 -1.47%
q397b-tp8-fp8-bs128-q1-b4-c4096 7.26 7.28 +0.30%
q397b-tp8-fp8-bs128-q1-b4-c65536 26.16 26.54 +1.47%
q397b-tp8-fp8-bs128-q1-b64-c1024 9.29 9.22 -0.75%
q397b-tp8-fp8-bs128-q1-b64-c16384 96.72 97.64 +0.96%
q397b-tp8-fp8-bs128-q1-b64-c4096 25.01 25.43 +1.67%
q397b-tp8-fp8-bs128-q1-b64-c65536 364.45 365.65 +0.33%
q397b-tp8-fp8-bs16-q1-b1-c1024 7.09 7.04 -0.70%
q397b-tp8-fp8-bs16-q1-b1-c16384 8.18 8.16 -0.22%
q397b-tp8-fp8-bs16-q1-b1-c4096 7.23 7.29 +0.83%
q397b-tp8-fp8-bs16-q1-b1-c65536 19.06 19.46 +2.08%
q397b-tp8-fp8-bs16-q1-b16-c1024 7.27 7.37 +1.40%
q397b-tp8-fp8-bs16-q1-b16-c16384 31.77 31.96 +0.59%
q397b-tp8-fp8-bs16-q1-b16-c4096 9.24 9.21 -0.39%
q397b-tp8-fp8-bs16-q1-b16-c65536 110.56 110.47 -0.08%
q397b-tp8-fp8-bs16-q1-b256-c1024 29.75 29.66 -0.30%
q397b-tp8-fp8-bs16-q1-b256-c16384 500.70 509.09 +1.68%
q397b-tp8-fp8-bs16-q1-b256-c4096 111.46 109.63 -1.64%
q397b-tp8-fp8-bs16-q1-b4-c1024 7.15 7.18 +0.42%
q397b-tp8-fp8-bs16-q1-b4-c16384 10.06 10.01 -0.54%
q397b-tp8-fp8-bs16-q1-b4-c4096 7.37 7.45 +1.17%
q397b-tp8-fp8-bs16-q1-b4-c65536 31.99 32.26 +0.83%
q397b-tp8-fp8-bs16-q1-b64-c1024 8.63 8.73 +1.16%
q397b-tp8-fp8-bs16-q1-b64-c16384 110.77 109.78 -0.90%
q397b-tp8-fp8-bs16-q1-b64-c4096 31.02 30.77 -0.80%
q397b-tp8-fp8-bs16-q1-b64-c65536 478.67 478.39 -0.06%
q397b-tp8-fp8-bs64-q1-b1-c1024 6.77 6.68 -1.27%
q397b-tp8-fp8-bs64-q1-b1-c16384 8.13 7.96 -2.04%
q397b-tp8-fp8-bs64-q1-b1-c4096 6.96 6.97 +0.09%
q397b-tp8-fp8-bs64-q1-b1-c65536 15.27 15.54 +1.74%
q397b-tp8-fp8-bs64-q1-b16-c1024 7.30 7.28 -0.19%
q397b-tp8-fp8-bs64-q1-b16-c16384 25.61 25.50 -0.42%
q397b-tp8-fp8-bs64-q1-b16-c4096 8.91 8.77 -1.64%
q397b-tp8-fp8-bs64-q1-b16-c65536 83.02 82.67 -0.43%
q397b-tp8-fp8-bs64-q1-b256-c1024 24.04 24.26 +0.92%
q397b-tp8-fp8-bs64-q1-b256-c16384 353.67 353.77 +0.03%
q397b-tp8-fp8-bs64-q1-b256-c4096 81.70 81.44 -0.32%
q397b-tp8-fp8-bs64-q1-b4-c1024 7.30 7.30 -0.03%
q397b-tp8-fp8-bs64-q1-b4-c16384 9.86 9.91 +0.47%
q397b-tp8-fp8-bs64-q1-b4-c4096 7.21 7.21 +0.00%
q397b-tp8-fp8-bs64-q1-b4-c65536 26.17 26.12 -0.18%
q397b-tp8-fp8-bs64-q1-b64-c1024 8.62 8.62 +0.07%
q397b-tp8-fp8-bs64-q1-b64-c16384 83.43 82.48 -1.14%
q397b-tp8-fp8-bs64-q1-b64-c4096 24.98 25.18 +0.78%
q397b-tp8-fp8-bs64-q1-b64-c65536 333.60 332.47 -0.34%

End to end

Setup: Qwen3.5-35B-A3B-FP8 on MI355X.

Server logs show only pa_decode -> flydsl[...] (... head_dim=256 torch.float8_e4m3fn) and no gluon fallback, so every full-attention decode call ran FlyDSL.

No injection. The NaN comes from Qwen3.5 checkpoint images in the KV pool. Strict-match:

ATOM aiter GSM8K 200, pass 1 / pass 2 (same server) GSM8K full (1319)
main main 0.060 / 0.005 0.063
main this PR 0.970 / 0.975 0.964
ROCm/ATOM#2635 main 0.965 / 0.980 0.964

On aiter main, answers start fine and then degenerate into repeated words (personal personal personal ...), or come back empty. With this PR, ATOM main matches the ROCm/ATOM#2635-guarded result exactly on the full set.

Stress run with injection. A local, unpushed ATOM hook fills every MHA K/V cache byte with 0xFF (e4m3fn NaN) and the per-token scales with NaN right after allocation, so every row a decode reads without owning it is NaN:

ATOM + injection aiter GSM8K 200
main main 0.055
main this PR 0.980 / 0.985

For reference, ATOM's default gluon path (ATOM_PA_FLYDSL=0) on this 35B TP1 recipe scores 0.970 / 0.970 without ROCm/ATOM#2635. Gluon returns finite wrong values rather than NaN at fp8, so this recipe does not show it; ROCm/ATOM#2635 measured the gluon drop on 397B TP8.

What ATOM can simplify

ROCm/ATOM#2635 has three parts. On the FlyDSL path, each one is covered by this PR:

ROCm/ATOM#2635 part what it guards covered here by
pools holding state images never hand out block 0 padded block-table lanes read block 0's checkpoint image every padded lane maps to tokens >= context_len, whose V is masked to 0, whose per-token scales are staged as 0, and whose K score is -inf
PAGE units a checkpoint releases are zeroed before the next batch the unwritten tail of a reused block still holds image bytes the same >= context_len mask on the boundary tile
zero those units before a connector load fills them (cfa9b4c1) ordering of the zeroing above goes away together with it

ATOM should keep ROCm/ATOM#2635 as is for now:

  • Gluon, ATOM's default, is not fixed here.
  • Even with ATOM_PA_FLYDSL=1, calls outside FlyDSL's domain fall back to gluon, e.g. bf16 KV or sliding window.
  • Kimi K3's MLA pool (mla_decode_fwd) relies on the null block and is not touched here.

Once every MHA decode call runs a kernel that masks unowned rows, the three MHA-pool parts can go.

Gluon pa_decode_gluon (not changed here)

  • Same bug. A NaN-injection probe fails all 432 gluon shapes on main:
    • bf16 outputs NaN or Inf.
    • fp8 outputs finite but wrong values.
  • Unconditional mask. gl.where(token < context_len, v, 0) costs +13.4% geomean, +66% worst.
  • Masking only on the boundary partition behind a branch costs +1.2% geomean, +24% worst (fp8 page 64, 64k context). The gluon kernels loop over partitions inside a CTA, and a branch in the loop body splits the whole body, so every full partition pays too.
  • Suggested fix. The cheap version needs the last partition peeled out of the loop in each of the four decode kernels. I'd rather leave that to the gluon owners than bundle it here.
  • ATOM's default path is gluon, so fix(qwen3.5): keep PAGE checkpoint images out of the KV rows decode reads ATOM#2635 stays needed there.

cc @zhuyuhua-v @fsx950223 @zhiding512

PR Self-Review

Reviewed revision

795de302

Behavior and intent

  • Before: FlyDSL pa_decode reads KV rows no sequence owns on a sequence's last 256-token tile (padded block-table lanes pinned to block 0, and the unwritten tail of the last page). K is masked with -inf, but V and per-token K/V scales are not, so a NaN byte there turns the output row into NaN (0 * NaN in PV). The kernel pushed this onto callers ("unowned V bytes must remain finite"), and ATOM had to work around it in fix(qwen3.5): keep PAGE checkpoint images out of the KV rows decode reads ATOM#2635; without that workaround Qwen3.5-35B-A3B-FP8 scores 0.06 on GSM8K.
  • After (e895c9c0): on gfx942/gfx950, the boundary tile ANDs V operands with per-lane byte masks right before each head chunk's PV, and per-token K/V scales at or past context_len are staged as 0. Full tiles are unchanged; clean-input output is bit-identical to main.
  • 795de302 (@fsx950223): adds mask_unowned_kv (default True = the behavior above) to pa_decode / compile_pa_decode_tile. False compiles the masking out, restoring the previous kernel and the old caller contract. The flag is part of the schedule cache key. gfx1250 pipelines ignore it and still require finite unowned bytes.

Validation and unverified scope

Validated on gfx950 (MI35x), all on e895c9c0 unless noted:

what result
pytest op_tests/test_flydsl_pa_decode.py main bbef5a6f 124 passed; e895c9c0 196 passed (124 + 72 new)
new test file against main's kernel 54 / 72 fail (all 36 NaN cases; the 18 passes are fp8 per-tensor "inf", whose e4m3 fill ±448 is finite)
pytest op_tests/triton_tests/test_pa_decode_gluon.py 43 passed on main (gluon is not touched)
NaN/Inf/random-byte probe, 468 FlyDSL shapes main 468 / 468 fail; e895c9c0 468 / 468 pass; zero-fill output bit-identical to main 468 / 468
kernel time, 513 shapes, 3 alternating rounds vs main geomean -0.58%, worst +5.0%, 16 shapes > +3% (tables above)
GSM8K 1319, Qwen3.5-35B-A3B-FP8 TP1, ATOM_PA_FLYDSL=1, ATOM main without ROCm/ATOM#2635 aiter main 0.063; this PR 0.964 (same as ROCm/ATOM#2635 on aiter main, 0.964)
CI "Aiter Test" on 795de302 (MI35X, shard 2) op_tests/test_flydsl_pa_decode.py: 196 passed, including the new mask_unowned_kv=False clean-input assertion

Unverified:

  • After 795de302, I did not re-run the probe, the kernel benchmark or the e2e runs; all numbers above except the CI row are from e895c9c0. The default path is meant to compile to the same kernel, but that is not checked (no ISA diff or timing on 795de302). The mask_unowned_kv=False path has no timing data from me, and its only coverage is the CI clean-input equality check.
  • gfx1250 pipelines (no hardware; the new test skips there).
  • BUFFER_KV (MTP4 fused with a KV cache > 2 GiB): same mask_v_chunk, but no test builds a cache that large.
  • Gluon pa_decode_gluon has the same bug and is not changed here (see above).

PR-specific question

test_pa_decode_unowned_kv_rows fills every row no sequence owns (padded block-table lanes on block 0, the tail of each last page, and their per-token scales) with NaN or Inf, and asserts the output is finite and bit-identical to the zero-filled run. Before this PR it fails with non-finite output on all 36 NaN cases and on the bf16 / per-token-scale Inf cases (54 / 72). The existing canonical test test_pa_decode fills the whole KV cache, padding included, with finite values (uniform_(-0.5, 0.5) or fixed patterns), so unowned rows contribute 0 * finite = 0 and the bug cannot show up there; its only NaN use is pre-filling the output buffer to catch unwritten outputs. No other op test exercises FlyDSL pa_decode with non-finite KV. The mask_unowned_kv=False assertion (795de302) checks that the opt-out path still matches on clean input.

Changed op tests

file covers why not redundant
op_tests/test_flydsl_pa_decode.py new test_pa_decode_unowned_kv_rows (72 cases: fp8 per-tensor trans_v / plain V, fp8 per-token, bf16; page 16/64/128; 3 head configs incl. qlen 4; NaN / Inf fills; lengths {1, 17, 255, 257, 1000}, block 0 unowned, 2 padded table columns). Asserts unowned rows have no effect on output, and that mask_unowned_kv=False matches the default on clean input existing test_pa_decode cases only use finite KV everywhere, so they cannot detect unowned rows leaking into PV; this is the only test of the NaN-in-unowned-rows contract and of the mask_unowned_kv flag. Existing tests are unchanged

Pages past a sequence are pinned to block 0 and the unwritten tail of its
last page is read as is. Their probabilities are exactly zero, but
0 * NaN is NaN in the PV MFMA, so a NaN in any such row (a recycled
block 0, a checkpoint image, a freed page) turned the whole output row
into NaN. Per-token V scales had the same hole through P * scale.

Only a sequence's last 256-token tile holds such rows. On that tile each
lane builds 64-bit byte masks from the context length once, and every
head chunk ANDs its V operands with them right before its PV, behind a
uniform branch, so full tiles run unchanged and the loads stay
pipelined. Per-token K/V scales at or past the context are staged as
zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

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 7092 --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.

@fsx950223

Copy link
Copy Markdown
Contributor

the pr reduce pa performance and framework should handle the issue

@fsx950223

Copy link
Copy Markdown
Contributor

Add a option to the api for enable zero V feature. There is a regression here

mask_unowned_kv (default True) keeps the boundary-tile V/scale masking
introduced in this PR. False compiles it out, restoring the previous
kernel and the caller contract that unowned V bytes and scales are
finite. The flag is part of the schedule cache key; gfx1250 ignores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zufayu
zufayu removed the request for review from yadaish October 29, 2026 10:16
@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 795de3024686 · 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

- **Before:** FlyDSL `pa_decode` reads KV rows no sequence owns on a sequence's last 256-token tile (padded block-table lanes pinned to block 0, and the unwritten tail of the last page). K is masked with `-inf`, but V and per-token K/V scales are not, so a NaN byte there turns the output row into NaN (`0 * NaN` in PV). The kernel pushed this onto callers ("unowned V bytes must remain finite"), and ATOM had to work around it in ROCm/ATOM#2635; without that workaround Qwen3.5-35B-A3B-FP8 scores 0.06 on GSM8K.
- **After (`e895c9c0`):** on gfx942/gfx950, the boundary tile ANDs V operands with per-lane byte masks right before each head chunk's PV, and per-token K/V scales at or past `context_len` are staged as 0. Full tiles are unchanged; clean-input output is bit-identical to main.
- **`795de302` (@fsx950223):** adds `mask_unowned_kv` (default `True` = the behavior above) to `pa_decode` / `compile_pa_decode_tile`. `False` compiles the masking out, restoring the previous kernel and the old caller contract. The flag is part of the schedule cache key. gfx1250 pipelines ignore it and still require finite unowned bytes.

Validation and unverified scope

Validated on gfx950 (MI35x), all on `e895c9c0` unless noted:

| what | result |
|---|---|
| `pytest op_tests/test_flydsl_pa_decode.py` | main `bbef5a6f` 124 passed; `e895c9c0` 196 passed (124 + 72 new) |
| new test file against main's kernel | 54 / 72 fail (all 36 NaN cases; the 18 passes are fp8 per-tensor "inf", whose e4m3 fill ±448 is finite) |
| `pytest op_tests/triton_tests/test_pa_decode_gluon.py` | 43 passed on main (gluon is not touched) |
| NaN/Inf/random-byte probe, 468 FlyDSL shapes | main 468 / 468 fail; `e895c9c0` 468 / 468 pass; zero-fill output bit-identical to main 468 / 468 |
| kernel time, 513 shapes, 3 alternating rounds vs main | geomean -0.58%, worst +5.0%, 16 shapes > +3% (tables above) |
| GSM8K 1319, Qwen3.5-35B-A3B-FP8 TP1, `ATOM_PA_FLYDSL=1`, ATOM main without ROCm/ATOM#2635 | aiter main 0.063; this PR 0.964 (same as ROCm/ATOM#2635 on aiter main, 0.964) |
| CI "Aiter Test" on `795de302` (MI35X, shard 2) | `op_tests/test_flydsl_pa_decode.py`: 196 passed, including the new `mask_unowned_kv=False` clean-input assertion |

Unverified:
- **After `795de302`, I did not re-run the probe, the kernel benchmark or the e2e runs**; all numbers above except the CI row are from `e895c9c0`. The default path is meant to compile to the same kernel, but that is not checked (no ISA diff or timing on `795de302`). The `mask_unowned_kv=False` path has no timing data from me, and its only coverage is the CI clean-input equality check.
- gfx1250 pipelines (no hardware; the new test skips there).
- `BUFFER_KV` (MTP4 fused with a KV cache > 2 GiB): same `mask_v_chunk`, but no test builds a cache that large.
- Gluon `pa_decode_gluon` has the same bug and is not changed here (see above).

PR-specific question

`test_pa_decode_unowned_kv_rows` fills every row no sequence owns (padded block-table lanes on block 0, the tail of each last page, and their per-token scales) with NaN or Inf, and asserts the output is finite and bit-identical to the zero-filled run. Before this PR it fails with non-finite output on all 36 NaN cases and on the bf16 / per-token-scale Inf cases (54 / 72). The existing canonical test `test_pa_decode` fills the whole KV cache, padding included, with finite values (`uniform_(-0.5, 0.5)` or fixed patterns), so unowned rows contribute `0 * finite = 0` and the bug cannot show up there; its only NaN use is pre-filling the output buffer to catch unwritten outputs. No other op test exercises FlyDSL `pa_decode` with non-finite KV. The `mask_unowned_kv=False` assertion (`795de302`) checks that the opt-out path still matches on clean input.

Changed op tests

| file | covers | why not redundant |
|---|---|---|
| `op_tests/test_flydsl_pa_decode.py` | new `test_pa_decode_unowned_kv_rows` (72 cases: fp8 per-tensor trans_v / plain V, fp8 per-token, bf16; page 16/64/128; 3 head configs incl. qlen 4; NaN / Inf fills; lengths {1, 17, 255, 257, 1000}, block 0 unowned, 2 padded table columns). Asserts unowned rows have no effect on output, and that `mask_unowned_kv=False` matches the default on clean input | existing `test_pa_decode` cases only use finite KV everywhere, so they cannot detect unowned rows leaking into PV; this is the only test of the NaN-in-unowned-rows contract and of the `mask_unowned_kv` flag. Existing tests are unchanged |

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.

@coderfeli
coderfeli merged commit 2db75fc into main Oct 30, 2026
57 checks passed
@coderfeli
coderfeli deleted the lingzha/pa-decode-mask-unowned-kv branch October 30, 2026 02:25
solinzby1 pushed a commit that referenced this pull request Nov 2, 2026
* [FlyDSL] pa_decode: zero V rows past the context before PV

Pages past a sequence are pinned to block 0 and the unwritten tail of its
last page is read as is. Their probabilities are exactly zero, but
0 * NaN is NaN in the PV MFMA, so a NaN in any such row (a recycled
block 0, a checkpoint image, a freed page) turned the whole output row
into NaN. Per-token V scales had the same hole through P * scale.

Only a sequence's last 256-token tile holds such rows. On that tile each
lane builds 64-bit byte masks from the context length once, and every
head chunk ANDs its V operands with them right before its PV, behind a
uniform branch, so full tiles run unchanged and the loads stay
pipelined. Per-token K/V scales at or past the context are staged as
zero.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [FlyDSL] pa_decode: add mask_unowned_kv option to toggle V masking

mask_unowned_kv (default True) keeps the boundary-tile V/scale masking
introduced in this PR. False compiles it out, restoring the previous
kernel and the caller contract that unowned V bytes and scales are
finite. The flag is part of the schedule cache key; gfx1250 ignores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: fsx950223 <fsx950223@outlook.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ZhiweiYan-96 pushed a commit that referenced this pull request Nov 2, 2026
…64 query rows)

MTP-3 verify at GQA 16 (Qwen3.5-397B at TP2: 16 query heads per KV head)
is 4 x 16 = 64 rows, one M-tile past the 48-row limit, so it fell back to
the generic multi-M-tile path. The pipe's tile body (single_query_tile /
pack_single) is written for any M_TILES, and the #7092 V-tail masks are
applied once per head chunk before the M loop; the M_TILES >= 4 V-scale
reload exists only in the generic pack_multi. Raise the limit to
4 * MFMA_MNK.

Tests: GQA16 q4 and GQA8 q7/q8 pipe cases (64 and 56 rows) with
page/tile-edge lengths, a GQA16 q4 np81 and one-hot-token case, the
row gate at QL4/6/8 x GQA8 and QL4 x GQA16 (on) vs QL9 x GQA8 and
QL5 x GQA16 (off), and a 64-row head-256 case in the unowned-KV test.
ZhiweiYan-96 pushed a commit that referenced this pull request Nov 2, 2026
…64 query rows)

MTP-3 verify at GQA 16 (Qwen3.5-397B at TP2: 16 query heads per KV head)
is 4 x 16 = 64 rows, one M-tile past the 48-row limit, so it fell back to
the generic multi-M-tile path. The pipe's tile body (single_query_tile /
pack_single) is written for any M_TILES, and the #7092 V-tail masks are
applied once per head chunk before the M loop; the M_TILES >= 4 V-scale
reload exists only in the generic pack_multi. Raise the limit to
4 * MFMA_MNK.

Tests: GQA16 q4 and GQA8 q7/q8 pipe cases (64 and 56 rows) with
page/tile-edge lengths, a GQA16 q4 np81 and one-hot-token case, the
row gate at QL4/6/8 x GQA8 and QL4 x GQA16 (on) vs QL9 x GQA8 and
QL5 x GQA16 (off), and a 64-row head-256 case in the unowned-KV test.
rebklee added a commit to rebklee/aiter that referenced this pull request Nov 3, 2026
Conflicts in traits.py, pa_decode_kernel.py and pa_decode.py: main's
ROCm#7092 added mask_unowned_kv where this PR adds causal (the select,
compile_pa_decode_tile and pa_decode signatures and the calls between
them). Kept both, mask_unowned_kv first; all are keyword-only. The
schedule cache key holds both, in the same order where it is built
and unpacked.

ROCm#7197 (peeled last KV tile) and ROCm#6767 (gfx1250-strict) also touch
these files and merged cleanly; neither needs a change for causal.

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants