-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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.13] Update UpdateBufferAxis pass #70533
base: develop
Are you sure you want to change the base?
[CINN][Backend Pass Update No.13] Update UpdateBufferAxis pass #70533
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
AnalyzeBufferAxis analyzeBufferAxis; | ||
analyzeBufferAxis(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.
这里注意遵守变量命名规范,保持buffer_axis_analyzer即可
8f62f90
to
04b82bf
Compare
if (stmt->bind_info().valid()) { | ||
var_bind_threads.insert(stmt->loop_var()->name); | ||
StmtMutator::VisitBlock(stmt->body()); | ||
var_bind_threads.erase(stmt->loop_var()->name); | ||
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.
这里为什么不使用is_gpu_thread_binded()呢
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.
之前没发现Stmt的For继承了Forbase,我后面改一下
class AnalyzeBufferAxis : public ir::IRMutator<>, | ||
public ir::stmt::StmtMutator<> { |
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.
Analyze阶段使用StmtVisitor就可以了,这里没有mutate
5101d54
to
cad554d
Compare
d173a55
to
ecbd3b5
Compare
if (stmt->bind_info().valid()) { | ||
var_bind_threads.insert(stmt->loop_var()->name); | ||
StmtMutator::VisitBlock(stmt->body()); | ||
var_bind_threads.erase(stmt->loop_var()->name); | ||
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.
之前没发现Stmt的For继承了Forbase,我后面改一下
return; | ||
} | ||
FormalizeSingleIndex(tensor, &(store->indices)); |
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.
@Hongqing-work
之前的实现里面,有调用 FormalizeSingleIndex 更新 store 的 indices,我理解的是这里是应该继承 StmtMutator?
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.
嗯嗯,那目前还应该需要继承一下,后续IndexExpr能自动化简之后可以修改一下 @liuruyan
if (!tensor->buffer.defined() || | ||
tensor->buffer->memory_type == ir::MemoryType::Heap) { | ||
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.
这里应该还是得继续Visit一下其它Expr,store的value里应该会有load
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
Improvements
Description
改造了 UpdateBufferAxis