-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[PIR][Inference] add layout_transformation_interface for later transfer_layout_pass #63286
Merged
kangguangli
merged 6 commits into
PaddlePaddle:develop
from
kangguangli:layout_transformation_interface
Apr 9, 2024
Merged
[PIR][Inference] add layout_transformation_interface for later transfer_layout_pass #63286
kangguangli
merged 6 commits into
PaddlePaddle:develop
from
kangguangli:layout_transformation_interface
Apr 9, 2024
Conversation
This file contains 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
你的PR提交成功,感谢你对开源项目的贡献! |
…transformation_interface
kangguangli
requested review from
winter-wang,
yuanlehome,
vivienfanghuagood and
zhangbo9674
April 7, 2024 11:26
kangguangli
commented
Apr 7, 2024
template <> | ||
void RewriteByLayoutImpl<FusedConv2dAddActOp>(pir::Operation* op, | ||
common::DataLayout new_layout) { | ||
return; |
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.
暂时留空,后面写pass的时候补上
winter-wang
previously approved these changes
Apr 7, 2024
vivienfanghuagood
approved these changes
Apr 7, 2024
zhangbo9674
previously approved these changes
Apr 7, 2024
kangguangli
dismissed stale reviews from zhangbo9674 and winter-wang
via
April 8, 2024 08:20
1e1327e
winter-wang
approved these changes
Apr 9, 2024
co63oc
pushed a commit
to co63oc/Paddle
that referenced
this pull request
Apr 9, 2024
…er_layout_pass (PaddlePaddle#63286) * add layout_transformation_interface for later transfer_layout_pass * remove comment * refine * fix windows ci * fix windows ci
co63oc
pushed a commit
to co63oc/Paddle
that referenced
this pull request
Apr 10, 2024
…er_layout_pass (PaddlePaddle#63286) * add layout_transformation_interface for later transfer_layout_pass * remove comment * refine * fix windows ci * fix windows ci
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.
PR Category
Execute Infrastructure
PR Types
Devs
Description
This PR adds
LayoutTransformationInterface
, which is used fortransfer_layout_pass
to determine which layout allows an operation to achieve the best performance.LayoutTransformationInterface
has four member functions:PreferLayout
, receives an operation as input and judges the layout that this operation will perform best by its attributes、inputs or operation kind and so on. This can be overloaded. If not, its result isAllLayout
which means it can be modified freely.RewriteByLayout
, receives an operation and a new layout as input, exectutes after we choose a new layout and rewrite the operation's attributes. This must be overloaded, otherwise it throws an error.RelevantInputs
, receives an operation as input, returns the part of op's inputs that affects its kernel layout. This can be overloaded. If not, its result is all inputs of the op.RelevantOutputs
, receives an operation as input, returns the part of op's outputs that are affected by its kernel layout. This can be overloaded. If not, its result is all outputs of the op.To register this inferface for an op after this PR, you will need to modify 3 files:
ops.yaml
, to add following code:interfaces : paddle::dialect::LayoutTransformationInterface
paddle/fluid/pir/dialect/operator/interface/layout_transformation.hpp
, to add the template declaration. Note that you need a forward declaration to avoid circular reference and only declare those members that you need to overload.paddle/fluid/pir/dialect/operator/interface/layout_transformation.cc
, to add the specialized template implementationOthers
Pcard-67164