-
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
【静态图性能优化】Event analysis 共享 #55588
Closed
Closed
【静态图性能优化】Event analysis 共享 #55588
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… share_event_analyzer
… share_event_analyzer
… share_event_analyzer
… share_build_results
… share_event_analyzer
… share_event_analyzer
你的PR提交成功,感谢你对开源项目的贡献! |
AndSonder
force-pushed
the
share_event_analyzer
branch
from
July 23, 2023 06:24
6dc535f
to
8f49def
Compare
当下的实现方案是将 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Performance optimization
PR changes
Others
Description
复用信息分析:
在Paddle中,事件分析器(event analyzer)发生在Convert过程中。事件分析器的主要作用是为不同op的执行添加Event进行同步,便于后续并行。对于一样的子图,事件分析器分析的结果是一样的,因此可以进行复用。
事件分析器依赖于图依赖分析的结果,其核心逻辑在 stream_analyzer_.ConstructEvents 中实现。主要逻辑是通过Instruction的 AddEventToRecord 和 AddEventToWait 完成。分析的结果也是存储在vec_instruction_当中。
代码实现思路:
事件分析器的复用与op依赖复用类似,且vec_instruction_在op依赖复用中已进行复用。是否能共享的相关逻辑也与op依赖复用相同。因此在实现了op依赖的复用后只需要添加共享后跳过事件分析部分的代码即可。
对于跳过共享相关的逻辑可以通过判断vec_instruction_里Instruction的event_to_record_和events_to_wait_是否有数据来判断。
详细介绍见Issue: