-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【CINN】Schedule simplify binding under static shape #69164
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
你的PR提交成功,感谢你对开源项目的贡献! |
… replace_simplify
… replace_simplify
@@ -37,6 +38,9 @@ Expr PrecedingAxisToAbsOffset(const std::vector<Expr> &shape, | |||
|
|||
Expr CastIfNeeded(Expr body, Type type); | |||
|
|||
ir::IndexExpr MergeMulMod(SymbolicExprAnalyzer *analyzer, |
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.
加些注释说明
// Get outter loops of current loops. | ||
Expr root = this->GetRootBlock(loop); | ||
std::vector<Expr> outter_loops = GetLoopsOfExpr(loop, root); | ||
|
||
// TODO(liujinnan): Deal dynamic shape. | ||
if (!ContainDynamicShape(root)) { | ||
// Create an analyzer of outter loops and new fused loop. | ||
std::vector<Expr> combine_loops = outter_loops; | ||
combine_loops.push_back(new_node); | ||
common::cas_intervals_t var_intervals_t = | ||
common::CollectVarIntervalsOfExprs(combine_loops); | ||
common::SymbolicExprAnalyzer ana{var_intervals_t}; | ||
|
||
// Simplify the bindings of new fused loop. | ||
VLOG(4) << "Before SimplifyBindings in split, ir is:\n" << new_node; | ||
common::SimplifyBlockBinding::SimplifyBindings(new_node, outter_loops, ana); | ||
VLOG(4) << "After SimplifyBindings in split, ir is:\n" << new_node; | ||
} |
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.
这段代码重复的有点多,看能不能提取一下
PR Category
CINN
PR Types
New features
Description
IsDynamic
to determine whether the expression contains dynamic shape.Cast::Make
, if it is IndexExpr and is converted to int64, avoid explicit cast and directly modify theIndexExpr
type.IterExpr
simplification process under static shape.IterExpr
TODO:Change name of simplify_corner_case.cc to simplify_special_case.cc
Pcard-67164