Skip to content

Commit b60f37a

Browse files
authored
Update to CUDNN 8.8.1 for CUDA 12 compatibility. (#1792)
Also re-instate init error messages on subpackages when CUDA is functional.
1 parent e9141d5 commit b60f37a

File tree

9 files changed

+98
-19
lines changed

9 files changed

+98
-19
lines changed

.buildkite/pipeline.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ steps:
5757
- examples
5858
agents:
5959
queue: "juliagpu"
60-
cuda: "11.0"
60+
cuda: "*"
6161
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
6262
timeout_in_minutes: 120
6363
matrix:
@@ -95,7 +95,7 @@ steps:
9595
- examples
9696
agents:
9797
queue: "juliagpu"
98-
cuda: "11.0"
98+
cuda: "*"
9999
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
100100
timeout_in_minutes: 120
101101
commands: |
@@ -117,10 +117,46 @@ steps:
117117
println("+++ :julia: Running tests")
118118
Pkg.test()'
119119
120+
- label: "{{matrix}} on CUDA 12"
121+
matrix:
122+
- "cuDNN"
123+
plugins:
124+
- JuliaCI/julia#v1:
125+
version: 1.6
126+
- JuliaCI/julia-coverage#v1:
127+
codecov: true
128+
dirs:
129+
- src
130+
- lib
131+
- examples
132+
agents:
133+
queue: "juliagpu"
134+
cuda: "*"
135+
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
136+
timeout_in_minutes: 120
137+
commands: |
138+
julia -e '
139+
using Pkg
140+
141+
println("--- :julia: Instantiating project")
142+
Pkg.activate(joinpath(pwd(), "lib", lowercase("{{matrix}}")))
143+
if "{{matrix}}" == "cuTensorNet"
144+
# HACK: cuTensorNet depends on a development version of cuTENSOR
145+
Pkg.develop(path=joinpath(pwd(), "lib", "cutensor"))
146+
end
147+
Pkg.develop(path=pwd())
148+
Pkg.instantiate()
149+
150+
using CUDA
151+
CUDA.set_runtime_version!(v"12.0")
152+
153+
println("+++ :julia: Running tests")
154+
Pkg.test()'
155+
120156
- group: ":telescope: Downstream"
121157
depends_on: "cuda"
122158
steps:
123-
- label: "NNlibCUDA.jl"
159+
- label: "NNlibCUDA.jl on CUDA 12"
124160
plugins:
125161
- JuliaCI/julia#v1:
126162
version: 1.6
@@ -136,18 +172,20 @@ steps:
136172
137173
println("--- :julia: Instantiating project")
138174
Pkg.develop(path=pwd())
175+
Pkg.develop(path=joinpath(pwd(), "lib", "cudnn"))
139176
Pkg.add(name="NNlibCUDA", rev="master")
140177
Pkg.instantiate()
141178
179+
using CUDA
180+
CUDA.set_runtime_version!(v"12.0")
181+
142182
println("+++ :julia: Running tests")
143183
Pkg.test("NNlibCUDA"; coverage=true)'
144184
agents:
145185
queue: "juliagpu"
146186
cuda: "*"
147187
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
148188
timeout_in_minutes: 60
149-
soft_fail:
150-
- exit_status: 1
151189

152190
- group: ":eyes: Special"
153191
depends_on: "cuda"
@@ -216,7 +254,7 @@ steps:
216254
- examples
217255
agents:
218256
queue: "juliagpu"
219-
cuda: "11.0"
257+
cuda: "*"
220258
env:
221259
JULIA_CUDA_USE_COMPAT: 'false' # NVIDIA bug #3418723: injection tools prevent probing libcuda
222260
commands: |

lib/cudnn/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
99
CUDNN_jll = "62b44479-cb7b-5706-934f-f13b2eb2e645"
1010

1111
[compat]
12-
CUDNN_jll = "~8.6"
12+
CUDNN_jll = "~8.8"
1313
CUDA = "~4.0"
1414
CEnum = "0.2, 0.3, 0.4"
1515
julia = "1.6"

lib/cudnn/src/cuDNN.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function has_cudnn(show_reason::Bool=false)
2424
precompiling && return
2525

2626
if !CUDNN_jll.is_available()
27-
show_reason && error("cuDNN library not found")
27+
show_reason && error("cuDNN JLL not available")
2828
return false
2929
end
3030
return true
@@ -161,8 +161,10 @@ function __init__()
161161
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
162162
precompiling && return
163163

164+
CUDA.functional() || return
165+
164166
if !CUDNN_jll.is_available()
165-
#@error "cuDNN is not available for your platform ($(Base.BinaryPlatforms.triplet(CUDNN_jll.host_platform)))"
167+
@error "cuDNN is not available for your platform ($(Base.BinaryPlatforms.triplet(CUDNN_jll.host_platform)))"
166168
return
167169
end
168170

lib/cudnn/src/libcudnn.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const cudnnTensorTransformDescriptor_t = Ptr{cudnnTensorTransformStruct}
164164
CUDNN_DATA_BOOLEAN = 11
165165
CUDNN_DATA_FP8_E4M3 = 12
166166
CUDNN_DATA_FP8_E5M2 = 13
167+
CUDNN_DATA_FAST_FLOAT_FOR_FP8 = 14
167168
end
168169

169170
@cenum cudnnMathType_t::UInt32 begin
@@ -3554,6 +3555,38 @@ end
35543555
@ccall libcudnn.cudnnCnnTrainVersionCheck()::cudnnStatus_t
35553556
end
35563557

3558+
const CUDNN_MAX_SM_MAJOR_NUMBER = 9
3559+
3560+
const CUDNN_MAX_SM_MINOR_NUMBER = 0
3561+
3562+
const CUDNN_SM_50 = 500
3563+
3564+
const CUDNN_SM_52 = 520
3565+
3566+
const CUDNN_SM_53 = 530
3567+
3568+
const CUDNN_SM_60 = 600
3569+
3570+
const CUDNN_SM_61 = 610
3571+
3572+
const CUDNN_SM_62 = 620
3573+
3574+
const CUDNN_SM_70 = 700
3575+
3576+
const CUDNN_SM_72 = 720
3577+
3578+
const CUDNN_SM_75 = 750
3579+
3580+
const CUDNN_SM_80 = 800
3581+
3582+
const CUDNN_SM_86 = 860
3583+
3584+
const CUDNN_SM_87 = 870
3585+
3586+
const CUDNN_SM_89 = 890
3587+
3588+
const CUDNN_SM_90 = 900
3589+
35573590
const CUDNN_DIM_MAX = 8
35583591

35593592
const CUDNN_LRN_MIN_N = 1

lib/custatevec/src/cuStateVec.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export has_custatevec
1313

1414
function has_custatevec(show_reason::Bool=false)
1515
if !cuQuantum_jll.is_available()
16-
show_reason && error("cuStateVec library not found")
16+
show_reason && error("cuStateVec JLL not available")
1717
return false
1818
end
1919
return true
@@ -109,8 +109,10 @@ function __init__()
109109
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
110110
precompiling && return
111111

112+
CUDA.functional() || return
113+
112114
if !cuQuantum_jll.is_available()
113-
#@error "cuQuantum is not available for your platform ($(Base.BinaryPlatforms.triplet(cuQuantum_jll.host_platform)))"
115+
@error "cuQuantum is not available for your platform ($(Base.BinaryPlatforms.triplet(cuQuantum_jll.host_platform)))"
114116
return
115117
end
116118

lib/cutensor/src/cuTENSOR.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export has_cutensor
1414

1515
function has_cutensor(show_reason::Bool=false)
1616
if !CUTENSOR_jll.is_available()
17-
show_reason && error("cuTENSOR library not found")
17+
show_reason && error("cuTENSOR JLL not available")
1818
return false
1919
end
2020
return true
@@ -93,8 +93,10 @@ function __init__()
9393
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
9494
precompiling && return
9595

96+
CUDA.functional() || return
97+
9698
if !CUTENSOR_jll.is_available()
97-
#@error "cuTENSOR is not available for your platform ($(Base.BinaryPlatforms.triplet(CUTENSOR_jll.host_platform)))"
99+
@error "cuTENSOR is not available for your platform ($(Base.BinaryPlatforms.triplet(CUTENSOR_jll.host_platform)))"
98100
return
99101
end
100102

lib/cutensornet/src/cuTensorNet.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export has_cutensornet
1717

1818
function has_cutensornet(show_reason::Bool=false)
1919
if !cuQuantum_jll.is_available()
20-
show_reason && error("cuTensorNet library not found")
20+
show_reason && error("cuTensorNet JLL not available")
2121
return false
2222
end
2323
return true
@@ -110,8 +110,10 @@ function __init__()
110110
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
111111
precompiling && return
112112

113+
CUDA.functional() || return
114+
113115
if !cuQuantum_jll.is_available()
114-
#@error "cuQuantum is not available for your platform ($(Base.BinaryPlatforms.triplet(cuQuantum_jll.host_platform)))"
116+
@error "cuQuantum is not available for your platform ($(Base.BinaryPlatforms.triplet(cuQuantum_jll.host_platform)))"
115117
return
116118
end
117119

res/wrap/Manifest.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ uuid = "4f82f1eb-248c-5f56-a42e-99106d144614"
4040
version = "12.1.0+0"
4141

4242
[[CUDNN_jll]]
43-
deps = ["Artifacts", "CUDA_Runtime_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg", "TOML"]
44-
git-tree-sha1 = "57011df4fce448828165e566af9befa2ea94350a"
43+
deps = ["Artifacts", "CUDA_Runtime_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
44+
git-tree-sha1 = "2918fbffb50e3b7a0b9127617587afa76d4276e8"
4545
uuid = "62b44479-cb7b-5706-934f-f13b2eb2e645"
46-
version = "8.6.0+3"
46+
version = "8.8.1+0"
4747

4848
[[CUTENSOR_jll]]
4949
deps = ["Artifacts", "CUDA_Runtime_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg", "TOML"]

res/wrap/libcudnn_prologue.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CUDNN uses CUDA runtime objects, which are compatible with our driver usage
1+
# cuDNN uses CUDA runtime objects, which are compatible with our driver usage
22
const cudaStream_t = CUstream
33

44
# outlined functionality to avoid GC frame allocation

0 commit comments

Comments
 (0)