Repository navigation
[Codegen][CPU] Materialize data-tiled encodings to inner_tiled. - #24289
Merged
Merged
Conversation
bjacob
marked this pull request as ready for review
April 28, 2026 18:46
bjacob
requested review from
MaheshRavishankar,
Max191,
hanhanW,
jtuyls and
qedawkins
as code owners
April 28, 2026 18:46
hanhanW
approved these changes
Apr 28, 2026
hanhanW
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just a couple nits and a question about roundtrip test.
Comment on lines
+1003
to
+1008
| DictionaryAttr config = layoutAttr.getConfiguration(); | ||
| if (getEnableInnerTiledFromConfig(config)) { | ||
| return getInnerTiledEncodingInfo(type.getContext(), encoding, *cDims, | ||
| config); | ||
| } | ||
| return getMmt4dEncodingInfo(encoding, *cDims, config); |
Contributor
There was a problem hiding this comment.
It's okay to have the "fork" as we are moving towards inner tiles approach. It is mostly a note for future contributors and reviewers.
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 notify a match failure if a layout lowering returns nullptr, rather than segfaulting. Made-with: Cursor Signed-off-by: Benoit Jacob <[email protected]>
bjacob
force-pushed
the
users/bjacob/inner-tiled-materialize-encoding
branch
from
April 29, 2026 16:22
0c49f4e to
9d45d2b
Compare
Collaborator
Author
|
Thanks, I have applied both your suggestions (notifyMatchFailure and reverted the round_trip.mlir test). |
bjacob
enabled auto-merge (squash)
April 29, 2026 16:23
2 tasks
bjacob
added a commit
that referenced
this pull request
Apr 30, 2026
#24303) Replace the hard-coded `intrinsics_m = intrinsics_n = 1` from #24289 with a simple cost model based on maximizing arithmetic intensity under the constraint of fitting in register space. AI: Claude Opus 4.7 Signed-off-by: Benoit Jacob <[email protected]>
25 of 28 tasks
jerryyin
pushed a commit
that referenced
this pull request
May 7, 2026
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. AI: Claude Opus 4.7 Signed-off-by: Benoit Jacob <[email protected]>
jerryyin
pushed a commit
that referenced
this pull request
May 7, 2026
#24303) Replace the hard-coded `intrinsics_m = intrinsics_n = 1` from #24289 with a simple cost model based on maximizing arithmetic intensity under the constraint of fitting in register space. AI: Claude Opus 4.7 Signed-off-by: Benoit Jacob <[email protected]>
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
…-org#24289) 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. AI: Claude Opus 4.7 Signed-off-by: Benoit Jacob <[email protected]>
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
iree-org#24303) Replace the hard-coded `intrinsics_m = intrinsics_n = 1` from iree-org#24289 with a simple cost model based on maximizing arithmetic intensity under the constraint of fitting in register space. AI: Claude Opus 4.7 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.
When a target sets
enable_inner_tiled = true, lower matmuls with encodings toiree_codegen.inner_tiledwhose kind is a CPUdata_tiled_mma_layout, instead oflinalg.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 = 1for now; a follow-up commit introduces the register-budget/arithmetic- intensity cost model that picks better values.Also:
MMA_X86_AVX2_FMA_1x8x1_F32_F32) to enabling writing additional tests.AI: Claude Opus 4.7