-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[PIR+CINN]refactor cinn pir compiler temp buffer #60562
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+CINN]refactor cinn pir compiler temp buffer #60562
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
❌ The PR is not created using PR's template. You can refer to this Demo. |
|
Sorry to inform you that 55e869b's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
… factor_pir_temp_buffers
|
|
||
| using cinn::hlir::op::ExternalApiRegistry; | ||
|
|
||
| // Collect the temporary tensors from a computational graph. |
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.
这个如果没有额外依赖的话,建议放到cinn/lang/lower.cc中,与lang::GetTempBuffers 其他函数放到一起。
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.
看了下lang的namespace下已经有一个同名函数了,但可以在function name区分下?
| } | ||
|
|
||
| std::vector<ir::Buffer> temp_buffers; | ||
| for (auto& i : name_to_buffer) temp_buffers.push_back(i.second); |
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.
虽然for的body只有一行,也建议用{}包裹一下
| !tensor_arg_names.count(x->as_tensor()->name)) || | ||
| utils::Endswith(x->as_tensor()->buffer->name, "temp_buffer")); | ||
| }); | ||
| for (auto& e : all_temp_tensors) { |
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.
这里相对于旧的逻辑少了CollectIRNodesWithoutTensor,这个是符合预期的吗?
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.
我理解是符合预期的
Aurelius84
left a comment
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 types
Function optimization
PR changes
Others
Description
Pcard-67164
优化 pir compiler内部的buffer 构造逻辑,移除无用的stage的参数;该重构只是一个准备性的改造,目的是为了后续codegen阶段的逻辑优化,当前是由多处构造temp buffer的逻辑,这些逻辑相同,但是实现不统一