Repository navigation
[OPUS] [JIT] [Build] opus bf16 gemm co integration - #4903
Merged
Merged
Conversation
The 4wave_compute pipeline needs __builtin_amdgcn_pin_vgpr, amdgpu_num_vgpr and -mllvm -amdgpu-expert-scheduling-mode. A release ROCm toolchain has none of them, and aiter's hip_flag_checker SILENTLY DROPS flags the compiler rejects -- so a JIT build would not fail, it would quietly produce a differently-scheduled kernel. Only the device compile is bypassed: the kernel is built ahead of time into gen_co/<arch>/*.co and loaded at runtime, while the host launcher, manifest, tune lookup, dispatch and CSV schema all come from the ordinary codegen. Moving the family back to JIT later is a branch in codegen/gen_instances_gfx1250.py. gen_co/co_kernels.json is the single source of truth: opus_gemm_common.py turns it into the kid table that drives codegen, and build_co.py re-reads it to produce the images, so the .co filename, its extern "C" symbol and the launcher symbol are one string by construction. Two pipelines. The reference one is a verbatim port of the standalone kernel (128x256x128 only). The _wl_ one generalises it: the wave layout (4x1 / 2x2 / 1x4) is a template parameter, the msb split is derived rather than fixed at 4, the pin bases follow the accumulator block instead of sitting at a constant, and the macro register lists are templates so their length can follow the tile. Layout turns out to be a real per-shape tuning axis, not just a small-tile enabler: on 128x256 it swings -3.9% to +11.4% by shape. Tuning: candidate_kids_for_shape / kid_rejects_shape / candidate_splitK in opus_gemm_tune.py learn about the family, so gemm_a16w16_tune.py --libtype opus picks it up. On the PR #4749 M=2048 K=7168 slice it wins 4 of 6 N values, up to 2039 TFlops at N=32320. 143 variants ship, each verified for numerics, out-of-bounds writes, zero spills and 100% pin retention. Three known defects are written up with reproducers in gen_co/KNOWN_ISSUES.md; two are blocked by static_assert and the third (a race at B_N <= 128 on large shapes, present in the reference pipeline too) is handled by leaving the 60 affected variants out of the table. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Any variant whose A/B LDS segments fit twice in the 320 KB budget (<= 160 KB) let a second workgroup co-reside on a CU, which oversubscribes the per-CU TDM request budget. The result was non-deterministic wrong output at large grids: same seed and data, the wrong-element count changed every run, including runs that came out clean. The predicate separated the population exactly -- of 203 variants, every one at LDS <= 160 KB raced and every one above it was clean (50/50 at B_N=64, 10/51 at B_N=128, 0/51 at B_N>=192). Both pipelines were affected, reference included, so this predates the wave-layout work rather than coming from it. Pad LDS_BYTES past 160 KB when the real footprint is below it, the same trick opus_cluster_tdm_splitk_ws_traits_gfx1250 already uses in this header for the same reason; the pad tail is never accessed. build_co.py mirrors the formula host-side and had to learn about the pad -- its group_segment_fixed_size == traits check is what caught the drift instead of shipping it. The 60 variants dropped in the previous commit are restored: 143 -> 204, all verified over 9 shapes x 2 repeats covering large grids, N < B_N / M < B_M, and M/N/K tails, with sentinel checks for out-of-bounds writes. Zero spills, zero lost pins. Two things that made this hard to see are written up in gen_co/KNOWN_ISSUES.md: a tolerance check is a poor detector when the tolerance is the unknown (an outlier comparison across kids, which all compute identical math, found it), and a clean standalone replay proves nothing about a race. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The previous message asserted the mechanism -- "oversubscribes the per-CU TDM request budget" -- which was borrowed from the split-K pipeline's comments and never measured for this one. What the data supports is narrower and now written down as such. VGPR and LDS both scale with the tile, so the raw LDS<=160KB correlation cannot separate them; the population contains the control that can. 71 variants whose registers would admit two waves per SIMD but whose LDS does not are all correct, against 61 where both admit two and all are wrong. Those two groups differ only in the LDS-driven occupancy, so the variable is workgroups-per-CU. Why 2 WG/CU breaks it stays open, with the candidates and the experiment that would separate them recorded. The fix rests on "correct at 1 WG/CU", which the control establishes, not on the mechanism. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Occupancy cannot by itself break a correct kernel, so the natural reading of the previous commit was that 2 WG/CU merely exposes a latent sync hole. It does not. With the LDS pad disabled so the kernel really runs at 2 WG/CU, neither skipping the -3 cluster barrier when the cluster is 1x1, nor draining every outstanding TDM and LDS read and taking a full s_barrier() before every single tile, changes the failure at all -- the wrong-element counts stay in the same range and stay non-deterministic. No ordering fix inside the workgroup closes it, so the fault is not between this workgroup's own waves. What remains is something shared per CU and not covered by barriers. The leading suspect, recorded as a hypothesis rather than a finding, is the LDS address in the TDM descriptor: it is workgroup-relative, and if the TDM engine does not add the workgroup's LDS base then a second co-resident workgroup aims its transfers into the first one's LDS -- immune to barriers, corrupting both, and vanishing at 1 WG/CU where the base is zero. Confirming it needs an ATT capture or the TDM ISA description. No functional change: the debug switches used for these experiments are removed and the padded build is re-verified. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Cursor <[email protected]>
The gfx1250 _ws split-K families declared an fp32 partial in the traits (D_C) and then wrote a bf16 one, because the pipeline took its element type from a build-wide OPUS_WS_BF16 macro instead of the traits. The reduce, the explicit instantiations and the host allocator each carried their own copy of that assumption, so -DOPUS_WS_BF16=0 moved only some of them and produced NaN. D_C is what the traits already documented the slot as, so let it be the one source: the pipeline stores Traits::DataC, the reduce is instantiated with the same D_C, the dispatch table and the explicit instantiations use the kid's splitk_workspace_dtype, and the host sizes the buffer from the same field. Both partial widths are instantiated since the choice is now per instance. The generated launcher checks workspace.element_size() against sizeof(D_C): a .so stale with respect to the kid table used to be a GPU page fault with nothing pointing at the cause. Default is bf16. It clears the gate the tuner actually applies -- at rtol=atol=5e-2 for a bf16 output, err_ratio is 0.004-0.012 against a 0.05 line, flat from split_k=1 to 16 -- at half the workspace and half the reduce's read traffic. Candidate selection drops fp32-partial kids unless OPUS_TUNE_FP32_WS=1, and the 4 GiB workspace cap now measures in the kid's own element width rather than assuming 4 bytes. Two things that only bite during a sweep: _get_opus_workspace was @functools.cache'd, pinning one buffer per (device, shape, dtype) for the process lifetime. Bounded for inference, which sees a handful of shapes; the tuner walks every (tile padding x split_k) pair, which is 1065 distinct buffers totalling 450 GiB on a 432 GiB part. Nothing needs them to outlive the call. BF16WS_EXACT_REDUCE_SHAPES is a gfx942 whitelist of N values, all powers of two, gated only on "uses a bf16 workspace". That was equivalent to "is a gfx942 kid" only while the gfx1250 kids declared fp32, so flipping the default subjected them to it and erased the whole _ws family at N=384 / 32320 / 129280. Scoped to the family it was written for. Co-authored-by: Cursor <[email protected]>
Two structural bugs in the 4wave pipelines, both of which the earlier 1-WG/CU LDS pad only hid: A step refills the slot it is reading -- slot g%P is consumed by step g and reloaded at its end for step g+P -- so the handshake carries a write-after-read as well as the fill it was written for. That needs the reads retired, not merely issued: a barrier orders waves, not their in-flight LDS traffic. Drain with s_wait_dscnt(0) before the handshake, and arrive-and-wait as one s_barrier: split across kBarrierAhead WMMAs, a wave that is ahead could signal for the next step into this step's count. A step past the last is not a no-op transfer. Measured on gfx1250, one whose origin is at or past either extent zero-fills its whole tile in LDS, and C stages in a slot one of those is aimed at. The tensorcnt drain has to happen before the staging rather than after the peeled step. .co artifacts rebuilt for all 204 variants. build_co.py can now append -DOPUS_CO_NO_1WG_PAD through --device-flag with _expected_lds following suit, so the pad can be measured off without editing the table. Tuning: the candidate filter nominates .co kids (top-N tiles by grid-occupancy fit x top-N cluster dims, no split-K to minimise over), and kid_rejects_shape answers both .co tags rather than only a16w16_4wave_co. The wl variant used to fall through to the gfx942 bf16-workspace whitelist, which rejected all 140 of its kids at any N outside that table -- invisibly, since a candidate that was never nominated reads the same as one that lost. At M=256 N=384 that left 6 of 106 candidates, all one tile and no split-K, which looked like a fixed ~25us floor; with the family restored the same shape tunes to 7.0us. dsv4_bf16_tuned_gemm.csv carries the re-tuned winners for the 84 M>=256 DSV4 shapes, opus vs triton measured in one session. opus takes 72 of them, 45 on 4wave_wl_co. Co-authored-by: Cursor <[email protected]>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
Of the 84 DSV4 shapes, 38 tuned to a JIT _ws kid. Checking each of those winning tiles against the .co pipeline's own constraints says why: 25 of them are legal in that pipeline today and simply had no entry, and the bulk of those want B_K = 256, which the family had none of at any tile. Only 10 are actually blocked by a static_assert, and 0 by the B_K>128 one -- every winning deep-K tile already has kNSub == 1. So this is 15 entries and no code: 64x64x256 in the w1x4 and w2x2 layouts, 32x64x256 in w1x4 (w2x2 would need kExpM == 1), five clusters each. They build clean -- no spills, LDS 198 KB and 161 KB against the 320 KB budget, wmma_dst_hi non-zero so the VGPR pin still takes -- and all 15 verify numerically. Re-tuning the 12 shapes those tiles had been losing moves 8 of them to wl_co, 1.156x geomean and up to 1.331x, and takes the group from 7/12 to 12/12 against triton. Over all 84 that is 77 wins at 1.331x geomean. The four it does not take are the informative ones: all four run at splitK 2-5, and no .co family supports split-K, while the eight it takes are at splitK 0 or 1. A .co entry can only win a shape that does not want split-K, which is also how to price the remaining static_assert before restructuring anything for it -- the tiles it guards are the smallest in the set, and small tiles are what lean hardest on split-K. Docs follow: the README covered only the compute family and predates the wl one entirely, so it gains both families, the wave_layout field, the --device-flag passthrough, and that split-K boundary. KNOWN_ISSUES records the tuner-side defect that silently withheld the whole wl family from nomination, and the measurement above in place of the guess that fixing the two asserts was where the performance was. Co-authored-by: Cursor <[email protected]>
Adding the B_K=256 entries only helped the 12 shapes that were re-tuned against them. Ten more could reach the same tiles and had not been, which is its own trap: a new candidate does nothing for a shape nobody re-tunes, and the tuned CSV gives no sign that it is out of date. All ten improve -- 1.083x geomean, up to 1.322x on 8192x64x4096, which had been running a 64x64 tile at half occupancy -- and the group goes 8/10 to 10/10 against triton. Over all 84 that is 79 wins at 1.344x geomean, wl_co now taking 58. The remaining gap is 8 shapes that no legal .co tile fills without split-K but B_M=16 would, and B_M=16 is what issue 3's static_assert refuses. The occupancy case for lifting it is real; the scheduling budget is what kills it. A K step only has (B_K/64) * kNumNSub * kExpM * kExpNPerSub * kExpKHalf WMMAs to hide the ds_reads, the handshake and the TDM issue in, and every .co kernel winning a shape today has at least 16 of them. That floor is now measured rather than guessed. 32x64x128 is legal today and has the same grid as 32x64x256, so it differs only in K depth and budget -- 8 against 16. Added as a probe and tuned head-to-head on the five shapes 32x64x256 owns, it won none of them, inside noise at 0.975-1.017x. B_M=16 lands at 8 or 4, and widening B_N to buy budget halves the grid and gives the occupancy straight back. The probe entries are removed again; KNOWN_ISSUES records the numbers so the restructure is not attempted on the occupancy argument alone. Co-authored-by: Cursor <[email protected]>
…k/ruff The style checks were the urgent part. At the merge-base with main these files are black-clean and carry 3 ruff findings; on this branch black wanted 5 of them reformatted and ruff was up to 11. CI runs psf/black@stable over the whole tree and pins ruff 0.16.0, so the branch was red on both. Reformatted the nine Python files the branch touches and cleared their ruff findings: subprocess.run in build_co.py now says check=False explicitly -- it reads returncode itself so that CalledProcess Error does not swallow hipcc's diagnostics -- and the file gets the exec bit its shebang implies. The five findings left repo-wide are all in files this branch never touched. black is clean across all 1063 files. KNOWN_ISSUES was still shaped like a list of four live defects when two are fixed and the other two have been measured and declined. Open constraints now lead, each carrying its verdict; the resolved pair moves below and issue 1 loses the forensic narrative it no longer needs, keeping the reproducer, the occupancy control group and the damage geometry that identified the write-after-read. The dead ends and the detection techniques stay where they were -- they are the reusable part. Numbering is unchanged so existing references still resolve. README gains the two numbers that decide whether a tile is worth adding at all: the grid it produces, which with no split-K is the only parallelism available, and its WMMA budget, which is what the pipeline has to hide the ds_reads, the handshake and the TDM issue in. Everything that wins a shape today has at least 16 of the latter, and a tile with 8 won none of the five it was aimed at -- so the additions worth making raise B_K, which buys budget without costing grid. Co-authored-by: Cursor <[email protected]>
demonsan
marked this pull request as ready for review
August 21, 2026 11:09
Signed-off-by: binglue.lyu <[email protected]>
The bf16 split-K partial was applied by flipping the default on OpusGemmInstance, which is every kid on every arch, not just the two gfx1250 families it was measured on. gfx942's codegen reads splitk_workspace_dtype to pick its own workspace type, so the flip retargeted that arch's split-K families as well, and em3en4_lds1_pgr2_sk static_asserts an fp32 workspace: static assertion failed due to requirement 'std::is_same_v<__bf16, float>' EM3EN4 LDS1/PGR2 splitK main kernel writes fp32 workspace Invisible locally because everything here is built for gfx1250; the wheel job builds gfx942;gfx950 and nothing else, so this only ever appeared in CI. Default goes back to fp32 and the two _ws tags opt in by name after the table is assembled, which also leaves the three gfx942 variants that were already bf16 (kbuf1_sk, kbuf2v_bk128_sk, quad_mfma32_kbuf1_sk) exactly as they were. Verified by building module_deepgemm_opus with GPU_ARCHS="gfx942;gfx950" -- the CI configuration -- which now compiles clean, and by re-checking gfx1250: kid 20417 still declares a bf16 partial and the golden sweep is 6/6. Co-authored-by: Cursor <[email protected]>
The comments introduced with the WAR fix and the per-kid partial dtype ran five and six lines, in files whose own comments are one to three and stay inside 89 columns. Same points in 23 lines instead of 54, nothing over 86 columns. Comments only; the golden sweep is 6/6. Co-authored-by: Cursor <[email protected]>
wmma::operator() and the swap_ab adaptor take reuse_a/reuse_b as template parameters and forward them to the builtins' last two arguments, which until now were hardcoded false. Both default to false, so every existing call site emits exactly the instruction it did before. The hint asserts that this WMMA's operand repeats the previous one's and may be read from the source cache rather than VGPR RAM; it is undefined if the operand does not in fact repeat, so a caller has to be able to prove it. matrix_a_reuse is a no-op on MI450, which is why the swap_ab adaptor forwards them crossed -- under that adaptor `a` lands in SRC1, so reuse_a is the one that reaches the bit that works. No caller passes true yet. Co-authored-by: Cursor <[email protected]>
N=129280 had only been tuned at K=4096, so this shape had no row at all. opus takes it at 555.84 us against triton's 1803.94 us (3.25x), both from the same tuning session; the winner is 4wave_wl_co 128x128x256x128 w2x2 c4x4 at splitK=0, err_ratio 0.0. Only the new row is added. 512x32320x7168 was re-tuned alongside it and is left alone -- it already carries a faster measurement of the same kid -- and every other row is byte-identical. Co-authored-by: Cursor <[email protected]>
512x129280x7168 is a dsv3 shape, not a dsv4 one -- it was added to the dsv4 table in error. dsv3 already carried a placeholder row for it (triton, us=0, kernelName=auto), so this replaces that with the measured result rather than adding a row: opus at 555.84 us, 4wave_wl_co 128x128x256x128 w2x2 c4x4, splitK=0, err_ratio 0.0. Triton measured 1803.94 us on the same shape in the same session. dsv4 goes back byte-for-byte to what it was before that row landed. Co-authored-by: Cursor <[email protected]>
junhaha666
approved these changes
Aug 26, 2026
Fyzyukk
added a commit
to Fyzyukk/aiter
that referenced
this pull request
Aug 27, 2026
- port 219 prebuilt gfx1250 BF16 A16W16 CO kernels - register CO kernels in the canonical exact-kid registry - emit host launchers and load packaged CO images at runtime - preserve caller-owned workspace and the current launch-plan architecture - add CO manifest, builder, packaging support, tuning routes, and tests - avoid restoring the legacy shape dispatcher and C++ workspace allocation
Fyzyukk
added a commit
to Fyzyukk/aiter
that referenced
this pull request
Aug 27, 2026
Match PR ROCm#4903 by removing the complete duplicate dsv4pro table instead of retaining its unmatched Triton rows.
Fyzyukk
added a commit
to Fyzyukk/aiter
that referenced
this pull request
Aug 27, 2026
Restore the remaining dsv3 and dsv4 tuning updates from PR ROCm#4903 so the shipped gfx1250 routes match the original CO integration results.
yifehuan
pushed a commit
that referenced
this pull request
Sep 17, 2026
…4961) * [OPUS] Reapply Task1 and Task2 on upstream/main Reapply the final Task1 Torch-owned split-K workspace and Task2 caller-resolved exact-kid interface state on top of upstream/main@a43694f1.\n\nThis is a squashed final-state review commit; obsolete intermediate Task1/Task2 implementations are intentionally not replayed. The resulting task files match the validated merge candidate. * [OPUS] Consolidate task documentation * [OPUS] Document Task1 and Task2 validation workflow * [OPUS] Preserve upstream MXScale tuned config * [OPUS] Guard C ABI priming on tensor device * [OPUS] Drop Task1 and Task2 validation docs * [OPUS] Optimize Task2 Python dispatch hot paths * [OPUS] Adapt upstream gfx1250 split-K fixes (#4246) Reapply upstream commit 1b741c0 on top of the unified public API, canonical exact-kid registry, and caller-owned Torch workspace design. Adopt the policy-tag N-D TDM API, clusterlaunch grid round-up, compile-time gfx1250 reducer dispatch, mixed-arch device guards, tuned configs, and the final decision to leave the fused family unregistered. * [OPUS] Document gfx942 and gfx1250 validation plan * [OPUS] Optimize A16 C ABI launch path Reuse thread-local tensor descriptors and avoid redundant error calls so MI308 workspace performance stays within repeat noise. Record the full correctness and ABBA validation results. Co-authored-by: Cursor <[email protected]> * [OPUS] Isolate A16W16 caller policy Move the architecture heuristics and tuned-candidate validation into a dedicated policy module while keeping exact execution in the family launcher. Preserve the upstream skinny-to-Torch fallback when no valid tuned row exists. * [OPUS] Split public GEMM and BMM adapters * [OPUS] Consolidate launch policy and repair tune routes * Minimize OPUS integration changes * Remove generated HTML reports * Reconcile OPUS branch with latest upstream * Trim redundant OPUS tests and benchmarks * Focus OPUS tests on representative regressions * Drop redundant OPUS interface tests * Optimize A16 eager dispatch and remove legacy workspace registry * Add OPUS validation coverage and update documentation * Add MI308X gfx942 OPUS validation guide * Remove MI308X OPUS validation guide * Remove branch-only OPUS test files * Fix OPUS lint failures * Fix gfx950 MXFP8 split-K Cvoid compilation * Format MXFP8 split-K regression test * Fix no-argument OPUS A16W16 test entry * Fix OPUS compatibility and tuning paths * [OPUS] Integrate PR #4903 gfx1250 CO kernels with exact-kid dispatch - port 219 prebuilt gfx1250 BF16 A16W16 CO kernels - register CO kernels in the canonical exact-kid registry - emit host launchers and load packaged CO images at runtime - preserve caller-owned workspace and the current launch-plan architecture - add CO manifest, builder, packaging support, tuning routes, and tests - avoid restoring the legacy shape dispatcher and C++ workspace allocation * [OPUS] Remove obsolete dsv4pro BF16 tuning config Match PR #4903 by removing the complete duplicate dsv4pro table instead of retaining its unmatched Triton rows. * [OPUS] Align BF16 tuning tables with PR #4903 Restore the remaining dsv3 and dsv4 tuning updates from PR #4903 so the shipped gfx1250 routes match the original CO integration results. * [OPUS] Address PR 4961 must-fix review Separate public exact-kid dispatch from GEMM and MoE family implementations, and restore the established general A8W8 API boundary. Tighten fixed-contract attribute access while retaining the develop adapter required by the aiter_tensor_t ABI and HIP stream propagation. Add gfx1250 CO exact-kid numerical and loader-path coverage. * [OPUS] Keep family modules in the flat package Move the A16, A8, and MoE family implementations back beside dispatch.py and restore all callers to the original module paths. This avoids changing CK tuner and MoE imports solely for package nesting. * [OPUS] Address PR 4961 should-fix review Reuse shared architecture constants in launch planning and policy. Add deterministic source and artifact fingerprints for packaged gfx1250 CO kernels, with CPU verification in the integration suite and OPUS test entry point. * [OPUS] Fix Python style checks * Fix MXFP8 BMM policy review issues * Address OPUS A16W16 review feedback * Refresh OPUS CO source provenance The opus.hpp update restores comment formatting only. Refresh the source fingerprint while keeping the verified artifact digest unchanged. * Simplify OPUS tuned GEMM integration * Remove OPUS A16W16 C ABI launch path * [FlyDSL] Remove stale TopK availability checks (#5210) FlyDSL is required after #5116, so the removed helper breaks test collection and silently disables decode dispatch. Co-authored-by: Cursor <[email protected]> * Drop unrelated setup.py comment change * Revert "Drop unrelated setup.py comment change" * Drop comment-only packaging diffs * Remove SHA markers from OPUS policy parity test * Fix gfx942 split-K launch validation for short K * Size gfx942 workspace from converged split-K * Add OPUS A8W8 tuning and exact BMM replay * Gate OPUS A8W8 tuner to gfx950 * Keep OPUS CO build tooling and artifacts aligned with upstream Restore gen_co files to the merged upstream version and remove the added provenance check, CI invocation, and dedicated test. Keep the exact-kid CO integration and its existing registry, loader, and contract coverage. Validation: 7 CPU integration tests passed; all 219 CO records match the current registry. GPU tests were not run for this tooling cleanup. * Restore upstream OPUS JIT configuration Reuse upstream cluster-launch handling and CO path define spelling. The extra JSON escaping produced the same evaluated compiler flag. Validation: 30 architecture/version gate comparisons and 7 CPU CO integration tests passed; Ruff and Black passed. No GPU tests were run. * [OPUS] Fix launch validation and compatibility follow-ups - converge A16 split-K before workspace sizing across architectures\n- validate MXFP8 saved rows and prefetch constraints before launch\n- restore gfx942 compatibility redirects while keeping exact APIs strict\n- distinguish direct/workspace compiled-table availability\n- align gfx1250 cluster candidate and default-build coverage * [OPUS] Consolidate redundant regression coverage Keep exhaustive heuristic, shipped-config, artifact identity, and hardware launch coverage while collapsing duplicate planner, route, compatibility, and tuner cases into their maintained owners. Validated with Black, Ruff, Python syntax checks, git diff --check, and 98 focused CPU/meta tests plus 22 subtests. GPU tests were not run locally. * [OPUS] Simplify A16W16 merge resolution Keep exact-kid launch validation isolated from main's production benchmark path and remove duplicate shape-driven wrappers. * [OPUS] Remove A16 tuned sweep from test entry * [CI] Retrigger failed workflows * [OPUS] Simplify and activate test coverage * [OPUS] Preserve A16 benchmark data initialization --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: vorapolsiloai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Result
Golden sweep 6/6. Every tuned shape passes the accuracy gate, worst
err_ratio0.0169 against the 0.05 line.
Per-kid dtype selection reaches both ends, verified by the accuracy signature
flipping with the table entry (512x2048x7168, max abs error vs fp64):
Candidate-set scoping, previously silent losses:
N=384 was the visible symptom -- a flat ~25 us floor that did not scale with M,
because only 12 workgroups were reachable and split-K was unavailable:
Adding the
B_K=256tiles the.cofamilies had been missing accounts for therest. Checking each
_wswinner's tile against the.copipeline's ownconstraints, 25 of 38 were already legal there and simply had no entry; 15
entries and two rounds of re-tuning moved 13 shapes over. The second round was
needed because a new candidate does nothing for a shape nobody re-tunes, and the
tuned CSV gives no sign that it is out of date.
Over all 84 shapes opus wins 79, geomean 1.344x, 1.433x on total time, range
4.68x to 0.92x, with
4wave_wl_cotaking 58 of them.dsv4_bf16_tuned_gemm.csvis updated for those 84 rows only --
M < 256, other architectures and everyshape outside this sweep are untouched and verified byte-identical.
GEMM A16W16 tuned kernel time (µs) — opus with the
.co4wave familynominated and the split-K workspace fixed, against a triton tune from the same
session.
M < 256was not part of this sweep and is unchanged in the tuned CSV.DSv4 Pro K=7168
N=64, K=7168
N=384, K=7168
N=512, K=7168
N=1024, K=7168
N=2048, K=7168
N=32320, K=7168
DSv4 Flash K=4096
N=64, K=4096
N=256, K=4096
N=512, K=4096
N=1024, K=4096
N=2048, K=4096
N=129280, K=4096
Submission Checklist