Repository navigation
[Codegen][CPU] Add e2e matmul tests for the inner_tiled lowering path. - #24492
Merged
Merged
Conversation
25 of 28 tasks
bjacob
marked this pull request as ready for review
May 14, 2026 20:43
bjacob
force-pushed
the
users/bjacob/cpu-hoist-inner-tiled-acc-reshapes
branch
from
May 15, 2026 14:04
4700ab6 to
721339b
Compare
bjacob
requested review from
MaheshRavishankar,
Max191,
hanhanW and
qedawkins
as code owners
May 15, 2026 14:04
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests-take-two
branch
from
May 15, 2026 14:04
0b648ae to
7a841a0
Compare
bjacob
force-pushed
the
users/bjacob/cpu-hoist-inner-tiled-acc-reshapes
branch
from
May 15, 2026 15:54
721339b to
1b21938
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests-take-two
branch
from
May 15, 2026 15:54
7a841a0 to
12c8a26
Compare
bjacob
force-pushed
the
users/bjacob/cpu-hoist-inner-tiled-acc-reshapes
branch
from
May 15, 2026 16:02
1b21938 to
faa3f21
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests-take-two
branch
from
May 15, 2026 16:02
12c8a26 to
cdfe54f
Compare
Mirrors the GPU pipeline (`buildLLVMGPUCodegenPassPipeline` adds this pass right before `UnrollToIntrinsicsPass`). Before this change, on CPU the reshape ops left around `iree_codegen.inner_tiled` sat between the K-reduction loop's `scf.for` iter args and the op's accumulator operand, so the per-tile `HoistableConversionOp` pairs that the inner_tiled lowering wraps around its ACC distribute/reassemble couldn't satisfy `HoistConversionFromLoopPattern`'s strict iter-arg match. They failed to hoist, got inlined in place, and `EliminateHoistableConversions` fired a `hoistable_conversion was not hoisted or cancelled; inlining in place` remark on every CPU matmul build using the inner_tiled path. Running `HoistInnerTiledAccReshapes` before `LLVMCPUVirtualVectorLoweringPass` wraps the prefix/suffix reshape ops (transpose, shape_cast, broadcast) around the inner_tiled as `acc_reshape_to_intrinsic` / `acc_reshape_from_intrinsic` hoistable conversions and runs the elimination over them. The reshapes hoist out of the K loop, the inner_tiled's accumulator is fed directly by the iter arg, and the per-tile conversion pairs emitted later in the vector lowering see direct iter-arg inputs and hoist cleanly. 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 a hardware MMA intrinsic (e.g. f32/f32 on AVX2, bf16/f32 on AVX-512-BF16, i8/i32 on AVX-512-VNNI) exercise the new `iree_codegen.inner_tiled` lowering; the rest fall through to the type-polymorphic generic-scalar MMA (#24389), so this is a correctness check on data-tiling-enabled compilation either way. Shapes use the `default` set, except f64 (`small`, due to f64-demote handling). The prerequisite pre-transposed-enum PR is what lets us start at the full shape set rather than progressively widen. Progress towards #24323. Signed-off-by: Benoit Jacob <[email protected]>
bjacob
force-pushed
the
users/bjacob/cpu-hoist-inner-tiled-acc-reshapes
branch
from
May 15, 2026 17:06
faa3f21 to
57bbcbc
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-e2e-tests-take-two
branch
from
May 15, 2026 17:06
cdfe54f to
b8a97ce
Compare
hanhanW
approved these changes
May 15, 2026
Base automatically changed from
users/bjacob/cpu-hoist-inner-tiled-acc-reshapes
to
main
May 15, 2026 19:38
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
iree-org#24492) 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 a hardware MMA intrinsic (e.g. f32/f32 on AVX2, bf16/f32 on AVX-512-BF16, i8/i32 on AVX-512-VNNI) exercise the new `iree_codegen.inner_tiled` lowering; the rest fall through to the type-polymorphic generic-scalar MMA (iree-org#24389), so this is a correctness check on data-tiling-enabled compilation either way. Shapes use the `default` set, except f64 (`small`, due to f64-demote handling). The prerequisite pre-transposed-enum PR is what lets us start at the full shape set rather than progressively widen. Progress towards iree-org#24323. --------- Signed-off-by: Benoit Jacob <[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.
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.Type×feature combos that match a hardware MMA intrinsic (e.g. f32/f32 on AVX2, bf16/f32 on AVX-512-BF16, i8/i32 on AVX-512-VNNI) exercise the new
iree_codegen.inner_tiledlowering; the rest fall through to the type-polymorphic generic-scalar MMA (#24389), so this is a correctness check on data-tiling-enabled compilation either way.Shapes use the
defaultset, except f64 (small, due to f64-demote handling). The prerequisite pre-transposed-enum PR is what lets us start at the full shape set rather than progressively widen.Progress towards #24323.