Repository navigation
Conversation
On Julia 1.12, `GPUCompiler.compile(:obj, job)` returns metadata without `exception_sites`, so compiling any kernel failed with a `FieldError` since #982 (including during precompilation). GPUCompiler's precompiled `compile_unhooked` was inferred while `uses_exception_sites` returned `false` for all jobs, so it merges the metadata of `emit_llvm` with the field names of the narrower result; our method doesn't invalidate it on 1.12. Compile to `:llvm` instead, whose metadata is returned as it is, and emit the object with `emit_asm`, as the `:obj` path does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded by JuliaGPU/GPUCompiler.jl#1112 |
Benchmark resultsCompared with 301c8f3b8, 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 #989 +/- ##
==========================================
- Coverage 89.75% 89.27% -0.49%
==========================================
Files 33 33
Lines 3065 3011 -54
==========================================
- Hits 2751 2688 -63
- Misses 314 323 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Since #982, every POCL kernel fails to compile on Julia 1.12, already during precompilation:
All 1.12 jobs of main's CI run for #982 fail this way. PR CI only covers 1.10 and 1.13, so it didn't show up there.
Cause
compile_to_objreadexception_sitesfrom the metadata thatGPUCompiler.compile(:obj, job)returns. That path mergesemit_llvm's metadata withemit_asm's as(; asm_meta..., ir_meta..., ir). On 1.12, the typed code ofcompile_unhookedthat actually runs infersemit_llvmto return only the(:entry, :compiled, :relocations)variant. It then merges with those constant field names throughBase.merge_fallback, soexception_sitesis dropped:Fresh inference of
emit_llvmgives the correct union, which includes theexception_sitesvariant. Callingcompile_unhooked(:llvm, job)andemit_llvmdirectly returns the key. Splatting the same values by hand keeps it too. So it looks like GPUCompiler's precompiledcompile_unhooked, inferred whileuses_exception_siteswasfalsefor every job, isn't invalidated by ouruses_exception_sitesmethod on 1.12. 1.10, 1.11 and 1.13 are fine. This probably wants a fix in GPUCompiler too, but KA shouldn't stay broken in the meantime.Fix
Compile to
:llvm, whose metadata is returned without merging, and emit the object withGPUCompiler.emit_asm. That's what the:objpath does internally.Testing
Locally on Julia 1.12.6 with the released GPUCompiler 2.23.3, the full test suite passes, apart from two local failures that unmodified
mainalso has on this machine:POCL BFloat16arithmetic (passes on CI)POCL sessionsubprocess segfault (passes on CI)Before this change, every kernel launch failed on 1.12. On 1.13 kernels still compile, and exceptions are still reported by throw site.
🤖 Generated with Claude Code