-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add ShouldConvertDataLayoutForOp()
API to allow EPs to customize layout sensitive ops
#25147
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
Conversation
What is the difference between the newly added interface and the existing |
GetPreferredLayout returns a single preferred layout value for the whole EP. some EPs have further customization of what ops should be considered layout sensitive. this is hardcoded here currently: onnxruntime/onnxruntime/core/optimizer/layout_transformation/layout_transformation.cc Lines 72 to 117 in 3a47bd2
this new interface provides a way for EPs to specify this originally hardcoded logic. |
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.
You can commit the suggested changes from lintrunner.
IExecutionProvider::ShouldConvertNodeLayoutToNhwc()
to allow EPs to customize layout sensitive opsShouldConvertNodeLayoutToNhwc()
API to allow EPs to customize layout sensitive ops
ShouldConvertNodeLayoutToNhwc()
API to allow EPs to customize layout sensitive opsShouldConvertDataLayoutForOp()
API to allow EPs to customize layout sensitive ops
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.
…yout sensitive ops (microsoft#25147) ### Description <!-- Describe your changes. --> Add `IExecutionProvider::ShouldConvertDataLayoutForOp()` to allow EPs to customize layout sensitive ops. Move existing hardcoded EP-specific logic out of layout transformer code. Add `OrtEp::ShouldConvertDataLayoutForOp` to ABI EP API to allow similar customization by plugin EPs. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Enable layout sensitive op customization through internal EP interface and the ABI EP API.
Description
Add
IExecutionProvider::ShouldConvertDataLayoutForOp()
to allow EPs to customize layout sensitive ops. Move existing hardcoded EP-specific logic out of layout transformer code.Add
OrtEp::ShouldConvertDataLayoutForOp
to ABI EP API to allow similar customization by plugin EPs.Motivation and Context
Enable layout sensitive op customization through internal EP interface and the ABI EP API.