KernelAbstractions 0.10 doubles load time
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- performance
Direzione di ricerca
The crash and most of the invalidations come from the show(::IO, ::Type{GeneratedKernelError{Msg}}) method at src/macros.jl:117; start there and check that the default printing of GeneratedKernelError{...} still shows the message. Reproduce the crash with println(Vector{KernelAbstractions.GeneratedKernelError{Msg}} where Msg) before and after removing or fixing the method. The POCL dependency-loading part needs maintainer design input, so leave it out of a first contribution.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Loading KernelAbstractions 0.10 takes about twice as long as 0.9:
julia -e 'using KernelAbstractions' |
packages in Manifest | invalidated method instances | |
|---|---|---|---|
bare julia -e '' |
94 ms | ||
| 0.9.45 | 301 ms | 32 | 105 |
| 0.10.0 | 613 ms | 70 | 2800 |
(Julia 1.13.1, macOS, median of 7 runs, fresh environment with only KA.)
This propagates to back-ends: Metal.jl's import time went from 1.81 s to 1.99 s when it moved to KA 0.10 (JuliaGPU/Metal.jl#994), even though Metal already loaded GPUCompiler and now only weakly depends on KA (GPUArrays 12 still loads it).
There are two separate causes.
Dependencies of the POCL back-end
@time_imports shows that KA now unconditionally loads everything the POCL back-end needs: GPUCompiler (and through it REPL, ~55 ms), CompilerCaching/LMDB, four tree_sitter_*_jlls, pocl_standalone_jll with Hwloc, XML2, Libiconv and Zstd, SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll, SPIRVIntrinsics, which pulls in SpecialFunctions and CompilerSupportLibraries_jll (26 ms in its __init__), and Random123/RandomNumbers. GPU back-ends never use any of this. For Metal.jl, which already loads GPUCompiler, the remaining cost is about 80 ms, a good part of it per-package loading overhead.
show(::IO, ::Type{GeneratedKernelError{Msg}})
A single method, src/macros.jl:117, accounts for nearly all of the invalidations: its tree has 2984 children, because it is more specific than show(::IO, ::Type) for every caller that was inferred with an abstract type. Removing it brings using KernelAbstractions from 611 to 555 ms.
The method also crashes Julia when the type parameter is not bound:
julia> using KernelAbstractions
julia> println(Vector{KernelAbstractions.GeneratedKernelError{Msg}} where Msg)
Array{ERROR: UndefVarError: `Msg` not defined in static parameter matching
...
fatal: error thrown and no exception handler available.
This happens in practice: SnoopCompile hits it when printing the invalidation tree for this very method, and so does methods(show, (IO, Type{<:KernelAbstractions.GeneratedKernelError})).
The default printing already includes the message, e.g., KernelAbstractions.GeneratedKernelError{Symbol("generator failed: x is not defined")}, so the simplest fix may be to remove the method.
- Lingua principale
- Julia
- Stelle
- 533
- Fork
- 90
- Merge medio
- 1g 14h
- PR unite (30g)
- 55
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/KernelAbstractions.jl
-
Enzyme reverse mode: `prod(ndrange)` fails for kernels with a construction-time ndrangeForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
JuliaGPU/KernelAbstractions.jl#924 ·
I maintainer di solito rispondono entro 1 giorno
-
CPU backend: `Base.checked_mul` in a kernel fails to build (`__spirv_SMulExtended` missing in PoCL)Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
JuliaGPU/KernelAbstractions.jl#916 ·
I maintainer di solito rispondono entro 1 giorno
-
kernels pocl upstream
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
JuliaGPU/KernelAbstractions.jl#894 ·
I maintainer di solito rispondono entro 1 giorno
-
CPU backend: locals that live across a `@synchronize()` in a loop make a kernel 14–78× slowerApertakernels performance pocl upstream
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
JuliaGPU/KernelAbstractions.jl#893 ·
I maintainer di solito rispondono entro 1 giorno
-
kernels performance pocl regression upstream
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
JuliaGPU/KernelAbstractions.jl#891 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di JuliaGPU/KernelAbstractions.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
lux
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100