CuArray(sol) scalar-indexes GPU arrays for SecondOrderODEProblem (ArrayPartition) solutions
まだ誰も着手していません。
評価
調査の方向性
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).
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Julia
- スター
- 233
- フォーク
- 76
- 平均マージ
- 5時間 33分
- マージ済み PR(30日)
- 11
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SciML/RecursiveArrayTools.jl のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
SciML/RecursiveArrayTools.jl#255 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
SciML/RecursiveArrayTools.jl#661 ·
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red) オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
SciML/RecursiveArrayTools.jl#620 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#619 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#570 ·
SciML/RecursiveArrayTools.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
epiforecasts/BVDOutbreakSize#862 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CliMA/Oceananigans.jl#6066 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaLang/LinearAlgebra.jl#1707 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaPluto/Pluto.jl#3616 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ReactiveBayes/ExponentialFamily.jl#322 · コメント 2 件 ·