-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Addressing ipg Buffer Data Race Condition in Zero Stage2 #3727
Open
xxr3376
wants to merge
18
commits into
microsoft:master
Choose a base branch
from
xxr3376:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
xxr3376
requested review from
jeffra,
tjruwase,
samyam and
mrwyattii
as code owners
June 9, 2023 11:17
tjruwase
approved these changes
Jun 9, 2023
@xxr3376 - looks like a test is still failing on this PR |
@xxr3376 - I believe this PR is no longer needed as currently written given the changes to this file. Could you double check on the merge conflicts though? |
@xxr3376 - curious if you believe this PR is still needed? |
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.
This Pull Request addresses a potential gradient data corruption issue stemming from an update made in #2500. That PR introduced changes to the synchronization pattern that enabled overlap of communication and backward computation in ZERO stage2. However, it also inadvertently resulted in a potential data race condition due to the lack of synchronization before reusing the ipg buffer.
To rectify this issue, this PR adds the missing synchronization back. A finish event is recorded for the reduction stream of each ipg buffer. This modification ensures that before reusing a buffer, we ascertain the previous reader has completed its tasks, thereby preventing the possibility of data corruption.
This fix has been thoroughly tested on a pretraining model spread across more than 60 nodes. It has effectively addressed the issue, evidenced by the corrected convergence curve. As expected, the FLOPS performance saw a slight decline due to the added synchronization.