-
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
[CINN] Add FactorizeReduction schedule primitive #57777
[CINN] Add FactorizeReduction schedule primitive #57777
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
return rf_tensor; | ||
} | ||
|
||
class ReduceBlockCreater { |
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.
Since naming "Reduce Block" is every common in CINN, could you add one sentence comment for ReduceBlockCreater
that it is used to create reduce block in FactorizeReduction
Same for RBBlockCreater, add a comment that it is used for writing back
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.
done
@@ -120,6 +120,7 @@ class ScheduleImpl { | |||
void ReverseComputeInline(const Expr& schedule_block); | |||
void Bind(const Expr& loop, const std::string& thread_axis); | |||
Expr Rfactor(const Expr& rf_loop, int rf_axis); | |||
Expr FactorizeReduction(const Expr& rf_loop, int rf_axis); |
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.
ir_schedule.cc is too long to maintain now ....
I suggest you have following file structure
- paddle/cinn/ir/schedule
- factorize_reduction.h .cc or folder if you also split util files
- ir_schedule.h .cc which include factorize_reduction.h
Then developers still include ir_schedule.h
and they can use factorize_reduction, our file is also short.
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.
Created a new file factorize_reduction.h and has moved the core implementation of this primitive to this file. However, the interface function FactorizeReduction and function implementation are still preserved in ir_schedule.cc, because this is a member function, and other member functions are called in it.
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.
In the future PR, we should still move it.
Sorry to inform you that 5b676c1's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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.
LGTM but agreed on we should move some implementations of ir_schedule.cc because the file is too long now.
Add FactorizeReduction schedule primitive. The difference between FactorizeReduction primitive and the original RFactor primitive are: FactorizeReduction supports complex iters_value subscript, which means that FactorizeReduction can be used after using primitives such as Fuse and Split, and RFactor does not support this. FactorizeReduction does not change the order of the original loop, while RFactor may have an implicit Reorder. FactorizeReduction supports the transformation of one reduce block in a complex AST, while RFactor only supports the case where the AST is entirely composed of one reduce block.
Add FactorizeReduction schedule primitive. The difference between FactorizeReduction primitive and the original RFactor primitive are: FactorizeReduction supports complex iters_value subscript, which means that FactorizeReduction can be used after using primitives such as Fuse and Split, and RFactor does not support this. FactorizeReduction does not change the order of the original loop, while RFactor may have an implicit Reorder. FactorizeReduction supports the transformation of one reduce block in a complex AST, while RFactor only supports the case where the AST is entirely composed of one reduce block.
Add FactorizeReduction schedule primitive. The difference between FactorizeReduction primitive and the original RFactor primitive are: FactorizeReduction supports complex iters_value subscript, which means that FactorizeReduction can be used after using primitives such as Fuse and Split, and RFactor does not support this. FactorizeReduction does not change the order of the original loop, while RFactor may have an implicit Reorder. FactorizeReduction supports the transformation of one reduce block in a complex AST, while RFactor only supports the case where the AST is entirely composed of one reduce block.
PR types
Others
PR changes
Others
Description
Pcard-74042
Add FactorizeReduction schedule primitive.
The difference between FactorizeReduction primitive and the original RFactor primitive are: