[Codegen][CPU] Materialize data-tiled encodings to inner_tiled.#1
Open
bjacob wants to merge 1 commit into
Open
[Codegen][CPU] Materialize data-tiled encodings to inner_tiled.#1bjacob wants to merge 1 commit into
bjacob wants to merge 1 commit into
Conversation
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>
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.Made-with: Cursor