-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【静态图性能优化】Share event #55650
【静态图性能优化】Share event #55650
Conversation
// Note(sonder): Share build results don't work for new IR now. | ||
if (type_to_first_id.count(job_type) != 0 && | ||
!FLAGS_enable_new_ir_in_executor) { | ||
interpretercores_[job_idx]->ShareBuildResultsFrom( |
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.
当type_to_first_id[job_type]==job_idx
时,interpretercore自己跟自己share,是否会有问题?
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.
当
type_to_first_id[job_type]==job_idx
时,interpretercore自己跟自己share,是否会有问题?
不会,在ShareBuildResults里有判断
if (is_shared_results_build_ || !src.IsSharedResultsBuild()) {
return;
}
for (size_t i = 1; i < ids.size(); ++i) { | ||
interpretercores_[ids[i]]->ShareBuildResultsFrom( | ||
interpretercores_[ids[0]]); | ||
if (type_to_first_id.count(jobs[job_idx]->Type()) == 0) { |
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.
计算type_to_first_id
时,是否需要从job_idx=0
开始遍历?
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.
计算
type_to_first_id
时,是否需要从job_idx=0
开始遍历?
有直接将job_idx=0的job_type加入到 unordered_map
中
type_to_first_id[jobs[0]->Type()] = 0;
for (size_t job_idx = 1; job_idx < jobs.size(); ++job_idx) {
interpretercores_[job_idx]->ShareWorkQueueFrom(interpretercores_[0]);
...
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
* add sharing event info * add sharing event info * fix * remove const * add flag * fix
* add sharing event info * add sharing event info * fix * remove const * add flag * fix
PR types
Performance optimization
PR changes
Others
Description
Paddle 的 Event 机制主要用于多流之间的同步,在预分析阶段需要根据
op_func_node
去分析相关的信息。对于相同子图的Interpretercore,Event分析的结果可以共享。 本 PR 实现了相同子图Interpretercore之间Event分析信息的共享。详细介绍见Issue: