`findmin!` and `findmax!` do not work on GPU arrays
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with the existing findmin(A; dims) implementation in GPUArrays and AcceleratedKernels' mapreducedim! behavior. Implement the issue's option 1 for findmin! and findmax!, then verify init=false, init=true, nonempty slices, and empty A using the Julia examples and GPU arrays such as JLArray or CUDA.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
GPUArrays implements findmin and findmax, but not their in-place forms, so findmin!(rval, rind, A) falls back to Base's findminmax! loop, which indexes scalars:
using JLArrays # or CUDA, etc.
A = JLArray(Float32[3 1; 2 4])
rval = JLArray(zeros(Float32, 1, 2))
rind = JLArray(fill(CartesianIndex(1, 1), 1, 2))
findmin!(rval, rind, A)
# ERROR: Scalar indexing is disallowed.
# Invocation of getindex resulted in scalar indexing of a GPU array.
(GPUArrays main, and with the AcceleratedKernels-based reductions of #790; Julia 1.13.)
An implementation must reproduce Base's init keyword, whose init=false does not fold the old values in: Base resets the index destination (fill!(rind, zero(eltype(keys(A))))), and "the initial values of Rval are not used if the corresponding indices in Rind are 0", so the old rval is ignored whenever the slice is not empty:
julia> findmin!([-10], [42], [3, 2]; init=false)
([2], [2])
julia> findmin!([0.5 5.0], [CartesianIndex(9, 9) CartesianIndex(9, 9)], [3.0 1; 2 4]; init=false)
([2.0 1.0], CartesianIndex{2}[CartesianIndex(2, 1) CartesianIndex(1, 2)])
With init=true, rval starts from the first slice and rind from zero, which gives the same result; either way the result is the reduction of A alone, and an empty A leaves rval and rind unchanged (Base returns early).
Two ways to implement it:
- Reduce
(f(x), i)pairs into a temporary array of tuples withAK.mapreducedim!in overwrite mode, asfindmin(A; dims)does, then unzip it intorvalandrind(rindthroughkeys(A)). This needs no change in AcceleratedKernels, and costs one extra pass over the (small) output and a temporary of its size. - Let
AK.mapreducedim!write a destination that is a pair of arrays, which saves that pass but adds a new destination contract to AcceleratedKernels.
Option 1 is the natural first step; findmin!/findmax! along dims are rarely performance-critical.
- Lenguaje dominante
- Julia
- Estrellas
- 456
- Forks
- 108
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 27
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaGPU/GPUArrays.jl
-
arrays
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
JuliaGPU/GPUArrays.jl#697 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
JuliaGPU/GPUArrays.jl#836 ·
Los mantenedores suelen responder en 2 días
-
`reverse(::JLArray)` errors with GPUArrays 12.1.1 and JLArrays 0.4.2 (JLArrays release missing)Abiertoinstallation regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 57/100
JuliaGPU/GPUArrays.jl#817 ·
Los mantenedores suelen responder en 2 días
-
installation latency regression upstream
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
JuliaGPU/GPUArrays.jl#813 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Indexing (Cartesian or Linear) isn't defined for sparse device arraysPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarrays
Dificultad 3/5 1-2 días Aptitud para principiantes 63/100
JuliaGPU/GPUArrays.jl#694 · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de JuliaGPU/GPUArrays.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
documentation invalid
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
JuliaPhysics/BeamletOptics.jl#190 ·
Los mantenedores suelen responder en 1 día
-
mul! with a Symmetric or Hermitian factor throws for a matrix view whose columns are not contiguousPosiblemente ocupada @dkarrasch la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JuliaLang/LinearAlgebra.jl#1829 ·
Los mantenedores suelen responder en 1 día
-
`EnsembleSummary` `ci_type = :SEM` ribbon is `sqrt(N)` too wide for scalar statesPosiblemente ocupada @isaacsas la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
SciML/SciMLBase.jl#1654 ·
Los mantenedores suelen responder en 3 días