Skip to content

[Codegen] Add iree_map dialect with PackMapAttr#23671

Merged
Groverkss merged 4 commits intoiree-org:mainfrom
Groverkss:iree-map-dialect-patch-1
Mar 11, 2026
Merged

[Codegen] Add iree_map dialect with PackMapAttr#23671
Groverkss merged 4 commits intoiree-org:mainfrom
Groverkss:iree-map-dialect-patch-1

Conversation

@Groverkss
Copy link
Contributor

Introduces the iree_map dialect and PackMapAttr, a layout map defined by a (Shape, Stride) pair of hierarchical IntTuples. Provides layout algebra operations (compose, complement, logicalDivide, logicalProduct, filter, rightInverse, etc.) for use in vector distribution passes.

@Groverkss
Copy link
Contributor Author

I will send more information on discord or an RFC

Copy link
Collaborator

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have lots of comments :) . I got through only few of the algebra methods here cause I am missing some understanding (and I think the tests are missing some cases that help make this understanding better). Left some initial comments. I can come back and review after that.

Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are quite a few opportunities in this PR to use things like llvm::map_to_vector instead of for-loops etc, I didn't comment on each of them.

The documentation on the attribute is a decent start, but I think we should have a page explaining all the algebra in detail and with examples (not necessarily in this PR).

Groverkss and others added 2 commits March 10, 2026 14:16
Introduces the `iree_map` dialect and `PackMapAttr`, a layout map
defined by a (Shape, Stride) pair of hierarchical IntTuples. Provides
layout algebra operations (compose, complement, logicalDivide,
logicalProduct, filter, rightInverse, etc.) for use in vector
distribution passes.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just drive-by-nits, I only skimmed the PR

@Groverkss Groverkss requested a review from kuhar March 10, 2026 17:12
Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(don't wait for my approval on this, I don't have cycles to meaningfully review unfortunately, but overall +1 for using cute layouts)

Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor stuff.

Copy link
Collaborator

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some more comments, but someone needs to work through the algebra here . Its definitely interesting, but it might be better for someone with hands on keyboard to use this. @sommerlukas maybe to verify all the algebra here. Otherwise I think the algebra methods could be tested better, but I dont think it is a blocker. Could lead to subtle bugs though.

@Groverkss Groverkss enabled auto-merge (squash) March 11, 2026 11:21
@Groverkss Groverkss merged commit 00b956a into iree-org:main Mar 11, 2026
55 of 56 checks passed
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.

4 participants