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

[TEXPR][PASS] Fix thread all reduce to avoid write after read hazzard #2937

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Mar 31, 2019

The bug was rare but can affect some of the code. Insert explicit sync before write to shared memory in thread_allreduce

__shared__ sbuf[65]
loop:
    // need add sync here, before the read may not yet finished.
    __syncthreads();
    sbuf[threadIdx.x] = x
    // all reduce code ...
    // read
    result = sbuf[0]

@tqchen
Copy link
Member Author

tqchen commented Mar 31, 2019

Fixes #2767

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.

1 participant