Skip to content

ggml-cpu: fix data race for debug asserts#20148

Merged
JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler:ggml-fix-debug-data-race
Mar 6, 2026
Merged

ggml-cpu: fix data race for debug asserts#20148
JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler:ggml-fix-debug-data-race

Conversation

@JohannesGaessler
Copy link
Copy Markdown
Contributor

While debugging the CI for #19802 I noticed that for >= 2 threads there seems to be a data race in the asserts that are added in debug builds to the CPU backend. In debug builds some ops check whether the output tensor is NaN but this wasn't correctly adapted in some places to consider the i2 and i3 indices of the actual computation. So one thread can end up checking another thread's data, leading to a data race. There is no effect on release builds.

@JohannesGaessler JohannesGaessler merged commit 2850bc6 into ggml-org:master Mar 6, 2026
78 checks passed
bartowski1182 pushed a commit to bartowski1182/llama.cpp that referenced this pull request Mar 10, 2026
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants