Build the GPU lu_instance directly instead of calling lu - #502
Merged
ChrisRackauckas merged 1 commit intoAug 18, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #502 +/- ##
==========================================
- Coverage 61.32% 60.93% -0.40%
==========================================
Files 15 15
Lines 618 622 +4
==========================================
Hits 379 379
- Misses 239 243 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #501.
lu_instancefor GPU matrices builds the instance by callingluon an adapted 0x0 array,which only works for backends that define their own
lu. JLArrays does not, so it fallsthrough to LinearAlgebra's generic path and dies:
There is no size that works,
lu(jl(ones(0,0)))hits LAPACKgetrf!andlu(jl(ones(3,3)))hits "Scalar indexing is disallowed", so routing through
luis the problem rather than the0x0.
This builds the
LUdirectly, the same way theMatrix,SymmetricandTridiagonal/Diagonal/SymTridiagonalmethods already do inArrayInterface.jl, so nobackend
luis needed. After:which mirrors the CPU result
LU{Float64, Matrix{Float64}, Vector{Int64}}.It matters downstream because JLArrays is what packages use to exercise GPU code paths without
a GPU. OrdinaryDiffEq's GPU autodiff test is failing through this on Julia 1, lts and pre right
now, and #467 reported the same shape for Metal.
Worth checking before merge: I only have JLArrays here, no CUDA/AMDGPU/Metal, so I could not
confirm the
ipivelement type matches what those backends' ownlureturns. The CPU methodsall use
BlasIntand I followed them. If a backend'slureturnsInt32there, this changesthe instance type for it.