TileOP: enforce CUBE InternalAcc CCTRL legality (spec#236, Phase 1) - #84
Merged
Conversation
Complete the Phase-1 TileOP adaptation for the PTO-ISA CUBE InternalAcc contract (spec#236, merge 33645f4): - Wire validate_cube_ctrl_contract into the basic (non-Options) matrix emitters: matmul, matmul_acc, matmul_bias (3SRC), matmul_mx, and the MX 5SRC helper (IsAcc-parameterized). Previously the validator existed but had zero call sites. - Fix template-argument mispositioning in all 12 validate_matrix_postprocess_contract call sites: the bool argument landed on the MX parameter instead of IsAccForm, so every non-ACC emit path was validated as if it were an ACC form (CCTRL[1] hint check was inert) and two ACC emitters had MX erroneously set to true (forcing the FP32 accumulator code path). - Make FixpAttr::with_cube_ctrl a chainable const member (matching transpose_a/transpose_b style). As a static constructor it silently dropped every other configured attribute (PreQuant, Relu, ...) when combined, which let raw-D + post-process combinations slip through. - Golden fixture CubeInternalAcc.cpp: the four CCTRL values lower to the B.DATR PadValueOrByteId[1:0] union field (None->Zero, Raw->Max, Hint->Min, Raw|Hint->Null). - Negative runner CubeInternalAccNegatives.cpp: CCTRL[1] on non-ACC TMATMUL, CCTRL[0] raw D with f16 PreQuant (dtype-matching dst), and CCTRL[0] with Relu are all rejected at compile time (3/3). Verified: unittest 40/40; SharedMatmul/GroupMatmul/TMatmulAcc*, TGEMV*, MX*, and the per-dimension sweep fixtures all compile clean.
VV0003
enabled auto-merge (squash)
September 8, 2026 01:23
VV0003
disabled auto-merge
September 8, 2026 01:23
VV0003
added a commit
that referenced
this pull request
Sep 8, 2026
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.
Implements the TileOP Phase-1 items of the CUBE InternalAcc adaptation package (PTO-ISA spec#236, merge 33645f4) per the handoff work order.
What was already in place
What this PR completes
Validator wiring: validate_cube_ctrl_contract existed but had zero call sites. Now wired into matmul / matmul_acc / matmul_bias / matmul_mx / MX-5SRC (IsAcc-parameterized) basic emitters.
Template-argument mispositioning fix (latent bug): all 12 validate_matrix_postprocess_contract call sites passed the bool onto the MX parameter instead of IsAccForm:
with_cube_ctrl chainable fix (API bug): as a static constructor it silently dropped all other configured attributes when chained after f16()/keep_acc(), letting raw-D + post-process combinations slip through. Now a const member preserving attributes, matching transpose_a/b style.
Verification
Not in scope (per handoff)
LLVM-side MC/parser/encoder and SelectionDAG adaptation (Phase 2/3) — this PR is the TileOP Phase-1 slice; the generated canonical assembly (B.DATR union bits verified above) is the input baseline for those phases.