fix(gemm): preserve dense API contracts with block FP8 - #135
Closed
voipmonitor wants to merge 1 commit into
Closed
voipmonitor wants to merge 1 commit into
voipmonitor wants to merge 1 commit into
Conversation
Contributor
📝 WalkthroughWalkthroughDense GEMM adds optional ChangesDense GEMM API and kernel updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
35 tasks
brandonmmusic-max
added a commit
to brandonmmusic-max/b12x
that referenced
this pull request
Aug 9, 2026
R7 encoders choose K independently per (expert, projection). The mixed path tiers per expert -- one trellis_bits per tier for FC1 and FC2, a single-row descriptor -- so an expert that is K3-gate/K4-down cannot be expressed. - descriptor_map becomes int32[3 * stride], rows gate/up/down, same (tier << 8) | local encoding. Dispatch resolves the row per projection: FC2 at compile time, FC1 by N-half from output_n_tile, which trellis3_t256_proj keeps projection-aligned. - FC1 and FC2 expert counts may differ per tier. The FC2 count is derived from the W2 payload extent and carried through bounds, W2/global-scale logical layouts, compile arguments, and launches, so both phases keep real bounds and truthful CuTe extents. ABI_VERSION 6 -> 7. - build_tiered_maps() keeps its signature and repeats its single row three times, so existing per-expert mixed checkpoints resolve bit-identically. - New validated public builder build_projection_tiered_maps(); slot arity, range, disjointness and per-tier capacity are enforced. Based on the canonical r33 composition (master 9bbae67 + local-inference-lab#125, local-inference-lab#126, local-inference-lab#133, local-inference-lab#135, local-inference-lab#136, local-inference-lab#137), verified byte-identical to the r33 image kernel tree before these changes. CPU contract tests added; suite parity confirmed against the unmodified base (same 9 pre-existing GPU-dependent failures, 8 additional tests passing). Ruff clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Collaborator
|
Closing this PR because it was opened before August 15, 2026. Please reopen it if the change is still valid. |
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.
Summary
fused_quant_bf16and FP6row_scaleAPI contracts when adding the regular K128 block-FP8 pathRoot cause
Commit
fe92b95addedblock_fp8, but two signatures replaced existing parameters instead of appending the new one:DenseGemmKernel.fused_quant_bf16dense_gemm.row_scaleThe implementation and callers still used those parameters. This caused model warmup to fail on FP6 row-scale paths and removed the explicit fused-quant compile-key input.
The same change also introduced a block-FP8 local named
c_identityin the shared CuTe DSL kernel. Legacy fused-quant compilation uses that name in other compile-time branches. CuTe therefore observedNoneon one control-flow path and a tensor on another and rejected the first real DSpark request withTYPE_UNSTABLE_JOIN. Distinctblock_c_identity/block_coord_mnlocals remove that cross-family type join without changing either kernel's arithmetic.Validation
git diff --check: passThe full-model test used GPUs 4-7 on the same direct-attached host as the r31 reference.
Summary by CodeRabbit
New Features
Documentation
Tests