Repository navigation
Thread safety fixes - #3229
Merged
Merged
Thread safety fixes#3229
Conversation
Argument conversion used to migrate stream ownership and mark allocations dirty before any matching launch was submitted, so another task could take ownership between conversion and enqueue and leave later work invisible to synchronization. Make conversion metadata-pure while collecting each reached Managed allocation into KernelCall, then deduplicate and lock those allocations in stable lock-object order, transfer ownership to the actual launch stream, and hold the locks through backend submission. Host conversion, explicit synchronization, unified-memory prefetch, and pool return participate in the same per-allocation protocol.
Reflection and direct callers can bypass cufunction_lock, so concurrent cache misses could construct duplicate configurations and mutate the shared Dict at the same time. Serialize only the lookup, configuration construction, and insertion with a dedicated reentrant lock and use get! for the atomic cache operation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3229 +/- ##
==========================================
+ Coverage 92.19% 92.27% +0.08%
==========================================
Files 184 184
Lines 15903 15903
==========================================
+ Hits 14661 14674 +13
+ Misses 1242 1229 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Counterpart of JuliaGPU/OpenCL.jl#472