Repository navigation
[Codegen][CPU] Pick inner-tiled unroll factors from a register budget. - #24303
Merged
Merged
Conversation
Base automatically changed from
users/bjacob/inner-tiled-materialize-encoding
to
main
April 29, 2026 17:19
bjacob
force-pushed
the
users/bjacob/inner-tiled-unroll-factors
branch
from
April 29, 2026 18:53
97453de to
5931ff3
Compare
Replace the hard-coded `intrinsics_m = intrinsics_n = 1` from the previous commit with a cost model that, for the intrinsic/orientation already chosen by chooseIntrinsic, picks the largest power-of-two unroll factors such that the three tiles (ACC + LHS + RHS) still fit in the target's architectural vector register file, breaking ties with arithmetic intensity (effM*effN)/(effM+effN) so approximately- square tiles win. Introduces: - `getRegisterSpaceBytes(intrinsic)` returning the bit capacity of the three-tile budget; scalable ISAs (SVE/SVE2) are treated as their 128-bit VL minimum. - `po2UnrollCap` to round the static-matmul-extent cover count down to a power of two (and fall back to the budget for dynamic dims). - `chooseUnrolling` as Phase 2 of `chooseCpuInnerTiledMmaForEncoding`. Updates materialize_encoding_x86_64.mlir to reflect the new unroll choices (e.g. intrinsics_m = 16 on dynamic AVX-512 f32 matmul). Made-with: Cursor Signed-off-by: Benoit Jacob <[email protected]>
bjacob
force-pushed
the
users/bjacob/inner-tiled-unroll-factors
branch
from
April 29, 2026 18:54
5931ff3 to
b6b6a44
Compare
bjacob
marked this pull request as ready for review
April 29, 2026 18:58
bjacob
requested review from
MaheshRavishankar,
Max191,
hanhanW,
jtuyls and
qedawkins
as code owners
April 29, 2026 18:58
egebeysel
approved these changes
Apr 30, 2026
egebeysel
left a comment
Contributor
There was a problem hiding this comment.
Looked super interesting so I decided to give it a quick review and leave some comments/questions :) Thanks!
hanhanW
approved these changes
Apr 30, 2026
25 of 28 tasks
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
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.
Replace the hard-coded
intrinsics_m = intrinsics_n = 1from #24289with a simple cost model based on maximizing arithmetic intensity
under the constraint of fitting in register space.
AI: Claude Opus 4.7