Add a compile-only test grid for Base math on the device - #644
Merged
Merged
Conversation
Compiles ~200 (function, eltype) cells through the validating pipeline (`compile_to_obj`) without launching anything, so a toolchain bump that stops e.g. `sqrt(::ComplexF32)` from compiling names its cell instead of failing deep inside a GPUArrays test. The LLVM SPIR-V back-end compiles every cell. The Khronos translator (LTS stack) still rejects `_cpow`'s i63 and `llvm.smul.with.overflow`; since the library-based translator exits the process on those errors, the cells are skipped on that path rather than marked broken. Split out of #621.
michel2323
force-pushed
the
codegen-grid
branch
from
September 24, 2026 16:13
226eb08 to
e4411cc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
- Coverage 81.61% 80.72% -0.89%
==========================================
Files 50 54 +4
Lines 3611 3855 +244
==========================================
+ Hits 2947 3112 +165
- Misses 664 743 +79 ☔ 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.
Split out of #621, as suggested there; the allocator part landed in #631.
What
test/device/codegen.jlcompiles ~200 (function, eltype) cells —sqrt,exp,log, trig,x^x,div/rem/mod,checked_*, float→int conversions, bounds-checked indexing,Diagonalsetindex!, … overFloat16/32/64, their complex types andInt32/64,UInt32/64— throughcompile_to_obj, the validating path a launch takes (thecode_*reflection entry points skip IR validation). Nothing is launched, so it takes seconds.Why
Whether a Base function compiles for the device depends on which of its throw paths survive optimization, so a routine Julia/GPUCompiler/LLVM/translator bump can silently change the answer. GPUCompiler 2.2.2 did, for
sqrt(::Complex)(JuliaGPU/GPUCompiler.jl#906), and it surfaced as anInvalidIRErrordeep insidegpuarrays/statistics. With this grid, such a regression fails a test named after its cell (e.g.unary complex/sqrt(ComplexF32)).Known failures
x^xfor complex,checked_add) pass with SPIRV_LLVM_Backend_jll 23.1.1.ONEAPI_LTS=1):x^xfor complex (InvalidBitWidth: 63from_cpow) andchecked_mul(Int32/Int64)(llvm.smul.with.overflow) still fail. Since the library-based translator (Adapt to the library-based SPIRV_LLVM_Translator_jll 23 and GPUCompiler 2.8 #633) exits the process on these errors instead of throwing (exit codes 9/8), they are@test_skipped rather thanbroken = true.