Skip to content

vulkan: Fix test-thread-safety crashes#17024

Merged
0cc4m merged 1 commit intoggml-org:masterfrom
jeffbolznv:thread_safety_compile_fix
Nov 8, 2025
Merged

vulkan: Fix test-thread-safety crashes#17024
0cc4m merged 1 commit intoggml-org:masterfrom
jeffbolznv:thread_safety_compile_fix

Conversation

@jeffbolznv
Copy link
Copy Markdown
Contributor

The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the same time, which needs to hold the lock. To be safe, hold the lock for all of ggml_vk_load_shaders.

See #16826 (comment)

The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the
same time, which needs to hold the lock. To be safe, hold the lock for all of
ggml_vk_load_shaders.
@jeffbolznv jeffbolznv requested a review from 0cc4m as a code owner November 5, 2025 15:46
@jeffbolznv
Copy link
Copy Markdown
Contributor Author

@Acly please let me know if this fixes it for you. It does on my system.

@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Nov 5, 2025
Copy link
Copy Markdown
Collaborator

@Acly Acly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good, I don't see crashes anymore with this.

Maybe we want a safer solution in the long run than scattering mutex-locks and atomics about in hopefully all the right places?

@0cc4m 0cc4m merged commit d6fe40f into ggml-org:master Nov 8, 2025
71 checks passed
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the
same time, which needs to hold the lock. To be safe, hold the lock for all of
ggml_vk_load_shaders.
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the
same time, which needs to hold the lock. To be safe, hold the lock for all of
ggml_vk_load_shaders.
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the
same time, which needs to hold the lock. To be safe, hold the lock for all of
ggml_vk_load_shaders.
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 Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants