Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d6f380a
fix: aos_to_soa for all singleton dims
avik-pal Nov 18, 2024
1d93114
test: singleton dims AoS
avik-pal Nov 18, 2024
25b0be8
Merge pull request #457 from avik-pal/patch-1
ChrisRackauckas Nov 18, 2024
251535f
Update Project.toml
ChrisRackauckas Nov 18, 2024
b4d4ab4
Bump codecov/codecov-action from 4 to 5
dependabot[bot] Nov 18, 2024
a2253a1
Merge pull request #458 from JuliaArrays/dependabot/github_actions/co…
ChrisRackauckas Nov 18, 2024
007399d
CompatHelper: bump compat for CUDSS in [weakdeps] to 0.4, (keep exist…
Dec 12, 2024
ce50ee4
Merge pull request #459 from JuliaArrays/compathelper/new_version/202…
ChrisRackauckas Dec 13, 2024
9e3936c
Update Project.toml
ChrisRackauckas Dec 13, 2024
9d38d86
Fully qualify constructor extension
jpthiele May 6, 2025
05916b6
Merge pull request #461 from jpthiele/patch-1
ChrisRackauckas May 6, 2025
147b8a2
Update Project.toml
ChrisRackauckas May 6, 2025
e2b9740
Fix SparseMatrixCSC with alternative Integer types
ChrisRackauckas May 12, 2025
74135a1
Merge pull request #462 from JuliaArrays/ChrisRackauckas-patch-2
ChrisRackauckas May 12, 2025
bda0548
Update Project.toml
ChrisRackauckas May 12, 2025
a4db242
Add Downgrade CI
ChrisRackauckas Aug 9, 2025
ce4d7c5
Update .github/workflows/Downgrade.yml
ChrisRackauckas Aug 9, 2025
8aef435
Merge pull request #464 from JuliaArrays/ChrisRackauckas-patch-2
ChrisRackauckas Aug 9, 2025
b57b438
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 18, 2025
e4068ff
Merge pull request #466 from JuliaArrays/dependabot/github_actions/ac…
ChrisRackauckas Aug 18, 2025
5058a72
Add Metal.jl support for lu_instance
ChrisRackauckas Sep 1, 2025
72bb8e1
Improve Metal.jl tests
ChrisRackauckas Sep 2, 2025
d7d7b7b
Update ci.yml
ChrisRackauckas Sep 2, 2025
7892d2b
Merge pull request #468 from JuliaArrays/fix-metal-lu-instance
ChrisRackauckas Sep 2, 2025
f67f7d8
Update Project.toml
ChrisRackauckas Sep 2, 2025
7d61334
Fix CUDSS extension for v0.5 and v0.6 compatibility
ChrisRackauckas Oct 16, 2025
4581303
Update Project.toml
ChrisRackauckas Oct 16, 2025
2aa0fc0
Merge pull request #471 from ChrisRackauckas-Claude/cudss-v0.5-v0.6-s…
ChrisRackauckas Oct 16, 2025
994bc7b
Update Project.toml
ChrisRackauckas Oct 16, 2025
797ccdd
bump CUDSS min version
oscardssmith Oct 21, 2025
2ae3e12
test CUDSS
oscardssmith Oct 21, 2025
a266d9f
test CUDSS
oscardssmith Oct 21, 2025
d3d0fa9
Merge pull request #472 from JuliaArrays/os/bump-cudss
ChrisRackauckas Oct 22, 2025
477b144
Update Project.toml
ChrisRackauckas Oct 22, 2025
67e8d20
Merge pull request #473 from JuliaArrays/ChrisRackauckas-patch-2
ChrisRackauckas Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@latest
with:
version: '1'
Expand All @@ -23,6 +23,6 @@ jobs:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ --code-coverage=user docs/make.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: lcov.info
36 changes: 36 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Downgrade
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- 'benchmark/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'benchmark/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
downgrade_mode: ['alldeps']
julia-version: ['1.10']
group: ['Core']
steps:
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-downgrade-compat@v2
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
ALLOW_RERESOLVE: false
env:
GROUP: ${{ matrix.group }}
6 changes: 3 additions & 3 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
- {user: SciML, repo: DelayDiffEq.jl, group: Interface}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/julia-buildpkg@latest
- name: Clone Downstream
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
Expand All @@ -61,6 +61,6 @@ jobs:
exit(0) # Exit immediately, as a success
end
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: lcov.info
4 changes: 2 additions & 2 deletions .github/workflows/Invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_pr

- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
ref: ${{ github.event.repository.default_branch }}
- uses: julia-actions/julia-buildpkg@v1
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ jobs:
- Core
version:
- '1'
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -35,6 +39,6 @@ jobs:
env:
GROUP: ${{ matrix.group }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: lcov.info
file: lcov.info
13 changes: 9 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ArrayInterface"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "7.17.0"
version = "7.22.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -14,6 +14,7 @@ CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Expand All @@ -23,10 +24,11 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
ArrayInterfaceBandedMatricesExt = "BandedMatrices"
ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices"
ArrayInterfaceCUDAExt = "CUDA"
ArrayInterfaceCUDSSExt = "CUDSS"
ArrayInterfaceChainRulesExt = "ChainRules"
ArrayInterfaceCUDSSExt = ["CUDSS", "CUDA"]
ArrayInterfaceChainRulesCoreExt = "ChainRulesCore"
ArrayInterfaceChainRulesExt = "ChainRules"
ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore"
ArrayInterfaceMetalExt = "Metal"
ArrayInterfaceReverseDiffExt = "ReverseDiff"
ArrayInterfaceSparseArraysExt = "SparseArrays"
ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore"
Expand All @@ -37,12 +39,13 @@ Adapt = "4"
BandedMatrices = "1"
BlockBandedMatrices = "0.13"
CUDA = "5"
CUDSS = "0.2, 0.3"
CUDSS = "0.6.1"
ChainRules = "1"
ChainRulesCore = "1"
ChainRulesTestUtils = "1"
GPUArraysCore = "0.1, 0.2"
LinearAlgebra = "1.10"
Metal = "1"
ReverseDiff = "1"
SparseArrays = "1.10"
StaticArraysCore = "1"
Expand All @@ -59,6 +62,8 @@ ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Expand Down
2 changes: 1 addition & 1 deletion ext/ArrayInterfaceBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function _bandsize(bandind, rowsize, colsize)
end
end

function BandedMatrixIndex(rowsize, colsize, lowerbandwidth, upperbandwidth, isrow)
function ArrayInterface.BandedMatrixIndex(rowsize, colsize, lowerbandwidth, upperbandwidth, isrow)
upperbandwidth > -lowerbandwidth || throw(ErrorException("Invalid Bandwidths"))
bandinds = upperbandwidth:-1:(-lowerbandwidth)
bandsizes = [_bandsize(band, rowsize, colsize) for band in bandinds]
Expand Down
12 changes: 8 additions & 4 deletions ext/ArrayInterfaceCUDSSExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ module ArrayInterfaceCUDSSExt

using ArrayInterface
using CUDSS
using CUDA

function ArrayInterface.lu_instance(A::CUDSS.CuSparseMatrixCSR)
ArrayInterface.LinearAlgebra.checksquare(A)
fact = CudssSolver(A, "G", 'F')
T = eltype(A)
n = size(A,1)
x = CudssMatrix(T, n)
b = CudssMatrix(T, n)
n = size(A, 1)

# Use standard CUDA types (CuVector) instead of deprecated CudssMatrix
x = CUDA.CuVector{T}(undef, n)
b = CUDA.CuVector{T}(undef, n)

fact = CudssSolver(A, "G", 'F')
cudss("analysis", fact, x, b)
fact
end
Expand Down
15 changes: 15 additions & 0 deletions ext/ArrayInterfaceMetalExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module ArrayInterfaceMetalExt

using ArrayInterface
using Metal
using LinearAlgebra

function ArrayInterface.lu_instance(A::MtlMatrix{T}) where {T}
ipiv = MtlVector{Int32}(undef, 0)
info = zero(Int)
return LinearAlgebra.LU(similar(A, 0, 0), ipiv, info)
end

ArrayInterface.device(::Type{<:Metal.MtlArray}) = ArrayInterface.GPU()

end # module
7 changes: 2 additions & 5 deletions ext/ArrayInterfaceReverseDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ ArrayInterface.ismutable(T::Type{<:ReverseDiff.TrackedReal}) = false
ArrayInterface.can_setindex(::Type{<:ReverseDiff.TrackedArray}) = false
ArrayInterface.fast_scalar_indexing(::Type{<:ReverseDiff.TrackedArray}) = false
function ArrayInterface.aos_to_soa(x::AbstractArray{<:ReverseDiff.TrackedReal, N}) where {N}
if length(x) > 1
return reshape(reduce(vcat, x), size(x))
else
return reduce(vcat,[x[1], x[1]])[1:1]
end
y = length(x) > 1 ? reduce(vcat, x) : reduce(vcat, [x[1], x[1]])[1:1]
return reshape(y, size(x))
end

function ArrayInterface.restructure(x::Array, y::ReverseDiff.TrackedArray)
Expand Down
20 changes: 10 additions & 10 deletions ext/ArrayInterfaceSparseArraysExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ function findstructralnz(x::SparseMatrixCSC)
(rowind, colind)
end

function bunchkaufman_instance(A::SparseMatrixCSC)
bunchkaufman(sparse(similar(A, 1, 1)), check = false)
function bunchkaufman_instance(A::SparseMatrixCSC{Tv, Ti}) where {Tv, Ti}
bunchkaufman(SparseMatrixCSC{Tv, Ti}(similar(A, 1, 1)), check = false)
end

function cholesky_instance(A::Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}}, pivot = DEFAULT_CHOLESKY_PIVOT)
cholesky(sparse(similar(A, 1, 1)), check = false)
function cholesky_instance(A::Union{SparseMatrixCSC{Tv, Ti},Symmetric{<:Number,<:SparseMatrixCSC{Tv, Ti}}}, pivot = DEFAULT_CHOLESKY_PIVOT) where {Tv, Ti}
cholesky(SparseMatrixCSC{Tv, Ti}(similar(A, 1, 1)), check = false)
end

function ldlt_instance(A::SparseMatrixCSC)
ldlt(sparse(similar(A, 1, 1)), check=false)
function ldlt_instance(A::SparseMatrixCSC{Tv, Ti}) where {Tv, Ti}
ldlt(SparseMatrixCSC{Tv, Ti}(similar(A, 1, 1)), check=false)
end

# Could be optimized but this should work for any real case.
function lu_instance(jac_prototype::SparseMatrixCSC, pivot = DEFAULT_CHOLESKY_PIVOT)
lu(sparse(rand(1,1)))
function lu_instance(jac_prototype::SparseMatrixCSC{Tv, Ti}, pivot = DEFAULT_CHOLESKY_PIVOT) where {Tv, Ti}
lu(SparseMatrixCSC{Tv, Ti}(rand(1,1)))
end

function qr_instance(jac_prototype::SparseMatrixCSC, pivot = DEFAULT_CHOLESKY_PIVOT)
qr(sparse(rand(1,1)))
function qr_instance(jac_prototype::SparseMatrixCSC{Tv, Ti}, pivot = DEFAULT_CHOLESKY_PIVOT) where {Tv, Ti}
qr(SparseMatrixCSC{Tv, Ti}(rand(1,1)))
end

end
3 changes: 3 additions & 0 deletions test/ad.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using ArrayInterface, ReverseDiff, Tracker, Test
x = ReverseDiff.track([4.0])
@test ArrayInterface.aos_to_soa(x) isa ReverseDiff.TrackedArray
x = reshape([ReverseDiff.track(rand(1, 1, 1))[1]], 1, 1, 1)
@test ArrayInterface.aos_to_soa(x) isa ReverseDiff.TrackedArray
@test ndims(ArrayInterface.aos_to_soa(x)) == 3
x = reduce(vcat, ReverseDiff.track([4.0,4.0]))
@test ArrayInterface.aos_to_soa(x) isa ReverseDiff.TrackedArray
x = [ReverseDiff.track([4.0])[1]]
Expand Down
4 changes: 3 additions & 1 deletion test/gpu/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
17 changes: 15 additions & 2 deletions test/gpu/cuda.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
using CUDA
using CUDSS, CUDA, SparseArrays, LinearAlgebra
using CUDA.CUSPARSE
using ArrayInterface

using Test

A_cpu = Float32[1 0; 0 1]
A_dense = CuMatrix(A_cpu)
A_sparse = CuSparseMatrixCSR(sparse(A_cpu))

# Test whether lu_instance throws an error when invoked with an gpu array
@test !isa(try ArrayInterface.lu_instance(CUDA.CuArray([1.f0 1.f0; 1.f0 1.f0])) catch ex ex end, Exception)
lu_inst_dense = ArrayInterface.lu_instance(A_dense)
lu_inst_sparse = ArrayInterface.lu_instance(A_sparse)

# test that lu! is valid when using the inst as scratch
lu_sparse = lu!(lu_inst_sparse, A_sparse)

#test that the resulting lu works
b = CuVector([1f0, 1f0])
@test CUDA.@allowscalar lu_sparse \ b == [1, 1]
8 changes: 8 additions & 0 deletions test/gpu/metal.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Metal
using ArrayInterface
using LinearAlgebra

using Test

# Test that lu_instance works with Metal.jl gpu arrays
@test isa(ArrayInterface.lu_instance(MtlArray([1.f0 1.f0; 1.f0 1.f0])), LU)
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ end
if GROUP == "GPU"
activate_gpu_env()
@time @safetestset "CUDA" begin include("gpu/cuda.jl") end
if Sys.isapple()
@time @safetestset "Metal" begin include("gpu/metal.jl") end
end
end
end