CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CINN][Backend Pass Update No.2] Update eliminate_common_global_memory_read pass #70696
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][Backend Pass Update No.2] Update eliminate_common_global_memory_read pass #70696
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
if (optim::ArithSimplify(ir::Sub::Make(lhs_extent, rhs_extent)) == | ||
if (cinn::common::AutoSimplify(ir::Sub::Make(lhs_extent, rhs_extent)) == |
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.
这里不需要修改
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改成了ArithSimplify
buffer_size = optim::ArithSimplify(ir::Mul::Make( | ||
buffer_size = cinn::common::AutoSimplify(ir::Mul::Make( |
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.
同上
size = optim::ArithSimplify(ir::Add::Make(size, buffer_size)); | ||
size = cinn::common::AutoSimplify(ir::Add::Make(size, buffer_size)); |
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::IRMutator<>::Visit(op, expr); |
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.
这里需要继续往内部遍历到body吧
这个Pass应该也是个全局Pass,可以参考#70619 |
好的 |
ir::stmt::Store new_body = | ||
ir::stmt::_Store_::Make(new_tensor, | ||
ir::ir_utils::IRCopy(ir::Expr(load_node)), | ||
ir::ir_utils::IRCopy(load_node->indices)); | ||
ir::stmt::BlockRef new_block = ir::stmt::_Block_::Make({new_body}); | ||
ir::stmt::Schedule new_sch = | ||
ir::stmt::_Schedule_::Make(sch_node->iter_vars(), | ||
current_sch_->iter_values(), | ||
{}, | ||
{}, | ||
sch_node->name() + "_local", | ||
new_block); |
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.
这里可以直接用Store/BlockRef/Schedule的带参数构造方法,不需要把这些带_的类再暴露出来了
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.
好的
|
||
void VisitStmt(ir::stmt::Store stmt) override {} | ||
|
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.
store为什么要截断不访问呢
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-CI-Coverage里面挂了很多子图,可以本地复现一下看看啥问题 |
PR Category
CINN
PR Types
Improvements
Description
改造了 EliminateCommonGlobalMemoryRead pass