Wrong result from a reduction with a branching operator on Julia 1.12 with --check-bounds=yes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- compilers
Direzione di ricerca
Start with the reproducer in the issue, running it on Julia 1.12 with --check-bounds=yes, then compare against --check-bounds=auto. The failing test is the strided reductions testset in test/array.jl:223. The bug sits in the SPIR-V/LLVM path for a branching reducer over a named tuple on 2-D inputs, not in the test itself. Done means the reproducer returns true on 1.12 with bounds checking on, and the testset passes there.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With the GPUArrays 12 port (#665), == between two equal 64×64 oneArrays returns false. This only happens on Julia 1.12 and with bounds checking enabled, which Pkg.test does by default. It makes the strided reductions testset in test/array.jl:223 fail on 1.12. CI only tests 1.10 and 1.13, so it doesn't show up there.
GPUArrays' == reduces over a named tuple of two Bools (one tracking missing, one the result), and its reducer branches on the missing flag. Reduced:
using oneAPI
A = rand(Int32(1):Int32(4), 64, 64); dA = oneArray(A); dB = oneArray(A)
init = (; is_missing=false, is_equal=true)
mapper(a, b) = (; is_missing=false, is_equal=a == b)
branching(a, b) = (a.is_missing || b.is_missing) ? (; is_missing=true, is_equal=false) :
(; is_missing=false, is_equal=a.is_equal & b.is_equal)
branchless(a, b) = (; is_missing=a.is_missing | b.is_missing, is_equal=a.is_equal & b.is_equal)
@show mapreduce(mapper, branching, dA, dB; init) # is_equal = false with --check-bounds=yes on 1.12
@show mapreduce(mapper, branchless, dA, dB; init) # is_equal = true
@show mapreduce(mapper, branching, oneArray(ones(Int32, 4096)), oneArray(ones(Int32, 4096)); init) # 1-D: true
--check-bounds=yes |
--check-bounds=auto |
|
|---|---|---|
| Julia 1.12.7 | wrong (deterministic) | correct |
| Julia 1.13.1 | correct | correct |
| Julia 1.10.12 | correct | correct |
- Only 2-D inputs fail. 1-D vectors of 1 to 4096 elements are correct.
- The
missing-tracking mapper doesn't matter. Replacing the branching reducer with a branchless one fixes it. - It doesn't depend on AcceleratedKernels (0.5.2, 0.5.3 and 0.5.4 all fail) or GPUCompiler (2.13.0, 2.13.1 and 2.13.2 all fail).
- The same code on CUDA.jl with Julia 1.12 and
--check-bounds=yesis correct. - oneAPI's main branch (GPUArrays 11) isn't affected, but it uses different reduction kernels.
The SPIR-V path for this kernel seems the likely culprit, on Julia 1.12's LLVM 18 or in IGC.
Environment: Intel Iris Xe Graphics (driver 1.3.38308), NEO 26.18.38308, libigc 2.34.4, SPIRV_LLVM_Backend 23.1.1, SPIRV_LLVM_Translator 23.1.1, Julia 1.12.7 (LLVM 18.1.7), oneAPI.jl from #665 (2.9.2 + GPUArrays 12.1.0, AcceleratedKernels 0.5.4, KernelAbstractions 0.9.44, GPUCompiler 2.13.2).
- Lingua principale
- Julia
- Stelle
- 217
- Fork
- 37
- Merge medio
- 20h 7m
- PR unite (30g)
- 29
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaGPU/oneAPI.jl
-
resize! frees its new buffer with free instead of releaseForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Kernel launches are compiled for Vararg{Any} and dispatched at run timeForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
JuliaGPU/oneAPI.jl#675 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Host JIT segfaults compiling @oneapi in a loop over a tuple of functionsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
JuliaGPU/oneAPI.jl#663 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Track outstanding GPU work per allocation for host-accessible arraysForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di JuliaGPU/oneAPI.jl
Issue simili
-
tagbot-manual
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
tshort/StaticCompiler.jl#191 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
SciML/SciMLSensitivity.jl#1703 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
JuliaGPU/GPUCompiler.jl#1008 ·
I maintainer di solito rispondono entro 1 giorno
-
`biggs6` disagrees with CUTEst and is unbounded belowForse già presa @timholy l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Cannot set point coordinates with `Range`s (or arbitrary arrays) using `Makie.Resampler` in `heatmap`Forse già presa @ffreyer l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno