Skip to content

Commit 7734190

Browse files
authored
Merge pull request #2291 from JuliaGPU/tb/julia_1.11
Towards supporting Julia 1.11
2 parents b3e1bdf + 69c7f24 commit 7734190

File tree

5 files changed

+41
-24
lines changed

5 files changed

+41
-24
lines changed

.buildkite/pipeline.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ steps:
2727
- "1.8"
2828
- "1.9"
2929
- "1.10"
30+
- "1.11"
3031
- "nightly"
3132
adjustments:
33+
- with:
34+
julia: "1.11"
35+
soft_fail: true
3236
- with:
3337
julia: "nightly"
3438
soft_fail: true

lib/cusolver/linalg.jl

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Base.:\(_A::CuMatOrAdj, _B::CuOrAdj)
3434
if n < m
3535
# LQ decomposition
3636
At = CuMatrix(A')
37-
F, tau = CUSOLVER.geqrf!(At) # A = RᴴQᴴ
37+
F, tau = geqrf!(At) # A = RᴴQᴴ
3838
if B isa CuVector{T}
3939
CUBLAS.trsv!('U', 'C', 'N', view(F,1:n,1:n), B)
4040
X = CUDA.zeros(T, m)
@@ -45,15 +45,15 @@ function Base.:\(_A::CuMatOrAdj, _B::CuOrAdj)
4545
X = CUDA.zeros(T, m, p)
4646
view(X, 1:n, :) .= B
4747
end
48-
CUSOLVER.ormqr!('L', 'N', F, tau, X)
48+
ormqr!('L', 'N', F, tau, X)
4949
elseif n == m
5050
# LU decomposition with partial pivoting
51-
F, p, info = CUSOLVER.getrf!(A) # PA = LU
52-
X = CUSOLVER.getrs!('N', F, p, B)
51+
F, p, info = getrf!(A) # PA = LU
52+
X = getrs!('N', F, p, B)
5353
else
5454
# QR decomposition
55-
F, tau = CUSOLVER.geqrf!(A) # A = QR
56-
CUSOLVER.ormqr!('L', 'C', F, tau, B)
55+
F, tau = geqrf!(A) # A = QR
56+
ormqr!('L', 'C', F, tau, B)
5757
if B isa CuVector{T}
5858
X = B[1:m]
5959
CUBLAS.trsv!('U', 'N', 'N', view(F,1:m,1:m), X)
@@ -307,9 +307,22 @@ end
307307

308308
## LU
309309

310-
function LinearAlgebra.lu!(A::StridedCuMatrix{T}, ::RowMaximum; check::Bool = true) where {T}
310+
function _check_lu_success(info, allowsingular)
311+
if VERSION >= v"1.11.0-DEV.1535"
312+
if info < 0 # zero pivot error from unpivoted LU
313+
LinearAlgebra.checknozeropivot(-info)
314+
else
315+
allowsingular || LinearAlgebra.checknonsingular(info)
316+
end
317+
else
318+
LinearAlgebra.checknonsingular(info)
319+
end
320+
end
321+
322+
function LinearAlgebra.lu!(A::StridedCuMatrix{T}, ::RowMaximum;
323+
check::Bool=true, allowsingular::Bool=false) where {T}
311324
lpt = getrf!(A)
312-
check && LinearAlgebra.checknonsingular(lpt[3])
325+
check && _check_lu_success(lpt[3], allowsingular)
313326
return LU(lpt[1], lpt[2], Int(lpt[3]))
314327
end
315328

test/base/sorting.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using Random
22
using DataStructures
33

4-
@testset "quicksort" begin
5-
6-
import CUDA.QuickSortImpl: flex_lt, find_partition, quicksort!,
7-
partition_batches_kernel, consolidate_batch_partition, bubble_sort
4+
import CUDA.QuickSortImpl: flex_lt, find_partition, quicksort!, partition_batches_kernel,
5+
consolidate_batch_partition, bubble_sort
86

97
@testset "integer functions" begin
108
@test flex_lt(1, 2, false, isless, identity) == true
@@ -279,9 +277,6 @@ end
279277
end
280278
end
281279

282-
# XXX: some tests here make compute-sanitizer hang, but only on CI.
283-
# maybe related to the container set-up? try again once we use Sandbox.jl.
284-
285280
@testset "interface" begin
286281
@testset "quicksort" begin
287282
# pre-sorted
@@ -389,7 +384,7 @@ end
389384
@test check_sortperm(Float64, 1000000; rev=true)
390385
@test check_sortperm(Float64, 1000000; by=x->abs(x-0.5))
391386
@test check_sortperm(Float64, 1000000; rev=true, by=x->abs(x-0.5))
392-
387+
393388
if VERSION >= v"1.9"
394389
# Base.jl didn't implement sortperm(;dims) until 1.9
395390
@test check_sortperm(Float32, (100_000, 16); dims=1)
@@ -406,5 +401,3 @@ end
406401
# mismatched types (JuliaGPU/CUDA.jl#2046)
407402
@test check_sortperm!(collect(UInt64(1):UInt64(1000000)), Int64, 1000000)
408403
end
409-
410-
end

test/libraries/cusolver/dense_generic.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,20 @@ p = 5
128128
A = rand(elty,m,n)
129129
d_A = CuMatrix(A)
130130
U, Σ, V, err_sigma = CUSOLVER.Xgesvdp!('V', 0, d_A)
131-
@test A collect(U[:,1:n] * Diagonal(Σ) * V')
131+
@test A collect(U[:,1:n]) * Diagonal(collect(Σ)) * collect(V)'
132132

133133
d_A = CuMatrix(A)
134134
U, Σ, V, err_sigma = CUSOLVER.Xgesvdp!('V', 1, d_A)
135-
@test A collect(U * Diagonal(Σ) * V')
135+
@test A collect(U) * Diagonal(collect(Σ)) * collect(V)'
136136

137137
A = rand(elty,n,m)
138138
d_A = CuMatrix(A)
139139
U, Σ, V, err_sigma = CUSOLVER.Xgesvdp!('V', 0, d_A)
140-
@test A collect(U * Diagonal(Σ) * V[:,1:n]')
140+
@test A collect(U) * Diagonal(collect(Σ)) * collect(V[:,1:n])'
141141

142142
d_A = CuMatrix(A)
143143
U, Σ, V, err_sigma = CUSOLVER.Xgesvdp!('V', 1, d_A)
144-
@test A collect(U * Diagonal(Σ) * V')
144+
@test A collect(U) * Diagonal(collect(Σ)) * collect(V)'
145145
end
146146

147147
# @testset "gesvdr!" begin

test/setup.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,15 @@ function runtests(f, name, time_source=:cuda)
9393
else
9494
missing
9595
end
96-
passes,fails,error,broken,c_passes,c_fails,c_errors,c_broken =
97-
Test.get_test_counts(data[1])
96+
if VERSION >= v"1.11.0-DEV.1529"
97+
tc = Test.get_test_counts(data[1])
98+
passes,fails,error,broken,c_passes,c_fails,c_errors,c_broken =
99+
tc.passes, tc.fails, tc.errors, tc.broken, tc.cumulative_passes,
100+
tc.cumulative_fails, tc.cumulative_errors, tc.cumulative_broken
101+
else
102+
passes,fails,errors,broken,c_passes,c_fails,c_errors,c_broken =
103+
Test.get_test_counts(data[1])
104+
end
98105
if data[1].anynonpass == false
99106
data = ((passes+c_passes,broken+c_broken),
100107
data[2],

0 commit comments

Comments
 (0)