Skip to content

[Codegen][CPU] Materialize data-tiled encodings to inner_tiled.#1

Open
bjacob wants to merge 1 commit into
inner-tiled-verificationfrom
inner-tiled-materialize-encoding
Open

[Codegen][CPU] Materialize data-tiled encodings to inner_tiled.#1
bjacob wants to merge 1 commit into
inner-tiled-verificationfrom
inner-tiled-materialize-encoding

Conversation

@bjacob

@bjacob bjacob commented Apr 24, 2026

Copy link
Copy Markdown
Owner

When a target sets enable_inner_tiled = true, lower matmuls with encodings to iree_codegen.inner_tiled whose kind is a CPU data_tiled_mma_layout, instead of linalg.mmt4d.

The intrinsic and its orientation (transposed_intrinsic) are chosen jointly by a small cost model that maximizes "useful ops" per invocation (charging an intrinsic for the padding it would force along statically narrow M/N), with the intrinsic's raw MNK as tiebreaker.

Unroll factors are hard-coded to intrinsics_m = intrinsics_n = 1 for now; a follow-up commit introduces the register-budget/arithmetic- intensity cost model that picks better values.

Also:

  • Add the AVX2+FMA f32 intrinsic (MMA_X86_AVX2_FMA_1x8x1_F32_F32) to enabling writing additional tests.
  • Have MaterializeEncodingPatterns emit a clean op-level error if a layout lowering returns nullptr, rather than segfaulting.

Made-with: Cursor

When a target sets `enable_inner_tiled = true`, lower matmuls with
encodings to `iree_codegen.inner_tiled` whose kind is a CPU
`data_tiled_mma_layout`, instead of `linalg.mmt4d`.

The intrinsic and its orientation (`transposed_intrinsic`) are chosen
jointly by a small cost model that maximizes "useful ops" per
invocation (charging an intrinsic for the padding it would force along
statically narrow M/N), with the intrinsic's raw M*N*K as tiebreaker.

Unroll factors are hard-coded to `intrinsics_m = intrinsics_n = 1` for
now; a follow-up commit introduces the register-budget/arithmetic-
intensity cost model that picks better values.

Also:
- Add the AVX2+FMA f32 intrinsic (`MMA_X86_AVX2_FMA_1x8x1_F32_F32`)
  to enabling writing additional tests.
- Have MaterializeEncodingPatterns emit a clean op-level error if a
  layout lowering returns nullptr, rather than segfaulting.

Made-with: Cursor
Signed-off-by: Benoit Jacob <jacob.benoit.1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant