Repository navigation
[FlyDSL] [gfx1250] DSv4.1 Flash 32x32 GEMMs: tune C1024 decode, prefetch a8w8/a4w4 compute kernel code - #7827
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
d39fa0c to
f6089a0
Compare
f6089a0 to
17608d9
Compare
NOT 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 |
There was a problem hiding this comment.
🟡 Changes recommended
All 13 new O-A compute rows select kernels rejected by the fused-quant path, causing ValueError instead of quantized output and requiring a fallback with regression coverage.
1 open issue
What changed in this PR
This PR tunes AITER’s gfx1250 DSv4.1 Flash 32×32-scale GEMMs for C1024 decode and adds instruction prefetching to reduce slowdowns when switching between compute kernels. It builds on #7659 and is intended to land after #7667.
Changes:
- Adds or updates 100 tuning rows across six dense and batched GEMMs.
- Enables scalar instruction prefetching at a8w8 compute-kernel entry.
- Adds alternating-kernel performance coverage alongside the stacked compute-path and scale-layout tests.
| File | Description |
|---|---|
op_tests/test_gemm_a8w8_blockscale.py |
Adds 32×32 weight-scale testing from the prerequisite stack. |
op_tests/test_flydsl_batched_gemm.py |
Adds compute cases, operand guards, and switch-penalty checks. |
aiter/ops/flydsl/mxfp8_bpreshuffle_gemm_gfx1250.py |
Supports batched compute dispatch, 32×32 scales, and cluster fallback. |
aiter/ops/flydsl/kernels/gemm_common_gfx1250.py |
Adds the instruction-prefetch helper. |
aiter/ops/flydsl/kernels/gemm_a8w8_256x256_gfx1250.py |
Calls prefetch at entry; includes stacked scale and batching support. |
aiter/ops/flydsl/batched_gemm_a8w8_gfx1250.py |
Routes compute kernel names through the dense compute runner. |
aiter/configs/model_configs/dsv41_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv |
Extends tuned batched O-A decode selections. |
aiter/configs/model_configs/dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv |
Extends tuned dense decode selections. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The switch tests can fail on gfx1250 when optional FlyDSL is absent, and they do not independently validate each kernel’s output against a reference, allowing incorrect finite results to pass.
2 open issues
1 resolved since last review
Review effort: Balanced
b91d1a1 to
8080371
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
ISA-level prefetch and MODE-register changes depend on compiler-generated labels and require hardware review, with no head-bound runtime validation for graph replay, gfx1250-strict, or a4w4 16-workgroup configurations.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
A launch preloads only the first ~32 KiB of a kernel into the instruction cache. The S1F tile-256 kernel (~46 KiB) and the stage-1 GEMM (up to ~62 KiB) ran their tails cold whenever another large kernel had evicted them, so UT gains did not always show up end to end. Add prefetch_kernel_code(num_waves) to gemm_common_gfx1250, following #7827: set MODE.SCALAR_PREFETCH_EN through llvm.amdgcn.s.setreg, find the kernel span with s_getpc_b64 and .Lfunc_end0, and have each wave issue every num_waves-th 4 KiB s_prefetch_inst chunk up to 56 KiB, without branches. S1F replaces its old inline-asm prefetch, which was a no-op without MODE[24]; the a8w4 TDM GEMM calls it at kernel entry and tags the kernel name with _ipf. AITER_FLYDSL_INST_PREFETCH=0 turns it off. Co-authored-by: Cursor <[email protected]>
8080371 to
7db7abc
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The gfx1250 prefetch prologue depends on compiler function ordering and hardware MODE behavior, requiring hardware review because no head-matched GPU correctness or performance validation was supplied.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The gfx1250 prologues depend on compiler function numbering and hardware prefetch behavior, requiring specialist review because head-matched GPU validation of graph replay, a4w4 16-workgroup clusters, and switch latency is unavailable.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The prefetch relies on gfx1250 cache behavior and assembler function ordering that require unavailable GPU validation, while 16-workgroup a4w4 execution and exact-head end-to-end behavior remain unverified.
1 open issue
Review effort: Balanced
A launch preloads only the first ~32 KiB of a kernel into the instruction cache. The S1F tile-256 kernel (~46 KiB) and the stage-1 GEMM (up to ~62 KiB) ran their tails cold whenever another large kernel had evicted them, so UT gains did not always show up end to end. Add prefetch_kernel_code(num_waves) to gemm_common_gfx1250, following #7827: set MODE.SCALAR_PREFETCH_EN through llvm.amdgcn.s.setreg, find the kernel span with s_getpc_b64 and .Lfunc_end0, and have each wave issue every num_waves-th 4 KiB s_prefetch_inst chunk up to 56 KiB, without branches. S1F replaces its old inline-asm prefetch, which was a no-op without MODE[24]; the a8w4 TDM GEMM calls it at kernel entry and tags the kernel name with _ipf. AITER_FLYDSL_INST_PREFETCH=0 turns it off. Co-authored-by: Cursor <[email protected]>
Conflicts resolved: - aot/flydsl README and gemm.py: take main's wording (compute kernel). - splitk_fused_epilogue_gfx1250: keep main's stripe_rows cap (rows past M can exceed 4 GiB per stripe) in the lean output descriptor, and keep the idle-row path (rows_per_iter > reduce_m) and the _store helper from this branch. Both branches removed bounded_m; the store branches are identical.
…j at decode M 928..1536 Two DSv4.1 dense MXFP8 (32x32 weight scale) shapes at the high-concurrency decode widths: - engram wkv (N=25600, K=6144): M 928 / 960 / 992 / 1024 move from the batched kernel to the 2-D compute kernel t256x256x128 nb2 cm4 cn1; M 1216, 1280, 1344, 1408, 1472, 1536 had no row (they used the M 2048 row) and get the same kernel. - DSpark main_proj (N=5120, K=15360): M 928 / 960 / 992 / 1024 move to the compute kernel t128x256x128 nb3 cm2 cn2; M 1088..1536 (step 64) had no row and get the same kernel. Rows were chosen from measurements inside the decode layer sequence (other large GEMMs before and after), not back-to-back runs of one kernel. Outputs are bit identical to the previous kernels. Prefill rows and other shapes are unchanged. The 32x32-scale compute kernel these rows name is already in main (ROCm#7659, ROCm#7827). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* [FlyDSL] [gfx1250] Absorb grouped MoE GEMM1 prefill opts into mega stage-1 (#7919) * Optimize FlyDSL grouped MoE kernels * improve test * support a preshuffle * add csv support * update quant and shuffle * update * update mega-moe * update * update csv * update * simplify code * fix accuracy drop * update csv * fix format * fix(flydsl): align A-preshuffle guards and AOT coverage * improve cs test * fix ruff * Tune conc16384 benchmark with WPT2 and cluster sync disabled * Add standalone conc16384 GEMM1 performance reproducer Rename the benchmark to reproduce.sh and pin the validated zero-input configuration. Include standalone activation/quantization dependencies and tests so the script does not rely on stashed implementation changes. Preserve unrelated work in stash. GPU timing was not rerun for this commit. * Tune grouped MoE LDS scheduling and prologue initialization Use normal WMMA order with operand B reuse and precomputed payload LDS bases. Initialize accumulators before the prologue TDM wait and select WPT1 for the conc16384 tuned configuration. Include the local benchmark scripts and the reproducer iteration update. * Pin FlyDSL WMMA scale registers to disjoint low VGPR slots * update * update * update * remove useless tests * add script * update script * update script and wheel * update * update1 * update * Fix LDS helper shadowing after GEMM task refactor * Simplify gfx1250 prefill scheduling and add reproducible MoE benchmarks * Keep local GPU benchmark scripts and microtests out of the branch * Restore LDS layout controls and decouple interleaving from scheduling * Fix strict VGPR pinning with FlyDSL 0.5.0 Resolve sched_vgpr through rocdl.experimental on FlyDSL 0.5.0 while retaining compatibility with the older public API. Keep strict placement enabled for prefill kernels. Validated DSV4 Pro conc16384 with three const/random runs at 32 iterations. Both GEMMs have zero scratch instructions and accumulator placement at physical v512-v1023; median const GEMM1/GEMM2 is 465.77/322.86 us. * update for ds flash v4.1 * Tune DSV4.1 Flash 8192 prefill configuration * update for release * add csv * update csv * update csv for dsr1 fused expert * Move DSR1 grouped MoE configs into a dedicated CSV * remove useless csv * update csv * [FlyDSL] Simplify prefill WMMA emission and barriers * Tune DSR1 65-expert (64 routed + 1 shared, topk 9) grouped MoE rows for 1-1024 tokens The single 16x256x256 four-wave as-prologue row left gemm1 at ~16 TB/s for decode-sized batches (three workgroup rounds, extra round at 4 tokens, and a 64-row tile that doubled weight reads at 1024 tokens). Re-swept tiles and knobs for this shape on gfx1250: narrower gemm1 tiles (tile_n 64/128) with deeper buffering for 1-32 tokens, as-prologue kept only at 64 and 256 tokens where it measures faster, and 128x256 tiles at 1024 tokens. gemm1+gemm2 vs the previous rows (test_flydsl_grouped_gemm, constant + uniform init): 1 tok 1.81x, 2 1.11x, 4 1.25x, 8-256 1.12-1.16x, 512 1.08x, 1024 1.38x; >= 2048 unchanged. * Simplify FlyDSL KSL0 fence configuration and kernel symbols * Merge PR #5899 (zxe/mega_stage1_compact_overlap) for local benchmarking Co-authored-by: Cursor <[email protected]> * mega: adapt S1F/GEMM2 to the MoE prefill path, tune DSV4.1 Flash EP4 buckets - Pin VGPRs only for the 2x2 256^3 tile; S1F's 1x4 256 variant overflowed the map. - S1F GEMM1 warp grid per tile_m (2x2 at 256, AITER_MEGA_S1F_WARPS override) and pass the GEMM kernel_attrs to the S1F launch. - DSV4.1 Flash E96 rows: GEMM2 next_stage_prefetch + lds_soa_load_interleave at 8192+, add the missing 131072 bucket (tpr 32768: 3783 -> 3258 us/layer). Co-authored-by: Cursor <[email protected]> * [FlyDSL] [gfx1250] Pack GEMM1 A inside mega stage-1 for large prefill buckets The stage-1 producer writes the M16 packed A layout, and the 256-row GEMM1 turns on a_preshuffle, lds_soa and next_stage_prefetch together with the grouped-MoE prefill schedule. This runs only when the recv bound is at least 65536, which for EP4 top-6 is tpr 16384 and 32768. Payload and scale use separate buffer resources so the masked store sentinel stays out of range. DSV4.1 Flash EP4, 8-layer graph: 1654 vs 1704 us/layer at tpr 16384 (-2.9%) and 3111 vs 3258 at tpr 32768 (-4.5%). Smaller buckets stay on the 128-tile path. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: yadaish <[email protected]> Co-authored-by: JiaoliangYu <[email protected]> Co-authored-by: lalala-sh <[email protected]> Co-authored-by: hyi <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: XingerZhu <[email protected]> * [FlyDSL] [gfx1250] Defer the mega GEMM2 EP-scatter wait; tune DSV4.1 EP4 buckets A persistent bf16 EP scatter now stages its rows in the last pipeline stage and skips the tensor_wait after the remote gather-store (defer_c_wait): the next tile's first fence retires it and the persistent loop drains at exit. It turns on by itself when the rows fit there (tile_m > 32, > 2 buffers, no planar LDS / A-scale prologue / k_waves); AITER_FLYDSL_EP_DEFER_C_WAIT=0 turns it off. DSV4.1-Flash EP4 a4w4 fp4-wire, mega S1F+S2F, uniform routing, 3x A/B: - tpr 512 (token 2048): persistent_workers2=512 -> GEMM2 57.6 -> 55.2 us, layer 217.0 -> 214.7 us (-1.1%). - tpr 1024 (token 4096): num_buffer_stage2=3 -> GEMM2 81.2 -> 78.9 us. Accuracy (layers=2) PASS at both with an unchanged logits_diff. Co-authored-by: Cursor <[email protected]> * [FlyDSL] [gfx1250] Skip pinned VGPRs when the prefill slot exceeds 128 dwords FP4 256x256 at 1x4 needs 160 dwords and asserts in make_rmem_slot. Gate the explicit map on the same slot width, so that shape stays on the ordinary allocator while 2x2 (128 dwords) keeps the pinned schedule. Co-authored-by: Cursor <[email protected]> * [FlyDSL] [gfx1250] Prefetch kernel code past the launch window A launch preloads only the first ~32 KiB of a kernel into the instruction cache. The S1F tile-256 kernel (~46 KiB) and the stage-1 GEMM (up to ~62 KiB) ran their tails cold whenever another large kernel had evicted them, so UT gains did not always show up end to end. Add prefetch_kernel_code(num_waves) to gemm_common_gfx1250, following #7827: set MODE.SCALAR_PREFETCH_EN through llvm.amdgcn.s.setreg, find the kernel span with s_getpc_b64 and .Lfunc_end0, and have each wave issue every num_waves-th 4 KiB s_prefetch_inst chunk up to 56 KiB, without branches. S1F replaces its old inline-asm prefetch, which was a no-op without MODE[24]; the a8w4 TDM GEMM calls it at kernel entry and tags the kernel name with _ipf. AITER_FLYDSL_INST_PREFETCH=0 turns it off. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Satya Nikhil Kodukula <[email protected]> Co-authored-by: yadaish <[email protected]> Co-authored-by: JiaoliangYu <[email protected]> Co-authored-by: lalala-sh <[email protected]> Co-authored-by: hyi <[email protected]> Co-authored-by: Cursor <[email protected]>
…j at decode M 928..1536 (#8048) Two DSv4.1 dense MXFP8 (32x32 weight scale) shapes at the high-concurrency decode widths: - engram wkv (N=25600, K=6144): M 928 / 960 / 992 / 1024 move from the batched kernel to the 2-D compute kernel t256x256x128 nb2 cm4 cn1; M 1216, 1280, 1344, 1408, 1472, 1536 had no row (they used the M 2048 row) and get the same kernel. - DSpark main_proj (N=5120, K=15360): M 928 / 960 / 992 / 1024 move to the compute kernel t128x256x128 nb3 cm2 cn2; M 1088..1536 (step 64) had no row and get the same kernel. Rows were chosen from measurements inside the decode layer sequence (other large GEMMs before and after), not back-to-back runs of one kernel. Outputs are bit identical to the previous kernels. Prefill rows and other shapes are unchanged. The 32x32-scale compute kernel these rows name is already in main (#7659, #7827). Co-authored-by: Claude Opus 5.5 <[email protected]>
…15808c7, head 2026-11-19T10:14:52Z) Applied as the diff ce334d0..15808c7 (26 files) onto the rebased 1116 tree; PR state: open, author aoli26, base main. Squash-applied: #8246's branch merges main (ce334d0, this tree's base) and carries rebased copies of aoli26's #7827 (head 9d38b5c, every added line present here) and #7868 (head 570805d; 3 of its added lines are superseded by #8246's later edits), so this one diff applies the #7827 -> #7868 -> #8246 stack as #8246 has it. (cherry picked from commit f58bb7e) Rebase onto main 12-03: kept at the 15808c7 snapshot (the PR head is now c4f8a6d, see the rebase report). Main's #8678 (AOT launchers) and #7449 (deferred split-K partials) conflict with it in the two wrappers: bpreshuffle_gemm_gfx1250.py takes both fused_splitk and main's partials (a launch with partials runs unfused, main's _launch_splitk_reduce / reduce_splitk_partials_gfx1250 kept, skipped when fused); mxfp8_bpreshuffle_gemm_gfx1250.py keeps fused_splitk_ok (generic kernel included) and launches gemm_a8w8_launcher.lazy() with this PR's argument layout (arg_out, runtime cluster_m, fused_splitk). Same as the PR author's own merge of main, without the later lean_stripe_fits guard. aiter/aot/flydsl/sources.py: the gemm_a8w8_gfx1250 cache now also hashes kernels/splitk_fused_epilogue_gfx1250.py, which the kernel imports (as on the PR head). Rebase onto main 12-03: op_tests/test_gemm_a8w8_mxfp8_bpreshuffle.py counts reduce launches through splitk_reduce_launcher.lazy (main #8678 replaced _compile_splitk_reduce), as on the PR head.


Summary
Tunes the DSv4.1 Flash 32x32 GEMMs on gfx1250 for C1024 decode (100 rows, six per-layer GEMMs), and makes the FlyDSL a8w8 and a4w4 compute kernels prefetch their own code at entry, so a compute kernel runs as fast right after another compute kernel as it does alone. Merge after #7659 and #7667 (see Dependencies).
Motivation
s_prefetch_instis a no-op while MODE.SCALAR_PREFETCH_EN is clear, which is how waves start once the program was preloaded on the WGP. bmm kernels (<= 25 KiB) are not affected.Changes
gemm_common_gfx1250.py:prefetch_kernel_codesets MODE.SCALAR_PREFETCH_EN and prefetches the kernel's code (up to 56 KiB) withs_prefetch_inst, split across the waves.func_indexis the kernel's position in its module, for its label and.Lfunc_end.gemm_a8w8_256x256_gfx1250.py,gemm_a4w4_256x256_gfx1250.py: call it at kernel entry. a4w4 launches up to three kernels per module (tail_mode 2, 0, -1), one call each; a8w8 uses index 0 and its code objects are unchanged.test_compute_switch_penaltyintest_flydsl_batched_gemm.py(a8w8) andtest_gemm_a4w4.py(a4w4, only with FlyDSL installed); each first checks both kernels against a reference.Performance (if applicable)
SQC_ICACHE_MISSESper dispatch, a8w8 repro / a4w4Solo times are unchanged (geomean a8w8 1.0004, a4w4 1.0003).
e2e (DSv4.1 Flash, e2e machine, paired alternating runs of base4 and the build with the a8w8 prefetch; measured before the rebase and the a4w4 change; 2 of 3 pairs per concurrency done). The gain is mainly from the instruction prefetch. Accuracy stays within 54.4-55.7.
c1024 is consistent across pairs (run-to-run spread 0.3-1.9%); c512 is within noise (+-1-2%) and needs the third pair (pair b's base overlapped with a CPU compile). TTFT p50 rises 6-11% at c1024 and is mixed at c512, probably queueing (not confirmed).
Testing
Documentation
Tuned-config rows and kernel prologues; no user-facing change.
Dependencies
Merge order: #7659, then #7667, then this PR; rebase afterwards.
6c05f98beb._fused_quant_tuned_kernel(the Copilot review point). 13 of the 17 O-A rows here and 3 in [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659 name a compute kernel, which has no fused quant epilogue, and [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667 passes a tuned name through as is, so the fused entry raisesValueErrorfor 95 M values with [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659 alone and 767 with this PR (81% of M 705..1536). Checked on CPU on [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659 + this PR + [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667's entry; with the skip it is 0, and the 15 non-compute O-A rows compile with the fused epilogue. The fix belongs in [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667, which also covers [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659's rows; the compute rows are then read only by the unfused entry._plkernel.Breaking Changes
None once the dependencies above are merged.
PR Self-Review
Reviewed revision
01043f3
Behavior and intent
Every a8w8 (mx32, mx128) and a4w4 FlyDSL compute kernel sets MODE.SCALAR_PREFETCH_EN and prefetches its own code at entry; output is unchanged. The previous head's in-model picks that worked around the slowdown (Q-B M=576/672 -> bmm
_pl, O-A M>=1024 -> bmm, shared down / O-B M=2048/3072 rows) are removed and not retuned here.Validation and unverified scope
All on gfx1250.
func_indexchange, the code objects, LLVM IR and ISA of 64 variants (61 compute) are identical to before (only the label name and source locations differ), and the switch ratio is unchanged (1.021-1.046 vs 1.028-1.059, 3 alternating runs each).6c05f98beb(one conflict, in the test file'smain()). The 100 rows added or changed here, at M and M-31, through the public entries withFLYDSL_RUNTIME_RUN_ONLY=1on an AOT cache: 200/200 pass (finite, mismatch 0 against a dequantized fp32 reference); the lookup returns the row's kernelName; the 13 batched compute rows pass [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659'sbatch > 1stride guard. AOT--checkpasses (388 dense + 57 batched rows) and fails on an empty cache. Runtime lookup of the six GEMMs over M 1..20000 vs [FlyDSL] [gfx1250] mxfp8 compute GEMM: 32x32 scale + bmm, DSv4.1 Flash tuning #7659's tables: the selected kernel changes only for M 577..1536 (4736 points)..Lfunc_end, with the same VGPR/SGPR/scratch (+0.3 KiB each). The 16 tuned compute rows with a cluster of at most 8 workgroups give identical output with and without the prefetch and 0 mismatch against the torch reference. The existingtest_gemm_a4w4.py(20 shapes, tuned and asm, off-grid M included) passes, and AOT--checkpasses on all 24 tuned compute rows. The 8 rows with a 16-workgroup cluster were only compiled.8080371): each switch test checks both kernels against a dequantized reference (output poisoned with NaN first) before timing. All pass: 2 a8w8 pairs (alternating / back to back 1.033-1.045) and 3 a4w4 pairs (0.93-1.06, two runs). The 5 batched compute cases still match with mismatch 0, and the fulltest_gemm_a4w4.py(138 shapes, tuned and asm, off-grid M included) has mismatch 0. With fake kernels on CPU, a kernel that writes finite wrong values, nothing, or a wrong batch fails the new check; the previous test passed all three.gfx1250-strict, where the compute cases and switch tests now also run (no hardware). a4w4 keeps a data-side cost of 1.1-1.2 at K=6144/7680/8192 with the prefetch (same instruction-cache misses as K=7168), so the new test uses other K.PR-specific question
Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
Keys, all gfx1250 / cu_num 256 / w_scale_block 32x32; dense in
dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csvas (N, K): M list, batched indsv41_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csvas (b, n, k): m list. All are new keys except those marked as replacing an existing row (8):Evidence: the CSV diff against #7659's head touches only these 100 keys and removes no row. Runtime lookup over M 1..20000, #7659's tables vs this branch's: the selected kernel changes only for M 577..1536 (Q-A/KV-A 769..800 and 897..1536; Q-B, O-B, shared gate/up and O-A 705..736 and 769..1536; shared down 577..608, 673..736 and 769..1536) and for no M outside it. The prefetch selects nothing.
Changed op tests
op_tests/test_flydsl_batched_gemm.py: addstest_compute_switch_penalty(two a8w8 wo_a pairs on compute kernels; alternating must stay within 1.10x of back to back). Not redundant: the compute cases time each kernel alone and cannot see a cost that only appears right after another compute kernel; it fails without the prefetch (1.37x). Each kernel's output is first checked against the dequantized reference, so a wrong but finite result fails too.op_tests/test_gemm_a4w4.py: addstest_compute_switch_penaltyfor a4w4 (K=7168, 3584, 7936, one per kernel of a launch; limit 1.15). It fails without the prefetch (1.5-2.2x); the existingtest_gemmtimes kernels one at a time. Each kernel's output is first checked against the torch reference, and the cases run only when FlyDSL is installed.