-
Notifications
You must be signed in to change notification settings - Fork 682
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
remove useless pipeline buffer between cpu to stage 0 #8484
+1
−1
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
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8484/ |
Speed stats:
|
strint
approved these changes
Jun 24, 2022
leaves-zwx
approved these changes
Jun 24, 2022
oneflow-ci-bot
requested review from
oneflow-ci-bot
and removed request for
oneflow-ci-bot
June 24, 2022 17:47
oneflow-ci-bot
requested review from
oneflow-ci-bot
and removed request for
oneflow-ci-bot
June 24, 2022 20:22
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8484/ |
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.
移除掉一个过渡设计:
Pipeline 并行下, CPU stage 0 到 GPU stage 0 之间插入过一个 buffer,且这 buffer = stage num * 2。
当时的想法是, cpu copy 到 gpu 的数据,可能被后向消费,如果没有 buffer ,则会阻碍 stage 0 的流水。
但实际情况是,我们一定会给 GPU stage 0 自动插入一个 identity(module 层级已经做好了这个 insert),而后向只可能消费这个 identity ,而不是 copy 到 gpu 的 regst。 而这个 identity 连向 backward 的边,一定会被识别为需要插入 buffer 的边,导致我们反向消费前向 identity 一定可以经过 buffer。 因此 前向 cpu 0 到 gpu 0 不需要再额外插入 buffer。
同时这个还会解决一个 bug,即 : img gpu decoder ,会消费一个 cpu 上的 kTensorBuffer 数据(non POD 类型的,二级指针)。此时如果插入一个 identity buffer,则 buffer copy 这个就会出错。