Skip to content

Commit a1992fb

Browse files
authored
Merge pull request #2062 from JuliaGPU/tb/gpucompiler
Adapt to GPUCompiler#master.
2 parents ac1bc29 + 760c2bd commit a1992fb

File tree

32 files changed

+111
-497
lines changed

32 files changed

+111
-497
lines changed

.buildkite/pipeline.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,27 +107,25 @@ steps:
107107
!build.pull_request.draft
108108
timeout_in_minutes: 120
109109
commands: |
110-
julia -e '
110+
julia --project -e '
111111
using Pkg
112-
Pkg.activate(joinpath(pwd(), "lib", lowercase("{{matrix.package}}")))
113112
114113
println("--- :julia: Instantiating project")
115114
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
116-
pkgs = [PackageSpec(path=pwd())]
115+
Pkg.instantiate()
116+
117+
pkgs = [PackageSpec(path=joinpath(pwd(), "lib", lowercase("{{matrix.package}}")))]
117118
if "{{matrix.package}}" == "cuTensorNet"
118119
# cuTensorNet depends on a development version of cuTENSOR
119120
push!(pkgs, PackageSpec(path=joinpath(pwd(), "lib", "cutensor")))
120121
end
121122
Pkg.develop(pkgs)
122-
Pkg.instantiate()
123123
124-
Pkg.add("CUDA_Runtime_jll")
125-
write(joinpath(pwd(), "lib", lowercase("{{matrix.package}}"), "LocalPreferences.toml"),
126-
"[CUDA_Runtime_jll]\nversion = \"{{matrix.cuda}}\"")
124+
write("LocalPreferences.toml", "[CUDA_Runtime_jll]\nversion = \"{{matrix.cuda}}\"")
127125
end
128126
129127
println("+++ :julia: Running tests")
130-
Pkg.test(coverage=true)'
128+
Pkg.test("{{matrix.package}}"; coverage=true)'
131129
132130
- group: ":telescope: Downstream"
133131
depends_on: "cuda"
@@ -142,25 +140,21 @@ steps:
142140
- lib
143141
- examples
144142
command: |
145-
julia -e '
143+
julia --project -e '
146144
using Pkg
147145
148146
println("--- :julia: Instantiating project")
149147
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
150-
Pkg.develop("NNlibCUDA")
151-
Pkg.activate("NNlibCUDA")
152-
153-
Pkg.develop([PackageSpec(path=pwd()),
154-
PackageSpec(path=joinpath(pwd(), "lib", "cudnn"))])
155148
Pkg.instantiate()
156149
157-
Pkg.add("CUDA_Runtime_jll")
158-
write(joinpath(Pkg.devdir(), "NNlibCUDA", "LocalPreferences.toml"),
159-
"[CUDA_Runtime_jll]\nversion = \"12.0\"")
150+
Pkg.develop("NNlibCUDA")
151+
Pkg.develop(path=joinpath(pwd(), "lib", "cudnn"))
152+
153+
write("LocalPreferences.toml", "[CUDA_Runtime_jll]\nversion = \"12.0\"")
160154
end
161155
162156
println("+++ :julia: Running tests")
163-
Pkg.test(coverage=true)'
157+
Pkg.test("NNlibCUDA"; coverage=true)'
164158
agents:
165159
queue: "juliagpu"
166160
cuda: "*"
@@ -292,10 +286,8 @@ steps:
292286
ENV["CODESPEED_ENVIRONMENT"] = ENV["BUILDKITE_AGENT_NAME"]
293287
294288
println("--- :julia: Instantiating project")
295-
Pkg.resolve()
296289
Pkg.instantiate()
297290
Pkg.activate("perf")
298-
Pkg.resolve()
299291
Pkg.instantiate()
300292
push!(LOAD_PATH, @__DIR__)
301293

Manifest.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.8.5"
44
manifest_format = "2.0"
5-
project_hash = "e8fd324aba09b72a771344d3910c4e1284ae62a0"
5+
project_hash = "c38f3e404ea342fb740cb16012407cbac90360fd"
66

77
[[deps.AbstractFFTs]]
88
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
@@ -170,9 +170,11 @@ version = "0.1.5"
170170

171171
[[deps.GPUCompiler]]
172172
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"]
173-
git-tree-sha1 = "8de395b1243771bbb79ac832ec96c7def7a4586f"
173+
git-tree-sha1 = "2bec2c336b65f1ca50c4fcb2933712503db8eb2d"
174+
repo-rev = "master"
175+
repo-url = "https://github.com/JuliaGPU/GPUCompiler.jl.git"
174176
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
175-
version = "0.22.0"
177+
version = "0.23.0"
176178

177179
[[deps.InlineStrings]]
178180
deps = ["Parsers"]

Project.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,15 @@ RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143"
3131
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
3232
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
3333
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
34-
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
3534
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3635
UnsafeAtomicsLLVM = "d80eeb9a-aca5-4d75-85e5-170c8b632249"
3736

37+
[weakdeps]
38+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
39+
40+
[extensions]
41+
SpecialFunctionsExt = "SpecialFunctions"
42+
3843
[compat]
3944
AbstractFFTs = "0.4, 0.5, 1.0"
4045
Adapt = "3.3"
@@ -47,7 +52,7 @@ Crayons = "4"
4752
DataFrames = "1"
4853
ExprTools = "0.1"
4954
GPUArrays = "8.6"
50-
GPUCompiler = "0.22"
55+
GPUCompiler = "0.23"
5156
KernelAbstractions = "0.9.2"
5257
LLVM = "6"
5358
NVTX = "0.3.2"
@@ -60,3 +65,6 @@ Requires = "0.5, 1.0"
6065
SpecialFunctions = "1.3, 2"
6166
UnsafeAtomicsLLVM = "0.1"
6267
julia = "1.8"
68+
69+
[extras]
70+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

src/device/intrinsics/special_math.jl renamed to ext/SpecialFunctionsExt.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# math functionality corresponding to SpecialFunctions.jl
22

3+
module SpecialFunctionsExt
4+
5+
using CUDA
6+
using CUDA: @device_override
7+
8+
isdefined(Base, :get_extension) ? (using SpecialFunctions) : (using ..SpecialFunctions)
9+
310

411
## error
512

@@ -46,3 +53,6 @@
4653

4754
@device_override SpecialFunctions.bessely(n::Int32, x::Float64) = ccall("extern __nv_yn", llvmcall, Cdouble, (Int32, Cdouble), n, x)
4855
@device_override SpecialFunctions.bessely(n::Int32, x::Float32) = ccall("extern __nv_ynf", llvmcall, Cfloat, (Int32, Cfloat), n, x)
56+
57+
58+
end

lib/cudnn/test/runtests.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
using Test
22

3-
# work around JuliaLang/Pkg.jl#2500
4-
if VERSION < v"1.8"
5-
test_project = first(Base.load_path())
6-
preferences_file = joinpath(dirname(@__DIR__), "LocalPreferences.toml")
7-
test_preferences_file = joinpath(dirname(test_project), "LocalPreferences.toml")
8-
if isfile(preferences_file) && !isfile(test_preferences_file)
9-
cp(preferences_file, test_preferences_file)
10-
end
11-
end
12-
133
using CUDA
144
@info "CUDA information:\n" * sprint(io->CUDA.versioninfo(io))
155

lib/cusolver/dense.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for (bname, fname,elty) in ((:cusolverDnSpotrf_bufferSize, :cusolverDnSpotrf, :F
2222
@eval begin
2323
function potrf!(uplo::Char,
2424
A::StridedCuMatrix{$elty})
25-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
25+
LinearAlgebra.BLAS.chkuplo(uplo)
2626
n = checksquare(A)
2727
lda = max(1, stride(A, 2))
2828

@@ -55,7 +55,7 @@ for (fname,elty) in ((:cusolverDnSpotrs, :Float32),
5555
function potrs!(uplo::Char,
5656
A::StridedCuMatrix{$elty},
5757
B::StridedCuVecOrMat{$elty})
58-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
58+
LinearAlgebra.BLAS.chkuplo(uplo)
5959
n = checksquare(A)
6060
if size(B, 1) != n
6161
throw(DimensionMismatch("first dimension of B, $(size(B,1)), must match second dimension of A, $n"))
@@ -83,7 +83,7 @@ for (bname, fname,elty) in ((:cusolverDnSpotri_bufferSize, :cusolverDnSpotri, :F
8383
@eval begin
8484
function potri!(uplo::Char,
8585
A::StridedCuMatrix{$elty})
86-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
86+
LinearAlgebra.BLAS.chkuplo(uplo)
8787
n = checksquare(A)
8888
lda = max(1, stride(A, 2))
8989

@@ -177,7 +177,7 @@ for (bname, fname,elty) in ((:cusolverDnSsytrf_bufferSize, :cusolverDnSsytrf, :F
177177
@eval begin
178178
function sytrf!(uplo::Char,
179179
A::StridedCuMatrix{$elty})
180-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
180+
LinearAlgebra.BLAS.chkuplo(uplo)
181181
n = checksquare(A)
182182
lda = max(1, stride(A, 2))
183183

@@ -502,7 +502,7 @@ for (jname, bname, fname, elty, relty) in ((:syevd!, :cusolverDnSsyevd_bufferSiz
502502
function $jname(jobz::Char,
503503
uplo::Char,
504504
A::StridedCuMatrix{$elty})
505-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
505+
LinearAlgebra.BLAS.chkuplo(uplo)
506506
n = checksquare(A)
507507
lda = max(1, stride(A, 2))
508508
W = CuArray{$relty}(undef, n)
@@ -542,7 +542,7 @@ for (jname, bname, fname, elty, relty) in ((:sygvd!, :cusolverDnSsygvd_bufferSiz
542542
uplo::Char,
543543
A::StridedCuMatrix{$elty},
544544
B::StridedCuMatrix{$elty})
545-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
545+
LinearAlgebra.BLAS.chkuplo(uplo)
546546
nA, nB = checksquare(A, B)
547547
if nB != nA
548548
throw(DimensionMismatch("Dimensions of A ($nA, $nA) and B ($nB, $nB) must match!"))
@@ -589,7 +589,7 @@ for (jname, bname, fname, elty, relty) in ((:sygvj!, :cusolverDnSsygvj_bufferSiz
589589
B::StridedCuMatrix{$elty};
590590
tol::$relty=eps($relty),
591591
max_sweeps::Int=100)
592-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
592+
LinearAlgebra.BLAS.chkuplo(uplo)
593593
nA, nB = checksquare(A, B)
594594
if nB != nA
595595
throw(DimensionMismatch("Dimensions of A ($nA, $nA) and B ($nB, $nB) must match!"))
@@ -643,7 +643,7 @@ for (jname, bname, fname, elty, relty) in ((:syevjBatched!, :cusolverDnSsyevjBat
643643
max_sweeps::Int=100)
644644

645645
# Set up information for the solver arguments
646-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
646+
LinearAlgebra.BLAS.chkuplo(uplo)
647647
n = checksquare(A)
648648
lda = max(1, stride(A, 2))
649649
batchSize = size(A,3)
@@ -702,7 +702,7 @@ for (fname, elty) in ((:cusolverDnSpotrsBatched, :Float32),
702702
throw(DimensionMismatch(""))
703703
end
704704
# Set up information for the solver arguments
705-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
705+
LinearAlgebra.BLAS.chkuplo(uplo)
706706
n = checksquare(A[1])
707707
if size(B[1], 1) != n
708708
throw(DimensionMismatch("first dimension of B[i], $(size(B[1],1)), must match second dimension of A, $n"))
@@ -741,7 +741,7 @@ for (fname, elty) in ((:cusolverDnSpotrfBatched, :Float32),
741741
function potrfBatched!(uplo::Char, A::Vector{<:StridedCuMatrix{$elty}})
742742

743743
# Set up information for the solver arguments
744-
VERSION >= v"1.8" && LinearAlgebra.BLAS.chkuplo(uplo)
744+
LinearAlgebra.BLAS.chkuplo(uplo)
745745
n = checksquare(A[1])
746746
lda = max(1, stride(A[1], 2))
747747
batchSize = length(A)

0 commit comments

Comments
 (0)