Skip to content

Commit 3e1561b

Browse files
Merge branch 'master' into qr_views
2 parents aa88c71 + 868d33e commit 3e1561b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+507
-300
lines changed

.buildkite/pipeline.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ steps:
145145
steps:
146146
- label: "{{matrix}} on CUDA 10"
147147
matrix:
148-
- "CUDNN"
149-
- "CUTENSOR"
148+
- "cuDNN"
149+
- "cuTENSOR"
150150
plugins:
151151
- JuliaCI/julia#v1:
152152
version: 1.6
@@ -178,10 +178,10 @@ steps:
178178
Pkg.test()'
179179
- label: "{{matrix}} on CUDA 11"
180180
matrix:
181-
- "CUDNN"
182-
- "CUTENSOR"
183-
- "CUSTATEVEC"
184-
- "CUTENSORNET"
181+
- "cuDNN"
182+
- "cuTENSOR"
183+
- "cuStateVec"
184+
- "cuTensorNet"
185185
plugins:
186186
- JuliaCI/julia#v1:
187187
version: 1.6
@@ -203,8 +203,8 @@ steps:
203203
204204
println("--- :julia: Instantiating project")
205205
Pkg.activate(joinpath(pwd(), "lib", lowercase("{{matrix}}")))
206-
if "{{matrix}}" == "CUTENSORNET"
207-
# HACK: CUTENSORNET depends on a development version of CUTENSOR
206+
if "{{matrix}}" == "cuTensorNet"
207+
# HACK: cuTensorNet depends on a development version of cuTENSOR
208208
Pkg.develop(path=joinpath(pwd(), "lib", "cutensor"))
209209
end
210210
Pkg.develop(path=pwd())
@@ -279,26 +279,26 @@ steps:
279279
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
280280
timeout_in_minutes: 60
281281

282-
- label: "Julia nightly"
283-
plugins:
284-
- JuliaCI/julia#v1:
285-
version: nightly
286-
- JuliaCI/julia-test#v1: ~
287-
- JuliaCI/julia-coverage#v1:
288-
codecov: true
289-
dirs:
290-
- src
291-
- lib
292-
- examples
293-
agents:
294-
queue: "juliagpu"
295-
cuda: "*"
296-
commands: |
297-
julia --project -e 'using CUDA; CUDA.set_runtime_version!("local")'
298-
if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
299-
timeout_in_minutes: 120
300-
soft_fail:
301-
- exit_status: 1
282+
# - label: "Julia nightly"
283+
# plugins:
284+
# - JuliaCI/julia#v1:
285+
# version: nightly
286+
# - JuliaCI/julia-test#v1: ~
287+
# - JuliaCI/julia-coverage#v1:
288+
# codecov: true
289+
# dirs:
290+
# - src
291+
# - lib
292+
# - examples
293+
# agents:
294+
# queue: "juliagpu"
295+
# cuda: "*"
296+
# commands: |
297+
# julia --project -e 'using CUDA; CUDA.set_runtime_version!("local")'
298+
# if: build.message !~ /\[skip tests\]/ && !build.pull_request.draft
299+
# timeout_in_minutes: 120
300+
# soft_fail:
301+
# - exit_status: 1
302302

303303
- label: "Documentation"
304304
plugins:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "CUDA"
22
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
3-
version = "4.0.0"
3+
version = "4.0.1"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

docs/src/installation/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ This generates the following `LocalPreferences.toml` file in your active environ
129129
version = "11.8"
130130
```
131131

132-
This preference is compatible with other CUDA JLLs, e.g., if you load CUDNN_jll it will
132+
This preference is compatible with other CUDA JLLs, e.g., if you load `CUDNN_jll` it will
133133
only select artifacts that are compatible with the configured CUDA runtime.
134134

135135
### Using a local CUDA
@@ -175,7 +175,7 @@ binaries aren't on a globally-discoverable path. For more information, run Julia
175175
`JULIA_DEBUG` environment variable set to `CUDA_Runtime_Discovery`.
176176

177177
Note that setting the version to `"local"` disables use of *any* CUDA-related JLL, not just
178-
of CUDA_Runtime_jll. This is out of necessity: JLLs are baked in the precompilation image at
178+
of `CUDA_Runtime_jll`. This is out of necessity: JLLs are baked in the precompilation image at
179179
compile time, while local toolkit discovery happens at run time; this inconsistency makes it
180180
impossible to select a compatible artifact for the JLLs. If you care about other JLLs, use
181181
CUDA from artifacts.

lib/cublas/CUBLAS.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ module CUBLAS
22

33
using ..APIUtils
44

5-
using ..CUDA_Runtime
6-
75
using ..CUDA
86
using ..CUDA: CUstream, cuComplex, cuDoubleComplex, libraryPropertyType, cudaDataType, i32
97
using ..CUDA: unsafe_free!, @retry_reclaim, isdebug, @sync, initialize_context
108

9+
using ..CUDA: CUDA_Runtime
10+
using ..CUDA_Runtime
11+
1112
using GPUArrays
1213

1314
using LinearAlgebra
@@ -235,6 +236,14 @@ function _log_message(blob)
235236
end
236237

237238
function __init__()
239+
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
240+
precompiling && return
241+
242+
if !CUDA_Runtime.is_available()
243+
#@error "cuBLAS is not available"
244+
return
245+
end
246+
238247
# register a log callback
239248
log_cond[] = Base.AsyncCondition() do async_cond
240249
blob = ""

lib/cudadrv/state.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,19 @@ function context(dev::CuDevice)
213213
end
214214

215215
if capability(dev) < v"3.5"
216-
@warn("""Your $(name(dev)) GPU does not meet the minimal required compute capability ($(capability(dev)) < 3.5).
217-
Some functionality might be unavailable.""",
218-
maxlog=1, _id=devidx)
216+
@error("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is not supported by CUDA.jl.
217+
Please use a device with at least capability 3.5.""",
218+
maxlog=1, _id=devidx)
219+
elseif runtime_version() >= v"12" && capability(dev) <= v"3.7"
220+
@error("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is not supported on CUDA 12+.
221+
Please use CUDA 11.8 or earlier (by calling `CUDA.set_runtime_version!`), or switch to a different device.""",
222+
maxlog=1, _id=devidx)
223+
elseif runtime_version() >= v"11" && capability(dev) <= v"3.7"
224+
# XXX: the 10.2 release notes mention that even sm_50 is deprecated,
225+
# but that isn't repeated in more recent release notes...
226+
@warn("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is deprecated on CUDA 11+.
227+
Some functionality may be broken; It's recommended to switch to a different device.""",
228+
maxlog=1, _id=devidx)
219229
end
220230

221231
# configure the primary context

lib/cudnn/LICENSE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
The CUDA.jl package is licensed under the MIT "Expat" License:
2+
3+
> Copyright (c) 2019-present: Julia Computing and other contributors
4+
>
5+
> Copyright (c) 2014-2018: Tim Besard
6+
>
7+
> Copyright (c) 2013: Dahua Lin
8+
>
9+
> All Rights Reserved.
10+
>
11+
> Permission is hereby granted, free of charge, to any person obtaining a copy
12+
> of this software and associated documentation files (the "Software"), to deal
13+
> in the Software without restriction, including without limitation the rights
14+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
> copies of the Software, and to permit persons to whom the Software is
16+
> furnished to do so, subject to the following conditions:
17+
>
18+
> The above copyright notice and this permission notice shall be included in all
19+
> copies or substantial portions of the Software.
20+
>
21+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
> SOFTWARE.
28+
>

lib/cudnn/Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name = "CUDNN"
1+
name = "cuDNN"
22
uuid = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
33
authors = ["Tim Besard <tim.besard@gmail.com>"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
88
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
99
CUDNN_jll = "62b44479-cb7b-5706-934f-f13b2eb2e645"
10-
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1110

1211
[compat]
1312
CUDNN_jll = "~8.6"
13+
CUDA = "~4.0"
14+
CEnum = "0.2, 0.3, 0.4"
15+
julia = "1.6"

lib/cudnn/src/convolution.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Keyword arguments describing the convolution when `d` is not given:
4040
* `stride = 1`: how far to shift the convolution window at each step
4141
* `dilation = 1`: dilation factor
4242
* `group = 1`: number of groups to be used
43-
* `mathType = CUDNN.math_mode()`: whether or not the use of tensor op is permitted
43+
* `mathType = cuDNN.math_mode()`: whether or not the use of tensor op is permitted
4444
* `reorderType = CUDNN_DEFAULT_REORDER`: convolution reorder type
4545
"""
4646
cudnnConvolutionForward, cudnnConvolutionForward!

lib/cudnn/src/CUDNN.jl renamed to lib/cudnn/src/cuDNN.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
CUDNN
2+
cuDNN
33
44
High level interface to cuDNN functions. See
55
[README.md](https://github.com/JuliaGPU/CUDA.jl/blob/master/lib/cudnn/README.md) for a
66
design overview.
77
"""
8-
module CUDNN
8+
module cuDNN
99

1010
using CUDA
1111
using CUDA.APIUtils
@@ -20,8 +20,11 @@ using CUDNN_jll
2020
export has_cudnn
2121

2222
function has_cudnn(show_reason::Bool=false)
23-
if !isdefined(CUDNN_jll, :libcudnn)
24-
show_reason && error("CUDNN library not found")
23+
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
24+
precompiling && return
25+
26+
if !CUDNN_jll.is_available()
27+
show_reason && error("cuDNN library not found")
2528
return false
2629
end
2730
return true
@@ -72,7 +75,7 @@ function handle()
7275

7376
# every task maintains library state per device
7477
LibraryState = @NamedTuple{handle::cudnnHandle_t, stream::CuStream}
75-
states = get!(task_local_storage(), :CUDNN) do
78+
states = get!(task_local_storage(), :cuDNN) do
7679
Dict{CuContext,LibraryState}()
7780
end::Dict{CuContext,LibraryState}
7881

@@ -155,13 +158,16 @@ function _log_message(sev, dbg, str)
155158
end
156159

157160
function __init__()
158-
if version() < v"8.0"
159-
@warn "This version of CUDA.jl only supports CUDNN 8.0 or higher"
161+
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
162+
precompiling && return
163+
164+
if !CUDNN_jll.is_available()
165+
#@error "cuDNN is not available for your platform ($(Base.BinaryPlatforms.triplet(CUDNN_jll.host_platform)))"
166+
return
160167
end
161168

162169
# register a log callback
163-
if (isdebug(:init, CUDNN) || Base.JLOptions().debug_level >= 2) &&
164-
version() >= v"8.2" # NVIDIA bug #3256123
170+
if isdebug(:init, cuDNN) || Base.JLOptions().debug_level >= 2
165171
log_cond[] = Base.AsyncCondition() do async_cond
166172
message = Base.@lock log_lock popfirst!(log_messages)
167173
_log_message(message...)

lib/cudnn/src/dropout.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the same values deterministically for debugging. Note that this slows down the o
1313
about 40x.
1414
1515
The global constant `cudnnDropoutState::Dict` holds the random number generator state for
16-
each CUDNN handle.
16+
each cuDNN handle.
1717
"""
1818
cudnnDropoutForward, cudnnDropoutForward!, cudnnDropoutSeed, cudnnDropoutState
1919

0 commit comments

Comments
 (0)