ITADN

Regression on Julia 1.12 over Julia 1.10 for DifferentialRiccatiEquations.jl

#3236Openjonas-schulze 创建于 3 天前
bug
J
jonas-schulzecommented
**Describe the bug** My package CI broke going from Julia 1.10 to 1.12. I had extracted some MWEs (#3041, #3042, #3043, #3044), but apparently, that hasn't been all. I am creating this issue mostly to not forget about it, but I would be glad for any input you can give. At least this is how I understood your comment at JuliaCon, @kshyatt. 😬 If the issue title could be improved, feel free to change it. I wonder when `@view X[1:2, 1:2]` changed from returning `SubArray` to `CuArray`. This broke [my hacky fix](https://github.com/mpimd-csc/DifferentialRiccatiEquations.jl/blob/4d98a29b3b4eaa4063a5d656e21c72fd126fd23e/ext/CUDAExt.jl#L34-L49) on Julia LTS. **To reproduce** The Minimal Working Example (MWE) for this bug: ```julia pkg> activate --temp pkg> add DifferentialRiccatiEquations#e16f23a8f83b32bc1e8ca38df9464cd26f196b2c pkg> test DifferentialRiccatiEquations ``` The test suite takes 10min or so. On Julia 1.10.11, everything is fine. On Julia 1.12.6, I see the following error several times: ``` Error During Test at /home/jschulze/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:98 Got exception outside of a @test Scalar indexing is disallowed. Invocation of getindex resulted in scalar indexing of a GPU array. This is typically caused by calling an iterating implementation of a method. Such implementations *do not* execute on the GPU, but very slowly on the CPU, and therefore should be avoided. If you want to allow scalar iteration, use `allowscalar` or `@allowscalar` to enable scalar iteration globally or for the operations in question. Stacktrace: [1] error(s::String) @ Base ./error.jl:44 [2] errorscalar(op::String) @ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:151 [3] _assertscalar(op::String, behavior::GPUArraysCore.ScalarIndexing) @ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:124 [4] assertscalar(op::String) @ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:112 [5] getindex @ ~/.julia/packages/GPUArrays/G5WHw/src/host/indexing.jl:50 [inlined] [6] generic_mul!(C::SubArray{Float64, 2, CuArray{Float64, 2, CUDA.DeviceMemory}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false}, s::Float64, X::CuArray{Float64, 2, CUDA.DeviceMemory}, alpha::Bool, beta::Bool) @ LinearAlgebra ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/generic.jl:100 [7] _lscale_add! @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/generic.jl:201 [inlined] [8] mul! @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/generic.jl:198 [inlined] [9] mul! @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/matmul.jl:265 [inlined] [10] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/src/riccati/residual.jl:58 [inlined] [11] inner @ ~/.julia/packages/TimerOutputs/L5q5K/src/TimerOutput.jl:341 [inlined] [12] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/src/riccati/residual.jl:6 [inlined] [13] residual(prob::GAREProblem{DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, UniformScaling{Float64}}, DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, CuArray{Float64, 2, CUDA.DeviceMemory}}}, X::DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, UniformScaling{Bool}}; AᵀL::Nothing, EᵀL::Nothing, BᵀLD::Nothing, DLᵀGLD::Nothing) @ DifferentialRiccatiEquations ~/.julia/packages/TimerOutputs/L5q5K/src/TimerOutput.jl:343 [14] residual @ ~/.julia/packages/TimerOutputs/L5q5K/src/TimerOutput.jl:340 [inlined] [15] test_residual_rand(prob::GAREProblem{DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, UniformScaling{Float64}}, DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, CuArray{Float64, 2, CUDA.DeviceMemory}}}, X::DifferentialRiccatiEquations.LDLᵀ{Float64, CuArray{Float64, 2, CUDA.DeviceMemory}, UniformScaling{Bool}}) @ Main ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:24 [16] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1777 [inlined] [17] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:98 [inlined] [18] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1866 [inlined] [19] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:92 [inlined] [20] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1866 [inlined] [21] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:87 [inlined] [22] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1866 [inlined] [23] top-level scope @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/residual.jl:1889 [24] include(mapexpr::Function, mod::Module, _path::String) @ Base ./Base.jl:307 [25] top-level scope @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/runtests.jl:10 [26] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1777 [inlined] [27] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/runtests.jl:20 [inlined] [28] macro expansion @ ~/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/share/julia/stdlib/v1.12/Test/src/Test.jl:1777 [inlined] [29] macro expansion @ ~/.julia/packages/DifferentialRiccatiEquations/8f0cA/test/runtests.jl:20 [inlined] [30] include(mapexpr::Function, mod::Module, _path::String) @ Base ./Base.jl:307 [31] top-level scope @ none:6 [32] eval(m::Module, e::Any) @ Core ./boot.jl:489 [33] exec_options(opts::Base.JLOptions) @ Base ./client.jl:283 [34] _start() @ Base ./client.jl:550 ``` **Expected behavior** No test should error or fail. **Version info** I've tested `julia +lts` (1.10.11) and `julia +release` (1.12.6).
1 条评论