Repository navigation
[FlyDSL] [Feature] gfx1250 prefill index block scores over an NVFP4 key cache - #8458
XiaobingSuper wants to merge 17 commits into
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
…corer on the FP4 index cache (opt-in) ATOM_M3_INDEX_SCORE_FLYDSL_PREFILL=1 (default off). On gfx1250 with the FP4 index cache (--index-cache-dtype fp4), the prefill indexer's block scores come from aiter's index_score_prefill_nvfp4 (ROCm/aiter#8458) instead of the Triton _index_block_score_kernel. This applies to prefills of at least ATOM_M3_INDEX_SCORE_FLYDSL_MIN_ROWS rows (default 2048), where aiter's predicate serves the call. The scorer writes the same score tensor, which the selection then reads unchanged. Every dot is the same scaled WMMA, so the scores and the top-k are bit for bit the Triton kernel's; only the data movement differs (tensor-DMA pages, 16 B LDS operand reads). MI455X, one TP4 rank, 14336 new tokens on 99968 cached: 97 us against 172 (score + select + emit: 141 against 216). Short prefills (300 rows) run 2-4 us slower than Triton, hence the row bound. tests/test_minimax_m3_index_topk.py (CPU): the gate (flag, row bound, FP4 cache, aiter's predicate), and the FlyDSL scorer writing the score tensor the selection reads with the Triton kernel not launched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2a3de7d to
ca82d01
Compare
|
I brought this PR to merge standard and force-pushed the branch, which is now linear on main bf59948. The original commit is unchanged, and two commits are on top:
On gfx1250, the kept configs compile to byte-identical ISA before and after both commits. MI455X: this test 13 passed, |
…corer on the FP4 index cache With the FP4 index cache, a prefill of at least 2048 rows takes its block scores from aiter's index_score_prefill_nvfp4 (ROCm/aiter#8458) whenever aiter's predicate serves the call (gfx1250 and its shapes), instead of the Triton _index_block_score_kernel. The scorer writes the same score tensor, which the selection then reads unchanged. Every dot is the same scaled WMMA, so the scores and the top-k are bit for bit the Triton kernel's. MI455X, one TP4 rank, 14336 new tokens on 99968 cached: 97 us against 172 (score + select + emit: 141 against 216). Short prefills (300 rows) run 2-4 us slower than Triton, hence the row bound. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ca82d01 to
3e38182
Compare
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
9868c4a to
eb46d13
Compare
|
@lirui927 both items are fixed in 32309d6 and still hold at 07a98c3:
MI455X at 07a98c3: |
|
Added on top of this PR (one commit,
MI455X, 32K-row chunk, 4 index heads, top-16 identical to the reference, 0 wrong rows:
Short chunks (2K rows, or 50K context) stay on scorer + selector by the preference (319 -> 273 us and 474 -> 401 us there with the new scorer options). Host: the fused build's gfx1250 ISA is instruction for instruction the build validated on MI455X; 8 scorer / fused builds compile; ruff 0.16 + black clean. |
…e NVFP4 index cache aiter.ops.flydsl.index_score_prefill.index_score_prefill_nvfp4: the MiniMax-M3 prefill indexer's block scores on gfx1250. The index cache is the NVFP4 one: e2m1 payload [pages, 128, 64] plus an E4M3 scale per 16 values [pages, 128, 8], each with its own page stride. score[h, r, blk] is the max, over the block's keys at or before row r's position, of e4m3(clamp(q)) . dequant(K), times sm_scale * log2(e). It is written exactly where and how the Triton prefill scorer writes it. Every dot is the 128-deep scaled WMMA (_wmma_scale16, a copy of the pa_decode NVFP4 pipeline's helper until that pipeline lands on main). Pages arrive by tensor DMA into an LDS ring (`ring` pages in flight), and operands are read from LDS 16 B at a time. A CTA scores block_q rows (`waves` waves). With lds_scores, each row's chunk of at most CHUNK_MAX blocks goes out in one coalesced store. index_score_prefill_nvfp4_supported() accepts gfx1250 and the cache shapes above only. MI455X, MiniMax-M3.1 TP4 rank, 14336 new tokens on 99968 cached: 97 us against 172 us for the Triton scorer (score + select + emit 141 vs 216 us), the scores bit for bit the Triton scorer's. Short prefills (300 rows) are 2-4 us slower, so callers use it from about 2048 rows. op_tests/test_flydsl_index_score_prefill_nvfp4.py checks it against an FP32 torch reference (about 2e-3 relative: the WMMA's internal sum is not FP32-exact), for ragged batches, chunked prefixes and two CTA shapes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…I entry - Bind page_max's per-page inputs (base, unit, blk) as arguments instead of closing over loop variables (ruff B023), drop an unused noqa (RUF100) and the debug-only store probe. The gfx1250 ISA of all four compiled configurations is byte-identical to before. - Take PAGE, HEAD_DIM, LOG2E and the NVFP4 row sizes from the MiniMax-M3 index scorer module instead of restating them. - The wrapper passes every tensor as a bare pointer, so it now raises ValueError unless index_score_prefill_nvfp4_supported holds (which also checks 16-byte aligned cache views), every tensor is on idx_q's device, the four metadata tensors are int32 and score is [heads, >= total_q, *] fp32. An int64 seq_lens used to be read as int32 pairs. Host cost: +2.8 us a call. - Test the wrapper's default shape and the direct-store path, add a rejection case, and give the file a __main__ so CI's `python3 <file>` runs it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… score store The scores always go out through LDS in coalesced row chunks; the lds_scores=False path (one 4-byte global store per block and row) is gone with its wrapper argument. It was never faster: MI455X, one head, median of 20 x 50 launches, LDS-staged against direct stores (chunk 32 / 128): 14336 new rows on 99968 cached: 93.7 us vs 128.5 / 139.6 us 300 rows on 99968 cached: 30.6 us vs 31.3 / 109.1 us 2048 rows on 30000 cached: 30.4 us vs 29.9 / 108.7 us 300 rows, no prefix: 16.3 us vs 16.2 / 16.2 us (host bound) The kept kernels compile to the same gfx1250 ISA as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, bound the score stride - Q is loaded inside the CTA's live branch. A dead CTA of an empty request that ends the batch used to form a row address at idx_q's end; the compiled kernel had already sunk the loads past the exit branch, so this makes the source say what the ISA did. Same VGPR/SGPR counts, no scratch, same load and WMMA counts; only scheduling differs. - The wrapper rejects a score whose per-head stride exceeds int32, the kernel's stride argument type. That is 8 GiB of scores per head, so a host check is cheaper than 64-bit stride arguments and costs nothing in the kernel. - The ragged op-test case ends on an empty request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…atch extents and wave count The wrapper hands the kernel bare pointers, and three inputs it accepted were read wrongly without an error: - scale of any dtype with a [pages, 128, 8] shape (FP32 scales were read as E4M3 bytes): the supported check now takes uint8 or float8_e4m3fn; - seq_lens, prefix_lens or block_table shorter than the batch cu_seqlens_q describes (read past their end); - waves=1: wave 0 copies a page's payload and wave 1 its scales, so a one-wave CTA scored against scales nobody loaded. chunk_blocks < 1 and a non-positive or non-finite sm_scale are refused too: the kernel takes the block max before the scale, which equals Triton's scale-then-max for a positive scale only. The docstring names what only the device can see and so stays the caller's to guarantee (cu_seqlens_q, max_query_len, block_table and score covering each request's blocks), and says block_q-row tile where it said 256-row. Host-side only: the gfx1250 ISA of the three tested configurations is byte-identical to the previous commit's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… score The op test could pass with the scorer broken, and could fail with it right: - one index head only: dropping the head from the Q or the score address passed 13/13; - |Q| below ~12: removing the +-448 clamp passed 13/13; - only the causally valid scores were compared: the -inf of masked blocks and the entries the scorer must leave alone were not; - torch.randperm was unseeded, so the pages differed from run to run, and the tolerance was relative to max(|ref|, 1e-3), which is tightest where a score happens to be near zero. Now the reference is the whole score tensor (NaN where nothing may be written, -inf where the block is past the row), for 1-3 heads, with requests that are empty first and last, a tile boundary inside a page, the cache as two tensors or as views of one [pages, 9216] page array, and a 128-row / 2-wave / 2-page-ring CTA next to the 256-row ones. Two kinds of Q. One-hot rows (values past +-448, +-inf, and one that is not E4M3) make each dot a single product, which the scaled WMMA returns exactly: those scores must be bitwise the reference's. Dense rows keep a tolerance, now absolute plus relative (2e-3 + 1e-4 |ref|; the WMMA's 128-term sum was within 5.3e-4 of FP32's on MI455X for scores up to 27). The reject case adds an FP32 scale, a short prefix_lens and waves=1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… test - index_score_prefill_nvfp4_supported takes the op's first nine arguments and is the only place the inputs are checked; the op raises ValueError when it is False. It keeps what the kernel assumes of the bare pointers and int32 strides: gfx1250; bf16 Q with a contiguous 128-dim; both cache views as 1-byte [pages, 128, row] with contiguous, 16 B aligned pages (one tensor DMA a page); every tensor on Q's device; int32 metadata with a unit inner stride (now also for the three length vectors), covering the batch; an fp32 [heads, >= total_q, *] score with a unit block stride and int32 strides; a positive finite scale. chunk_blocks is a work split, so it is clamped to [1, CHUNK_MAX] instead of checked. - The op, the kernel and the CHUNK_MAX comment describe what is computed instead of naming a model, an inference engine or its Triton kernel. The kernel's code is unchanged (same AST without docstrings). - One op test against the FP32 torch reference (three request layouts, one-hot rows bitwise and dense rows within the WMMA tolerance, the wrapper default config). The reference runs on the CPU, so the test launches no GPU GEMM of its own. Drops the block_q/waves/ring variant sweep and the input validation and mocked gate tests; the GPU cases call the op, so they go through the check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ck selection `index_topk_prefill_nvfp4`: the prefill scorer and ATOM's top-16 block selection in one launch. Each workgroup keeps every row's 16 best blocks of its chunk as a list in LDS (the scores never reach memory) and writes them as ATOM's `_pack_score_key` keys; a row's chunks share a floor so blocks under it are not tried. ATOM's merge then picks the row's 16: the same selection as the scorer + Triton selector, index for index. Also on the scorer (same scores): `fold_max` (the 8 values of a WMMA folded straight into the running max, v_max3 only) and `pad_lds` (key rows 80 bytes apart in LDS: no 4-way bank conflict on the A-operand loads); on the fused op `sel32` (the selection pass on 32-bit compares). The fused op defaults to the fastest build measured (fold_max, pad_lds, sel32, ring 3, chunk from the grid: `index_topk_prefill_chunk_blocks`). `index_topk_prefill_nvfp4_preferred` says where it beats the two launches (>= 8192 rows and >= 1024 blocks). MI455X, 32K-row chunk, 4 index heads, against the scorer + ATOM's Triton selector, top-16 identical, 0 wrong rows: 384K 4007 -> 2394 us, 600K 6584 -> 4025 us, 8K rows x 600K 1612 -> 1117 us. The fused build's gfx1250 ISA is instruction for instruction the GPU-validated one of the M3.1 image branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ds write A build with a smaller block_q writes the -inf blocks past a row's own only up to its own tile's last row, so its NaN pattern differs from the default build's for every request longer than one tile (ends_empty and paged_3h with block_q=128 failed). Compare where the scores are finite and every entry the option build writes instead; the scores themselves are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
81312a4 to
0955ffa
Compare
|
Rebased onto main (head @lirui927 your commits are kept as they were (authorship included). One test fix on top: For ATOM: |
… device Both launches run under `with torch.cuda.device(dev)`, as the gfx950 prefill scorer and the other device-keyed launchers do, so a call with tensors on a non-current GPU compiles and launches on that GPU. The fused top-16 docstring now states that the output is not initialised and the caller masks a row's chunks past ceil(blocks / chunk_blocks) before taking its 16 largest keys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
review-pr scan (aiter's Fixed in review-pr cardaiter PR #8458 — [FlyDSL] [Feature] gfx1250 prefill index block scores over an NVFP4 key cacheAdds a new gfx1250-only FlyDSL op that computes causal prefill index block scores over an NVFP4 key cache with scaled WMMA, plus a fused variant that keeps each row's top-16 blocks in LDS instead of writing the scores. Review (advisory):
|
…lpers with the decode indexer The scaled WMMA, the E8M0 scale operand, the selection pins and sm_scale_log2e come from kernels/index_nvfp4_gfx1250.py, added here byte-identical to ROCm#8817 together with index_nvfp4.py (the host side); the copy of pa_decode's `_wmma_scale16` and the duplicate E4M3_MAX go. The two ops' launch blocks become one `_launch`; the builder returns the launcher; the stale `_lds32` name suffix goes. Every build is byte-identical to 26e57d0 (whole gfx1250 code object, kernel name normalised): the scorer (256/4/4 and 128/2/2 fold_max pad_lds) and the fused build at pins (0,1), (2,3), (0,0), plain and 512x8; the launch arguments are unchanged. Not run on a GPU. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…kernel, complete the input check Needs a GPU run: the kernel takes one more argument and 64-bit score strides, and the launch goes through the shared helper. - The kernel clamps a request's blocks to a new `max_block` argument: what the score (or the fused op's `max_block`) and a block-table row both hold. A `seq_lens` longer than those no longer reads the table or writes a score row past its end. - `_inputs_supported` is the shared cache predicate (new: payload and scale have the same page count, ranks checked first) plus the scale view's 16 B alignment, the int32 metadata with their ranks (block_table 2-D, the three others 1-D, cu_seqlens_q not empty) and one int32 bound for the int32 strides and the table index. - The score / key strides are 64-bit kernel arguments, so the `max(score.stride()) < 2**31` refusal goes. - The scorer returns for no blocks or `max_query_len <= 0`; `chunk_blocks < 1` raises in both ops (the scorer still clamps to CHUNK_MAX); `sm_scale_log2e` is evaluated once a call. - Launch through the shared `launch` (`current_stream_arg`). ISA against 26e57d0: kernarg 104 -> 116 B, one more `s_min_i32`, the strides' sign extensions go (scorer 4653 -> 4462 instructions, fused 3430 -> 3438); LDS and VGPR counts unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…lock bound and the layout Test (251 -> 247 lines): - the scorer writes into a strided, over-long view of a NaN buffer with a guard row and guard columns, and reads a strided idx_q; - one cell where the score and the block table hold fewer blocks than a request has (views, so nothing is out of bounds): nothing past them is written; - one cell on a second device when there is one; - one small check that four bad inputs are refused before anything is compiled (arch faked, so it runs on any GPU); - `-c` selects the top-k cases too, a `gfx` column. The build-option cases go (`_opts`, TOPK_OPTS): the fused test keeps a `chunk_blocks` pair (default and 64). Kernel: comments at the raw readfirstlane and at `_Lds`. ISA unchanged. Not run on a GPU. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… the op and its kernel As main's other MiniMax-M3 index FlyDSL files and the two shared files carry. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…early return for the fused op The fused op's block bound is stated once, in the predicate it and its _supported share, and refuses a negative max_block (ValueError). It returns without a launch in the scorer's cases, max_query_len <= 0 included. The query's head offset is computed in 64 bits, as the rest of the address. The scale alignment comment says what was measured. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Faster on every measured shape on MI455X (e.g. 14336:99968 315 -> 265 us), same scores. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…are the NVFP4 index helpers Remove what no caller reaches: the scorer's per-request plan (`flat`, the 2-D grid, `decode_score_programs`, the 64-block window), its `ring` parameter (RING = 4), the op's `workgroups`, the selector's one-wave build (`waves`), and the builders' unread "kernel" entry (they return the launcher). What the decode and the prefill index kernels share moves to two files that are byte-identical in ROCm#8458: kernels/index_nvfp4_gfx1250.py (the scaled WMMA, the E8M0 scale operand, the pins, sm_scale_log2e) and index_nvfp4.py (the cache predicate, the int32 metadata rule, the launch). Every build the ops launch is byte-identical to ddc4c43 (whole gfx1250 code object, kernel name normalised): the scorer at h4q8 / h4q1 / h1q8 / h5q3 and the selector at 11 (width, top-k, emit) builds. Not run on a GPU. Co-Authored-By: Claude Fable 5.2 <[email protected]>
No caller passes block_q / waves / ring / fold_max / pad_lds / sel32, and the defaults are the builds measured fastest on MI455X. The scorer and the fused top-k op now build one kernel each (256 rows over 4 waves; ring 4 and 3), the constexpr branches of the other values are gone, and index_topk_prefill_chunk_blocks takes no launch keywords. The gfx1250 ISA of the scorer and of the fused build is unchanged (kernel names aside, which no longer carry the options). Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
review-pr scan (aiter's
review-pr cardROCm/aiter PR #8458 — [FlyDSL] [Feature] gfx1250 prefill index block scores over an NVFP4 key cacheAdds gfx1250-only FlyDSL ops that score prefill index queries against an NVFP4 key cache block by block with the scaled WMMA, plus a fused build of the same kernel that keeps each row's 16 best blocks per chunk in LDS and returns selection keys instead of scores. Review (advisory):
|
What
New gfx1250 FlyDSL ops in
aiter.ops.flydsl.index_score_prefill, with one new kernel: causal block scores of prefill index queries over an NVFP4 key cache, and the same scorer fused with the top-16 block selection.index_score_prefill_nvfp4,index_score_prefill_nvfp4_supported;index_topk_prefill_nvfp4,index_topk_prefill_nvfp4_supported,index_topk_prefill_nvfp4_preferred,index_topk_prefill_chunk_blocks.[pages, 128, 64]and one E4M3 scale per 16 values[pages, 128, 8](for example, views of one[pages, 9216]page array).rof requestb, index headhand 128-key blockblkofb's pages,score[h, r, blk]is the max over the block's keys at or beforer's position ofe4m3(clamp(q, +-448)) . dequant(K), timessm_scale * log2(e)(multiplied in FP32). It is-inffor a block past the row's own. It is written for the blocks up to the block of the last row ofr's 256-row tile, at most those thatscoreand ablock_tablerow both hold, into an fp32[heads, >= total_q, max_block]tensor.v_wmma_scale16_f32_16x16x128_f8f6f4on the raw e2m1 rows and their scales (wmma_scale16), so K is never widened. Pages arrive by tensor DMA into an LDS ring (wave 0 copies the payload, wave 1 the scales). A CTA scores 256 rows (4 waves) over at most 32 blocks; its scores are staged in LDS and leave as one coalesced store per row chunk. There is one scorer build (ring of 4 pages) and one fused build per pin pair (ring of 3); the tuning keywordsblock_q / waves / ring / fold_max / pad_lds / sel32and**_launchare removed, with the value-by-value max and the padded LDS rows always on (see Performance).max_blockand clamps every request's blocks to it; the score strides are 64-bit kernel arguments, so themax(score.stride()) < 2**31refusal is gone.index_score_prefill_nvfp4_supported(...)takes the op's first nine arguments; the op raisesValueErrorwhen it is False orchunk_blocks < 1. It holds what the kernel assumes of its bare pointers and int32 strides: arch, dtypes, ranks, page layout and 16 B alignment, the same page count for payload and scale, one device, a non-emptycu_seqlens_q, metadata and score extents, a positive finite scale.chunk_blocksabove 32 is clamped. A call with nothing to score (no rows, no request, no block,max_query_len <= 0) returns without a launch.index_topk_prefill_nvfp4runs the same scorer and keeps each row's 16 best blocks of its chunk in LDS, so the scores never reach memory. It returns[heads, total_q, chunks * 16]int64 keys, unordered, 0 for no block; a row's later chunks are not written, so the caller masks them.index_topk_prefill_nvfp4_supported(...)takes its first ten arguments (noscore, plustopkandmax_block) and addstopk == 16and0 <= max_block <= 0xFFFF.cu_seqlens_qends attotal_q,max_query_lencovers every request, and the page ids ofblock_tableare inside the cache.aiter/ops/flydsl/index_nvfp4.py(the cache predicate, the int32 metadata rule, the launch) andkernels/index_nvfp4_gfx1250.py(wmma_scale16, the scale helpers) are added byte-identical by this PR and by [FlyDSL] gfx1250 MiniMax-M3 decode indexer over the NVFP4 index cache: flat-plan scorer + top-k #8817 (the decode indexer). Neither PR depends on the other; whichever merges second rebases onto them.Performance
MI455X, one GPU, FlyDSL 0.5.3. No baseline on main: the PR adds the op.
Scorer builds, 4 index heads, at 587be47 (the last revision that had the keywords): median of 9 interleaved rounds, us, identical scores in all three builds.
Fold + pad is never slower than the old default and the two geometries are within 3% of each other on the three long shapes, so 256/4/4 with fold + pad is the only build and the keywords are gone.
Op test timing rows (
uscolumn, same command as below) at 08332a5, whose builds are the head's (see Self-Review):The scorer and fused columns use different batches of the same name (1 and 4 index heads), so they are not a comparison of the two ops.
Why a new op and not a gfx1250 backend of
score_prefill_flydsl_nvfp4Main's
score_prefill_flydsl_nvfp4is gfx950-only (MFMA, gfx950 geometry and arch gate). Itsk_round="exact"mode computes the same dot, but the contracts differ: its defaultk_round="e4m3"rounds K to e4m3, which the scaled WMMA on raw e2m1 cannot reproduce; it needs anoutof exactly[heads, total_q, ceil(max_seq_len / 128)]pre-filled with-infand writes only the causal window, where this op writes the-infblocks of each tile itself; it roundssm_scale * LOG2Efrom double, this op multiplies in FP32; and it chooses its own chunking frommax_seq_len. The fused op also returns selection keys per chunk, a contractscore_prefill_flydsl_nvfp4has no counterpart for. A gfx1250 branch ofscore_prefill_flydslfork_round="exact"with bf16 Q could call this kernel with an-inf-filledout, once one scale rounding is chosen. That can be a follow-up; this PR adds the kernel and its own entry points only.Review answers
_gptr/_Lds: the kernel borrows five pa_decode LDS and tensor-DMA accessors (pointer,load,store,fp8,tdm_copy) through a subclass that sets only what they read. Moving them to a shared helper is a pa_decode refactor and is left out of this PR.Dependencies
None; based on main. See "Shared helpers" for the two files in common with #8817.
PR Self-Review
Reviewed revision
ec0bb5e
Behavior and intent
aiter/ops/flydsl/index_score_prefill.py), the gfx1250 kernel they launch, and two shared helper files: causal prefill block scores of index queries over an NVFP4 key cache, with the scaled WMMA reading the e2m1 payload and its E4M3 scales directly, and the same scorer fused with the top-16 selection.Validation and unverified scope
python3 op_tests/test_flydsl_index_score_prefill_nvfp4.pyexits 0 in all three. 7 scorer cells (3 one-hot bit for bit, 4 dense within2e-3 + 1e-4 |ref|, one of them with the score and the table narrower than a request; 0 mismatches) and 16 fused top-16 cells (4 batches x 3 pin pairs and a chunk of 64) equal to the Triton selection of the scorer's scores. The test file is the same at this head.ValueErrorbefore any build is compiled; 7 inputs that must be served are (4 launch, 3 return without a launch).ruff check --no-cache(0.16.0) andblack --check(26.10.1) clean on the five files of this PR. The two shared files are byte-identical to those at [FlyDSL] gfx1250 MiniMax-M3 decode indexer over the NVFP4 index cache: flat-plan scorer + top-k #8817's head 123e5f0.index_topk_prefill_nvfp4_preferredcome from an earlier revision and were not re-measured; a scale page stride of 8 mod 16.PR-specific question
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
op_tests/test_flydsl_index_score_prefill_nvfp4.py: before this PR the ops do not exist, so on gfx1250 the test fails atfrom aiter.ops.flydsl.index_score_prefill import index_score_prefill_nvfp4. No existing test covers them:test_flydsl_minimax_m3_index_score.pyandtest_flydsl_minimax_m3_index_score_prefill_fp4.pytest the gfx950 MFMA scorers, which do not run on gfx1250.Changed op tests
op_tests/test_flydsl_index_score_prefill_nvfp4.py(new, 247 lines)idx_q, so an entry it must not write has to stay NaN and a masked block has to be-inf. One-hot Q rows (values past +-448, +-inf, and one that is not E4M3) make each dot one product, which the WMMA returns exactly, so they must match bit for bit; dense rows must be within2e-3 + 1e-4 |ref|. Cases: one request; a ragged batch that ends on an empty request, also with a score and table narrower than a request; 3 index heads over views of one[pages, 9216]page array; one cell on a second device when there is one. The fused op's 16 largest keys per row must equal, in order, the Triton top-16 of the scorer's scores (ties and zero rows included). A refusal check with the arch faked runs on any GPU: four bad inputs must raise before a launch.