Skip to content
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
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

xxr3376
Copy link

@xxr3376 xxr3376 commented Jun 9, 2023

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.

@loadams loadams enabled auto-merge (squash) June 13, 2023 22:42
@loadams loadams disabled auto-merge June 13, 2023 23:49
@tjruwase tjruwase added the merge-queue PRs ready to merge label Jul 11, 2023
@loadams
Copy link
Contributor

loadams commented Jul 24, 2023

@xxr3376 - looks like a test is still failing on this PR

@loadams
Copy link
Contributor

loadams commented Sep 25, 2023

@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?

@loadams loadams self-assigned this Sep 25, 2023
@loadams loadams removed the merge-queue PRs ready to merge label Sep 25, 2023
@loadams
Copy link
Contributor

loadams commented Oct 28, 2024

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants