Repository navigation
Request the RNG initialization with GPUCompiler.deferred_codegen! - #998
Conversation
Instead of registering the job in `deferred_codegen_jobs` under `length + 1`, which races with concurrent compilations, and emitting the marker by hand. This needs GPUCompiler 2.25.
6a9edb8 to
dfb34a0
Compare
Benchmark resultsCompared with a585449d8, the merge base. 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.
All benchmarks
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #998 +/- ##
==========================================
- Coverage 90.79% 89.19% -1.61%
==========================================
Files 33 33
Lines 3293 2998 -295
==========================================
- Hits 2990 2674 -316
- Misses 303 324 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GPUCompiler 2.25 adds
deferred_codegen!(builder, job)(JuliaGPU/GPUCompiler.jl#1128), for back-ends that need a function compiled along with a kernel when they generate code for it infinish_module!. This uses it forinitialize_rng_state().Until now, the RNG initialization was requested by registering the job in
GPUCompiler.deferred_codegen_jobsunderlength + 1and emitting thedeferred_codegenmarker call by hand. Concurrent compilations, which Julia 1.12+ no longer serializes, can pick the same id, so a kernel can end up calling another compilation's function.deferred_codegen!registers the request without that race and emits the marker and the pointer conversion for every supported Julia version.The GPUCompiler compat is bumped to 2.25. The old mechanism keeps working in GPUCompiler, so released versions are not affected; it will be deprecated once the back-ends have moved.
This is for the POCL back-end. Tested locally with Julia 1.13 and
CI=true(so GPUCompiler verifies the IR): the full test suite passes.