CuArray(sol) scalar-indexes GPU arrays for SecondOrderODEProblem (ArrayPartition) solutions
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
The issue is in the CuArray constructor for solutions of SecondOrderODEProblem where states are ArrayPartitions of CuArrays. Start by examining the CuArray constructor in RecursiveArrayTools.jl and how it handles AbstractVectorOfArray with ArrayPartition elements. The failing test is in test/GPU/ode_gpu.jl; run it to see the scalar indexing error. Look at the difference between ODEProblem and SecondOrderODEProblem solutions. The fix must avoid scalar indexing while preserving allowscalar(false).
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
CuArray(sol) for the solution of a SecondOrderODEProblem on CUDA arrays scalar-indexes the GPU arrays and errors under the default allowscalar(false). The solution's states are ArrayPartitions of CuArrays. The plain ODEProblem case (Array(sol) with CuArray states) works.
test/GPU/ode_gpu.jl was written for this (https://discourse.julialang.org/t/results-of-secondorderodeproblem-give-error-this-object-is-not-a-gpu-array/82100), but no test group ever included it. https://github.com/SciML/RecursiveArrayTools.jl/pull/659 wires it into the GPU group, and the self-hosted GPU job fails there: https://github.com/SciML/RecursiveArrayTools.jl/actions/runs/35874813098/job/107236637535
using CUDA, LinearAlgebra, OrdinaryDiffEq, Test
u0 = cu(rand(100)); du0 = cu(rand(100)); A = cu(randn(100, 100))
f(ddu, du, u, p, t) = mul!(ddu, A, u)
sol = solve(SecondOrderODEProblem(f, du0, u0, (0.0f0, 1.0f0)), Tsit5())
@test SciMLBase.successful_retcode(sol) # passes
CuArray(sol) # errors
Expression: size(CuArray(sol), 1) == 200
Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
The failing versions are those resolved by that CI job: CUDA 6.4, OrdinaryDiffEq 7.8.1, RecursiveArrayTools master (4.5.2). Julia 1 is on the self-hosted GPU runner. I have not reproduced it locally because this machine has no GPU. A CPU substitute with JLArrays and allowscalar(false) did not reproduce it for JLArray(sol), so the scalar path may be specific to the CuArray constructor on AbstractVectorOfArray{<:Any,<:Any,<:ArrayPartition}.
#659 stays open as the regression test for this. Its test must not be weakened to make it pass.
🤖 Filed by Claude Code 2.1.280 (model claude-opus-5-5[1m]) from the qa-hygiene goal cycle.
- Lenguaje dominante
- Julia
- Estrellas
- 233
- Forks
- 76
- Merge medio
- 5 h 33 min
- PR fusionados (30 d)
- 11
Guía de contribución
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 SciML/RecursiveArrayTools.jl
-
Docs: usage of j vs i Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
SciML/RecursiveArrayTools.jl#255 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
SciML/RecursiveArrayTools.jl#661 ·
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red) Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
SciML/RecursiveArrayTools.jl#620 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
SciML/RecursiveArrayTools.jl#619 ·
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
SciML/RecursiveArrayTools.jl#570 ·
Todos los issues de SciML/RecursiveArrayTools.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
epiforecasts/BVDOutbreakSize#862 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
CliMA/Oceananigans.jl#6066 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
JuliaLang/LinearAlgebra.jl#1707 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
JuliaPluto/Pluto.jl#3616 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ReactiveBayes/ExponentialFamily.jl#322 · 2 comentarios ·