Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #833 +/- ##
=======================================
Coverage 79.06% 79.06%
=======================================
Files 24 24
Lines 2040 2040
=======================================
Hits 1613 1613
Misses 427 427 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Benchmark ResultsShow table
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
The spawned task's work is ordered after its parent's on the device, but code in the task that touches the parent's results without going through the backend, e.g., an MPI call on a GPU buffer, needs to synchronize first. Some backends currently happen to do so implicitly, which is not something to rely on.
maleadt
force-pushed
the
tb/spawn-host-access
branch
from
October 4, 2026 08:26
5571d1f to
f3c60b0
Compare
This branch has not been deployed
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.
#817 showed that
@spawnloses most of its overlap on CUDA. The spawned task's first use of an array from the parent made CUDA.jl wait for everything the parent had queued, even thoughwait_eventhad already ordered the child's work after the parent's. The fix belongs in CUDA.jl (JuliaGPU/CUDA.jl#3329 and #3328), but two parts of the@spawncontract were never written down:@spawnorders work on the device; it doesn't wait for the parent's work on the host. Code in the spawned task that passes the parent's results to something outside the backend, like an MPI call on a GPU buffer, needs them to be ready first. CUDA.jl takes care of that when such code takes the buffer's pointer, but other backends may not, so portable code should callsynchronize.wait_eventsets up. Otherwise the spawned task's first use of a shared array waits for everything the parent queued, including work queued after@spawn. Other reasons to synchronize, like cross-device access, still apply.Closes #817, together with the CUDA.jl PRs.