TileOP: explicit-groupM overloads across the TMATMUL family - #87
Merged
Conversation
Extend the cooperative Local-A/Shared-B explicit-groupM pattern (ADR-0100) from TMATMUL to the rest of the matrix family: TMATMUL_ACC(d, c, a, b, groupM) TMATMUL_BIAS(d, a, b, bias, groupM) TMATMUL_MX(d, a, sa, b, sb, groupM) TMATMUL_MX_ACC(d, c, a, sa, b, sb, groupM) TMATMUL_MX_BIAS(d, a, sa, b, sb, bias, groupM) All share one helper namespace (pto_matmul_groupm_detail) enforcing: - Local-A/Shared-B only (Shared-A derives group_M from its own shape) - D (and C) valid rows equal the per-PE A shard size - runtime group_M in 1..128 (printf + trap, mirroring the ASL dispatch) Also fixes pre-existing MX bugs surfaced by the Shared-scale paths: - basic TMATMUL_MX/MX_ACC/MX_BIAS constrained scale operands to is_tile_data_v, rejecting SharedTile scales that the options overloads already accept; relaxed to typename to match - the Local-A/Shared-B emitters bound a Shared scale with "Tr"(scale.data()) (SharedTile has no data()) and emitted B.IOT for it; now "Sr"(handle()) and B.IOS, matching the options-version convention (PTO_FIXP_MX_SB_SRC) - the 5SRC helper additionally mis-ordered a B.IOT with the Shared scale and the Extra binder; now emits B.IOS scale then B.IOT Extra Verified (fixture CoopGroupMOverloads): - TMATMUL_ACC/BIAS CubeM16 (group_M=64) and CubeM32 (group_M=128): LB0 carries the runtime group_M (B.DIM reg, 0), N/K immediate-form - TMATMUL_MX/MX_ACC/MX_BIAS with Local e4m3 A + Shared B + Shared e8m0 scale: B.IOS S1 scale binder, runtime LB0 - MXScaleVariants/GroupMatmul/SharedMatmul/TMatmulAcc*/PostProcessCombos/ HiF4X2MatmulMX/TGEMV* fixtures and unittest 40/40 all clean (TMatmulAllOptions retains 3 pre-existing match errors, identical on the unmodified baseline)
VV0003
pushed a commit
that referenced
this pull request
Sep 8, 2026
…e same PR Records the working convention (applied in #87/#93): any public-header interface change must update the corresponding docs/tileop-usage pages (signature block with template declarations, parameter table, overload selection), plus options.md / migration entries for cross-cutting changes, verified by the docs freshness unittest.
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.
Extends the cooperative Local-A/Shared-B explicit-groupM pattern (ADR-0100) from
TMATMULto the full matrix family, mirroring:TMATMUL(d, local_a, shared_b, groupM)TMATMUL(d, local_a, shared_b, options, groupM)New overloads
All share one helper namespace (
pto_matmul_groupm_detail) enforcing:Options overloads (
options, groupM) already exist forTMATMUL(from #72) and work through the same emit chain; the ACC/BIAS/MX family's basic (parameter-free) forms get the same capability here.Pre-existing MX bugs fixed (surfaced by the Shared-scale paths)
TMATMUL_MX/MX_ACC/MX_BIASconstrained scale operands tois_tile_data_v, rejectingSharedTilescales the options overloads already accept → relaxed totypename."Tr"(scale.data())—SharedTilehas nodata()— and emittedB.IOTfor it → now"Sr"(handle())andB.IOS, matching the options-version convention (PTO_FIXP_MX_SB_SRC).B.IOT %[ScaleB], %[Extra]into one binder; now emitsB.IOSscale thenB.IOTExtra.Verification (fixture
CoopGroupMOverloads)TMATMUL_ACC/BIASwith CubeM16 (group_M=64) and CubeM32 (group_M=128): disassembly shows LB0 carrying the runtime group_M (B.DIM reg, 0), N/K immediate-form (C.B.DIMI)TMATMUL_MX/MX_ACC/MX_BIASwith Local e4m3 A + Shared B + Shared e8m0 scale:B.IOS S1scale binder + runtime LB0Note: TGEMV family is intentionally excluded — per ADR-0100 it only allows Local operands and has no cooperative group_M.