Repository navigation
[Codegen][CPU] Add e2e matmul tests for the inner_tiled lowering path. - #24405
Merged
Merged
Conversation
25 of 28 tasks
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-pretransposed-intrinsics
branch
from
May 8, 2026 15:37
01324d2 to
f7573b5
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests
branch
2 times, most recently
from
May 8, 2026 16:07
5b88fac to
de7b3aa
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-pretransposed-intrinsics
branch
from
May 8, 2026 16:07
f7573b5 to
5af6e0f
Compare
bjacob
marked this pull request as ready for review
May 8, 2026 16:38
hanhanW
approved these changes
May 8, 2026
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests
branch
2 times, most recently
from
May 8, 2026 20:05
d951093 to
dd3e47f
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-pretransposed-intrinsics
branch
from
May 8, 2026 20:05
e211a28 to
52f0ad0
Compare
…sed enums. Each non-square hardware MMA now appears as two `MMAIntrinsic` enum values — one per orientation — named after their actual MxNxK shape (e.g. `MMA_X86_AVX512_1x16x1_F32_F32` and its M↔N-swapped sibling `MMA_X86_AVX512_16x1x1_F32_F32`). The swapped sibling of `X` is `X | 1` (bit 0 of D in the enum's encoding), so consecutive enum values form natural/swapped pairs. The `transposed_intrinsic` boolean on `DataTiledMMAAttr` is removed; both orientations show up as distinct candidates in `getMmaIntrinsicsForTargetConfig` and the existing `chooseIntrinsic` scoring picks between them. A new `assert(isMmaIntrinsicArrayValid(...))` at the bottom of `getMmaIntrinsicsForTargetConfig` enforces the convention: strictly increasing, every swapped entry preceded by its natural sibling, and square/type-symmetric singletons allowed (covers the generic-scalar 1×1×1 family). Motivation: the boolean was originally there to avoid 2× enum growth, but it leaked orientation-handling into every layer that touched MMA layouts — swizzles, ACC encoding-info, the cross-intrinsic ACC index, broadcast direction. It was also poised to get worse: asymmetric LLVM intrinsics (vpdpbusd) and non-x86 targets (no broadcast) would each need bespoke handling under the boolean. With separate enum values, each orientation lowers independently. MMAUtils permutation fix: `buildDataTiledMMAUnderlyingOperations` previously moved between the caller's logical (M, N)-ordered tile type and the swizzle's distributed N-D form via a linear-preserving `vector.shape_cast` — sound only for identity permutations. Pre-existing intrinsics all happened to be identity, so the bug was dormant. Every swapped enum added here produces a non-identity permutation (cross-intrinsic-N injected before cross-intrinsic-M, putting N first in storage), and the shape_cast scrambles (m, n) coordinates so result values land in the wrong cells. Fix: split the reshape into a logical-shape `shape_cast` plus a `vector.transpose` by the swizzle's permutation (input side) / its inverse (output side). Folds to a no-op for identity permutations, so existing natural-orientation intrinsics produce the same IR as before. Verified by extending the existing `lower_avx512_16x1x1_f32` test in `lower_inner_tiled.mlir` (the first to exercise a non-identity permutation) with `CHECK` lines pinning the shape_cast/transpose pairs around the FMA call. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Progress towards #24323 Signed-off-by: Benoit Jacob <[email protected]>
Adds an `e2e_matmul_cpu_dt_inner_tiled_*` family that mirrors the existing legacy-path `e2e_matmul_cpu_dt_*` block (same type matrix: i8/i32, f32/f32, f64/f64, f16/f16, f16/f32, bf16/bf16, bf16/f32; same per-type x86 cpu-features variants; f64-demote guard; riscv/wasm tags) but with `--iree-opt-data-tiling --iree-llvmcpu-enable-inner- tiled`. Type×feature combos that match an MMA intrinsic (e.g. f32/f32 on AVX2, bf16/f32 on AVX-512-BF16, i8/i32 on AVX-512-VNNI) actually exercise the new `iree_codegen.inner_tiled` lowering; the rest fall through to the standard codegen path via the earlier "skip data tiling" commit in this stack. Either way it's a correctness check on data-tiling- enabled compilation for that target. Shapes use the `default` set, except f64 (`small`, due to f64-demote handling). The pre-transposed enums earlier in this stack are what let us start at the full shape set rather than progressively widen. Signed-off-by: Benoit Jacob <[email protected]> Progress towards #24323
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests
branch
from
May 8, 2026 20:08
dd3e47f to
73f8129
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-pretransposed-intrinsics
branch
from
May 8, 2026 20:08
52f0ad0 to
7cffbfe
Compare
Base automatically changed from
users/bjacob/cpu-inner-tiled-pretransposed-intrinsics
to
main
May 8, 2026 22:00
bjacob
requested review from
MaheshRavishankar,
Max191,
jtuyls and
qedawkins
as code owners
May 8, 2026 22:00
Contributor
|
There are many remarks about "hoistable conversion" starting from this change: https://github.com/iree-org/iree/actions/runs/25581695297/job/75101859714 They are not failures, so we can either send a post fix next Monday or reland it. |
Collaborator
Author
|
Thanks for the catch! Let's revert, since that was unexpected. |
bjacob
added a commit
that referenced
this pull request
May 9, 2026
…ing path." (#24421) Reverts #24405 Reason: #24405 (comment)
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
iree-org#24405) Adds an `e2e_matmul_cpu_dt_inner_tiled_*` family that mirrors the existing legacy-path `e2e_matmul_cpu_dt_*` block (same type matrix: i8/i32, f32/f32, f64/f64, f16/f16, f16/f32, bf16/bf16, bf16/f32; same per-type x86 cpu-features variants; f64-demote guard; riscv/wasm tags) but with `--iree-opt-data-tiling --iree-llvmcpu-enable-inner- tiled`. Progress towards iree-org#24323 --------- Signed-off-by: Benoit Jacob <[email protected]>
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
…ing path." (iree-org#24421) Reverts iree-org#24405 Reason: iree-org#24405 (comment)
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.
Adds an
e2e_matmul_cpu_dt_inner_tiled_*family that mirrors the existing legacy-pathe2e_matmul_cpu_dt_*block (same type matrix: i8/i32, f32/f32, f64/f64, f16/f16, f16/f32, bf16/bf16, bf16/f32; same per-type x86 cpu-features variants; f64-demote guard; riscv/wasm tags) but with--iree-opt-data-tiling --iree-llvmcpu-enable-inner- tiled.Progress towards #24323