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

Fix race condition bug in non-inplace ggml_compute_forward_diag_mask_f32 #1454

Merged
merged 4 commits into from
May 14, 2023

Conversation

xaedes
Copy link
Collaborator

@xaedes xaedes commented May 14, 2023

test-grad0.c catched a bug in ggml_compute_forward_diag_mask_f32 when running in threaded mode.

This only affects non-inplace occurences of diag_mask.

memcpy needs to be synchronized across threads to avoid race conditions, so just do it in INIT phase.

Use memcpy instead of the dup function, because the dup function just returns in INIT phase.

memcpy needs to be synchronized across threads to avoid race conditions.
=> do it in INIT phase
@ggerganov
Copy link
Member

I already made a fix for this in #1450

But will use your version as it is less hacky

@ggerganov
Copy link
Member

Resolve the CI error + conflict and will merge it

@xaedes
Copy link
Collaborator Author

xaedes commented May 14, 2023

Oh didnt see that commit with the fixes. Trailing whitespace removed. Do you resolve the conflict or should I?

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.

2 participants