-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
zero3 performance optimizations #3622
Merged
Merged
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
params_already_reduced is not used
Debug strings are evaluated even when logging is disabled
BacharL
requested review from
jeffra,
tjruwase,
samyam and
mrwyattii
as code owners
May 28, 2023 12:35
BacharL
force-pushed
the
perf1
branch
3 times, most recently
from
May 29, 2023 08:35
a942dfa
to
3a87dfa
Compare
Use allreduce instead of reduce scatter. lower cpu overhead.
BacharL
force-pushed
the
perf1
branch
2 times, most recently
from
May 29, 2023 12:43
d6a8711
to
bd4d724
Compare
Don't check overflow in gradients for every bucket. Do overflow chack once on grad flat buffer just before optimizer step
tjruwase
reviewed
May 30, 2023
tjruwase
reviewed
May 30, 2023
tjruwase
reviewed
May 30, 2023
tjruwase
reviewed
May 30, 2023
tjruwase
reviewed
May 30, 2023
@hablb, thanks for this PR. It looks like it could yield some decent performance gains. To appropriately capture the significance, please consider updating the original post with perf results similar to #1453 (comment). |
tjruwase
approved these changes
Jun 7, 2023
molly-smith
pushed a commit
that referenced
this pull request
Jun 23, 2023
* Remove dead code params_already_reduced is not used * Prevent evaluation of debug strings Debug strings are evaluated even when logging is disabled * Use contiguous gradients tensor reduce scatter between ranks Use allreduce instead of reduce scatter. lower cpu overhead. * move overflow tracker to optimizer.step Don't check overflow in gradients for every bucket. Do overflow chack once on grad flat buffer just before optimizer step --------- Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
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.
Results:
Single server with 8x V100 GPUs
ZeRO Stage3, not using any CPU/disk offload, and contiguous gradients enabled
Bert 1.5B, zero3, fp16, adamw optimizer, global batch 1024
average_perf_per_step:
micro batch 8, comm_overlap=false 6.86 -> 8.66
micro batch 8, comm_overlap=true 6.88 -> 8.75
micro batch 32, comm_overlap=false 24.87 -> 34.13
micro batch 32, comm_overlap=true 24.95 -> 32.13
Single server with 8x A100 GPUs
ZeRO Stage3, not using any CPU/disk offload, and contiguous gradients enabled
Bert 1.5B, zero3, fp16, adamw optimizer, global batch 1024
average_perf_per_step:
micro batch 32, comm_overlap=false 42 -> 56