Skip to content

Stop precompiling GPUToolbox's wait internals - #3662

Merged
maleadt merged 1 commit into
mainfrom
tb/gputoolbox-precompile
Dec 3, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/gputoolbox-precompile

Conversation

@maleadt

@maleadt maleadt commented Dec 2, 2026

Copy link
Copy Markdown
Member

GPUToolbox 3.8 caches what a wait worker calls along with cooperative_wait (JuliaGPU/GPUToolbox.jl#49), so the perform! statements #3659 added to precompile.jl are no longer needed. They named GPUToolbox internals and copied the result type it infers for worker_synchronize, so they would have broken CUDACore's precompilation, or silently stopped matching, when either changed.

With these statements removed and GPUToolbox 3.8, the first synchronizing launch on an RTX 5080 (Julia 1.12) still compiles no perform!.

GPUToolbox 3.8 caches what a wait worker calls along with
`cooperative_wait` (JuliaGPU/GPUToolbox.jl#49), so CUDACore no longer has
to precompile `perform!` for GPUToolbox's internal request types, which
depended on their names, parameters and the inferred result type.
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.86%. Comparing base (3f940e3) to head (79982ee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3662      +/-   ##
==========================================
- Coverage   88.51%   85.86%   -2.65%     
==========================================
  Files         203      203              
  Lines       22057    22052       -5     
==========================================
- Hits        19523    18935     -588     
- Misses       2534     3117     +583     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

Compared with 3f940e353, the merge base.
The environment differs from the baseline's: SPIRV_LLVM_Backend_jll 23.1.4+6 → 23.1.4+7.

Times are the minimum time of every benchmark. A change is unusual when it exceeds both three times the benchmark's typical change between consecutive runs on the default branch and a minimum per category (performance 3%, latency 5%, applications 3%, other 3%). A benchmark that starts or stops allocating is listed however few the allocations. A single run can still be a fluke, so rerun before drawing conclusions.

Geometric mean Unusual: slower Unusual: faster Compared
Performance +1.1% 1 0 79
Latency −0.1% 0 0 3
Applications −0.0% 0 0 6
Benchmark Baseline This PR Change
Performance
array/reductions/mapreduce/Int64/dims=2 26.9 µs 28.3 µs +5.3% 🔴 slower
All benchmarks
Benchmark Baseline This PR Change
Performance
array/accumulate/Float32/1d 43.7 µs 44.4 µs +1.6%
array/accumulate/Float32/dims=1 30.2 µs 31.5 µs +4.4%
array/accumulate/Float32/dims=1L 96.2 µs 97.5 µs +1.4%
array/accumulate/Float32/dims=2 48.2 µs 49.9 µs +3.4%
array/accumulate/Float32/dims=2L 369 µs 366 µs −0.9%
array/accumulate/Int64/1d 67.2 µs 68.5 µs +2.0%
array/accumulate/Int64/dims=1 40.6 µs 41.8 µs +2.9%
array/accumulate/Int64/dims=1L 140 µs 140 µs +0.4%
array/accumulate/Int64/dims=2 70.6 µs 71.9 µs +2.0%
array/accumulate/Int64/dims=2L 770 µs 762 µs −1.0%
array/broadcast 10.8 µs 10.6 µs −1.8%
array/broadcast launch 5.81 µs 5.73 µs −1.4%
array/construct 1.32 µs 1.32 µs +0.5%
array/copy 17.6 µs 17.7 µs +0.8%
array/copyto!/cpu_to_gpu 206 µs 207 µs +0.2%
array/copyto!/gpu_to_cpu 239 µs 240 µs +0.3%
array/copyto!/gpu_to_gpu 12.0 µs 12.0 µs +0.1%
array/iteration/findall/bool 47.4 µs 48.5 µs +2.4%
array/iteration/findall/int 59.1 µs 58.3 µs −1.3%
array/iteration/findfirst/bool 32.1 µs 33.0 µs +2.8%
array/iteration/findfirst/int 33.2 µs 33.6 µs +1.0%
array/iteration/findmin/1d 63.5 µs 64.1 µs +0.9%
array/iteration/findmin/2d 39.3 µs 41.7 µs +6.0%
array/iteration/logical 47.0 µs 48.9 µs +4.1%
array/iteration/scalar 57.0 µs 58.2 µs +2.1%
array/permutedims/2d 55.0 µs 55.0 µs +0.0%
array/permutedims/3d 51.4 µs 51.6 µs +0.4%
array/permutedims/4d 43.0 µs 43.0 µs −0.0%
array/random/rand!/Float32 9.82 µs 9.83 µs +0.2%
array/random/rand!/Int64 16.2 µs 16.3 µs +0.3%
array/random/rand/Float32 11.7 µs 12.0 µs +2.7%
array/random/rand/Int64 20.8 µs 20.8 µs +0.4%
array/random/randn!/Float32 29.3 µs 29.6 µs +1.0%
array/random/randn/Float32 39.0 µs 39.4 µs +1.2%
array/reductions/mapreduce/Float32/1d 30.1 µs 31.0 µs +2.8%
array/reductions/mapreduce/Float32/dims=1 17.5 µs 18.2 µs +4.4%
array/reductions/mapreduce/Float32/dims=1L 54.0 µs 54.7 µs +1.3%
array/reductions/mapreduce/Float32/dims=2 24.3 µs 25.3 µs +4.1%
array/reductions/mapreduce/Float32/dims=2L 60.8 µs 61.4 µs +1.0%
array/reductions/mapreduce/Int64/1d 31.1 µs 31.4 µs +1.0%
array/reductions/mapreduce/Int64/dims=1 19.7 µs 20.7 µs +5.2%
array/reductions/mapreduce/Int64/dims=1L 92.5 µs 93.7 µs +1.4%
array/reductions/mapreduce/Int64/dims=2 26.9 µs 28.3 µs +5.3% 🔴 slower
array/reductions/mapreduce/Int64/dims=2L 96.0 µs 97.5 µs +1.5%
array/reductions/reduce/Float32/1d 29.5 µs 30.4 µs +3.1%
array/reductions/reduce/Float32/dims=1 17.6 µs 18.1 µs +2.4%
array/reductions/reduce/Float32/dims=1L 54.0 µs 55.0 µs +2.0%
array/reductions/reduce/Float32/dims=2 24.3 µs 25.5 µs +5.0%
array/reductions/reduce/Float32/dims=2L 60.9 µs 62.0 µs +1.8%
array/reductions/reduce/Int64/1d 30.6 µs 31.5 µs +2.9%
array/reductions/reduce/Int64/dims=1 19.8 µs 20.8 µs +5.1%
array/reductions/reduce/Int64/dims=1L 92.8 µs 93.7 µs +1.0%
array/reductions/reduce/Int64/dims=2 26.6 µs 27.8 µs +4.5%
array/reductions/reduce/Int64/dims=2L 96.0 µs 97.3 µs +1.3%
array/reverse/1d 19.1 µs 19.6 µs +2.7%
array/reverse/1d_inplace 12.0 µs 12.2 µs +1.6%
array/reverse/1dL 73.0 µs 73.5 µs +0.7%
array/reverse/1dL_inplace 68.7 µs 68.8 µs +0.2%
array/reverse/2d 23.1 µs 23.6 µs +2.0%
array/reverse/2d_inplace 15.1 µs 15.3 µs +1.0%
array/reverse/2dL 92.5 µs 93.1 µs +0.6%
array/reverse/2dL_inplace 69.4 µs 69.8 µs +0.5%
array/sorting/1d 825 µs 826 µs +0.1%
array/sorting/2d 248 µs 248 µs +0.1%
array/sorting/by 966 µs 967 µs +0.1%
cuda/graph/capture 25.0 µs 24.7 µs −1.1%
cuda/graph/eager 24.9 µs 24.7 µs −0.5%
cuda/graph/launch 16.6 µs 16.6 µs +0.3%
cuda/synchronization/context/auto 1.88 µs 1.85 µs −1.6%
cuda/synchronization/context/blocking 661 ns 682 ns +3.2%
cuda/synchronization/context/nonblocking 5.51 µs 4.63 µs −15.9%
cuda/synchronization/stream/auto 602 ns 577 ns −4.1%
cuda/synchronization/stream/blocking 539 ns 545 ns +1.2%
cuda/synchronization/stream/nonblocking 6.46 µs 6.39 µs −1.0%
kernel/indexing 11.7 µs 11.7 µs −0.3%
kernel/indexing_checked 12.3 µs 12.3 µs +0.1%
kernel/launch 1.44 µs 1.47 µs +2.1%
kernel/occupancy 30.0 ns 30.1 ns +0.4%
kernel/rand 16.2 µs 16.2 µs +0.2%
Latency
import 3.90 s 3.90 s +0.1%
precompile 6.34 s 6.31 s −0.4%
ttfp 4.28 s 4.28 s +0.0%
Applications
byval/reference 145 µs 145 µs −0.0%
byval/slices=1 146 µs 146 µs +0.0%
byval/slices=2 286 µs 286 µs +0.0%
byval/slices=3 426 µs 426 µs −0.0%
cudadevrt 104 µs 104 µs −0.1%
volumerhs 10.3 ms 10.3 ms +0.0%

History: https://juliagpu.org/perf/?pkg=cuda

@maleadt
maleadt merged commit b045a64 into main Dec 3, 2026
19 checks passed
@maleadt
maleadt deleted the tb/gputoolbox-precompile branch December 3, 2026 05:30
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.

1 participant