-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for external custom dispatch rewrite patterns #15235
Conversation
5d9d65c
to
7e5f809
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
compiler/src/iree/compiler/Dialect/HAL/Utils/ExternBuildingUtils.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/HAL/Utils/ExternBuildingUtils.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/HAL/Utils/ExternBuildingUtils.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/HAL/Utils/ExternBuildingUtils.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/HAL/Utils/ExternBuildingUtils.cpp
Outdated
Show resolved
Hide resolved
bb370ac
to
afc2a24
Compare
} | ||
|
||
module { | ||
pdl.pattern : benefit(1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stellaraccident with nod-ai/SHARK-ModelDev#108, I wanted to ask whether this still looks like a good path to go down. Essentially the idea was to allow users to specify patterns to match and replace a (flat) DAG with some custom dispatch call by specifying PDL patterns, but I'm thinking there are probably more user friendly ways to do it.
Currently custom dispatches must be written in as a part of downstream flows (targeting `hal.dispatch.extern` or Flow ops directly). This limits how lightweight deployment of custom dispatches with nearly stock IREE flows. This adds a mechanism to plugin and apply pdl patterns completely separate from other IR. This allows hermetically sealing the details of a custom dispatch as a separate IR module that is easy to reuse across models. The intent is to follow up to this patch with similar passes in the various input dialects to allow different potential rewrite points, as well as turn some of the rewriting utilities into transform operations as another way to represent the dispatch + rewrite logic without the need for C++ and a downstream project.
83476ee
to
1eb5abf
Compare
Closing as this is superseded by #16150 |
Currently custom dispatches must be written in as a part of downstream flows (targeting
hal.dispatch.extern
or Flow ops directly). This limits how lightweight deployment of custom dispatches with nearly stock IREE flows. This adds a mechanism to plugin and apply pdl patterns completely separate from other IR. This allows hermetically sealing the details of a custom dispatch as a separate IR module that is easy to reuse across models.The intent is to follow up to this patch with similar passes in the various input dialects to allow different potential rewrite points, as well as turn some of the rewriting utilities into transform operations as another way to represent the dispatch + rewrite logic without the need for C++ and a downstram project.