-
Notifications
You must be signed in to change notification settings - Fork 453
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
Different nccl stream within EmbeddingKey alltoall and EmbeddingValue… #2570
base: main
Are you sure you want to change the base?
Conversation
Hi @zhaozheng09! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@@ -288,7 +288,7 @@ def __init__( | |||
), | |||
) | |||
self._dist = KJTAllToAll( | |||
pg=pg, | |||
pg=dist.new_group(), |
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.
It's not recommended to create a separate Process Group here; and could result in performance regressions / reduced reliability. This guidance is from prior studies; may no longer be valid, but would require benchmarking/understanding as to why.
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.
Indeed, when there are too many tables, there will be a lot of overhead in stream synchronization .
benchmarking: I will try put a small example .
why: alltoall embedding keys
is independent with other nccl communication, it not need wait after alltoall sparse gradient
and allreduce dense gradient
in previous back propagation. if you put alltoall embedding key
and alltoall sparse gradient
and allreduce dense gradient
to a stream, they maybe be block with each other in pipeline mode.
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.
As per trace, it seems your able to trigger multiple comms stream, but at least based on my historical understanding this divides bandwidth of nccl stream; and results in less total throughput.
Worth maybe sharing results + confirming cpu is running ahead of gpu for clean comparison.
I reproduced this PR on DLRM. I got 5% preformance.
|
What should I do ? or What else do I need to prove? or Do you approve of this PR ? If you approve this PR, I need to close it quickly. thx. @dstaay-fb |
Now all nccl kernels are launched in one stream in pipeline mode, all nccl kernels will be waited each other if these ops conflict. We classified all nccl ops:
They have no interdependence at all, so I change to a new stream .
Compare:
before:
after: