Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CuArray(sol) scalar-indexes GPU arrays for SecondOrderODEProblem (ArrayPartition) solutions

オープン
#662 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

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.

https://claude.ai/code/session_01QgnmpexRwud38wrs3XvBfV

主要言語
Julia
スター
233
フォーク
76
平均マージ
5時間 33分
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SciML/RecursiveArrayTools.jl のほかの issue

SciML/RecursiveArrayTools.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。