[Codegen] Add iree_map dialect with PackMapAttr#23671
[Codegen] Add iree_map dialect with PackMapAttr#23671Groverkss merged 4 commits intoiree-org:mainfrom
Conversation
|
I will send more information on discord or an RFC |
MaheshRavishankar
left a comment
There was a problem hiding this comment.
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.
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.td
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Outdated
Show resolved
Hide resolved
sommerlukas
left a comment
There was a problem hiding this comment.
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).
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
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]>
8e74bd2 to
796b768
Compare
kuhar
left a comment
There was a problem hiding this comment.
just drive-by-nits, I only skimmed the PR
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapDialect.cpp
Outdated
Show resolved
Hide resolved
kuhar
left a comment
There was a problem hiding this comment.
(don't wait for my approval on this, I don't have cycles to meaningfully review unfortunately, but overall +1 for using cute layouts)
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/unittests/PackMapTest.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Map/IR/IREEMapAttrs.cpp
Outdated
Show resolved
Hide resolved
MaheshRavishankar
left a comment
There was a problem hiding this comment.
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.
Introduces the
iree_mapdialect andPackMapAttr, 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.