Skip to content

Commit 02676d0

Browse files
authored
Basic set up for GPU CI on TensorKit (#281)
* Pipeline for CUDA/AMD * Skeleton for GPU tests in test/runtests
1 parent 568233b commit 02676d0

File tree

2 files changed

+82
-20
lines changed

2 files changed

+82
-20
lines changed

.buildkite/pipeline.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
env:
2+
SECRET_CODECOV_TOKEN: "IAcIDwEfSDEfjfVOQ5VI9apT8mLPcJDIRoZa+D0GvUB6HyEjemG+mZD8uzLbQ0OD7cokQyIO+XpuGCh6wzGCb1Ma2xnqXgTXAKLkMceVm/RVlA80vlo0kjeBjx1h2j2oQeXTsTIt+EWAeKgw3bgZ69vdATgG52JY/z9ia/OhJ7LFMMkEQvXXiKMp0AU5JC+nl/HHgLARb70qqCuPEdCPZa2LZzRfr4D02Rf3/UqAcPXj7KYzw0sxD8R+g6onvqmE2E3OkmpGPQgFXrGrYw9p+PUJqjeXSkZrC1pe1wDh8ge4YXJhHm44M+9XaPlK4IYGA0PJbfaFGMpIhN+5GJlauQ==;U2FsdGVkX1+F3w+O36dLAUvzVtMF7G+WAdqcL4pcsE/vtyTsjXZvpAv/iT1H32gNRNE9f7OjS9pke092rCDZpw=="
3+
4+
steps:
5+
- label: "Julia {{matrix.julia}} -- CUDA"
6+
plugins:
7+
- JuliaCI/julia#v1:
8+
version: "{{matrix.julia}}"
9+
- JuliaCI/julia-test#v1: ~
10+
- JuliaCI/julia-coverage#v1:
11+
dirs:
12+
- src
13+
- ext
14+
agents:
15+
queue: "juliagpu"
16+
cuda: "*"
17+
if: build.message !~ /\[skip tests\]/
18+
timeout_in_minutes: 30
19+
matrix:
20+
setup:
21+
julia:
22+
- "1.10"
23+
- "1.11"
24+
25+
- label: "Julia {{matrix.julia}} -- AMDGPU"
26+
plugins:
27+
- JuliaCI/julia#v1:
28+
version: "{{matrix.julia}}"
29+
- JuliaCI/julia-test#v1: ~
30+
- JuliaCI/julia-coverage#v1:
31+
dirs:
32+
- src
33+
- ext
34+
agents:
35+
queue: "juliagpu"
36+
rocm: "*"
37+
rocmgpu: "*"
38+
if: build.message !~ /\[skip tests\]/
39+
timeout_in_minutes: 30
40+
matrix:
41+
setup:
42+
julia:
43+
- "1.10"
44+
- "1.11"

test/runtests.jl

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const TK = TensorKit
1515

1616
Random.seed!(1234)
1717

18+
# don't run all tests on GPU, only the GPU
19+
# specific ones
20+
is_buildkite = get(ENV, "BUILDKITE", "false") == "true"
21+
1822
smallset(::Type{I}) where {I<:Sector} = take(values(I), 5)
1923
function smallset(::Type{ProductSector{Tuple{I1,I2}}}) where {I1,I2}
2024
iter = product(smallset(I1), smallset(I2))
@@ -112,24 +116,38 @@ VSU₂U₁ = (Vect[SU2Irrep ⊠ U1Irrep]((0, 0) => 1, (1 // 2, -1) => 1),
112116
# ℂ[SU3Irrep]((1, 0, 0) => 1, (2, 0, 0) => 1),
113117
# ℂ[SU3Irrep]((0, 0, 0) => 1, (1, 0, 0) => 1, (1, 1, 0) => 1)')
114118

115-
Ti = time()
116-
include("fusiontrees.jl")
117-
include("spaces.jl")
118-
include("tensors.jl")
119-
include("diagonal.jl")
120-
include("planar.jl")
121-
# TODO: remove once we know AD is slow on macOS CI
122-
if !(Sys.isapple() && get(ENV, "CI", "false") == "true") && isempty(VERSION.prerelease)
123-
include("ad.jl")
124-
end
125-
include("bugfixes.jl")
126-
Tf = time()
127-
printstyled("Finished all tests in ",
128-
string(round((Tf - Ti) / 60; sigdigits=3)),
129-
" minutes."; bold=true, color=Base.info_color())
130-
println()
131-
132-
@testset "Aqua" verbose = true begin
133-
using Aqua
134-
Aqua.test_all(TensorKit)
119+
if !is_buildkite
120+
Ti = time()
121+
include("fusiontrees.jl")
122+
include("spaces.jl")
123+
include("tensors.jl")
124+
include("diagonal.jl")
125+
include("planar.jl")
126+
# TODO: remove once we know AD is slow on macOS CI
127+
if !(Sys.isapple() && get(ENV, "CI", "false") == "true") && isempty(VERSION.prerelease)
128+
include("ad.jl")
129+
end
130+
include("bugfixes.jl")
131+
Tf = time()
132+
printstyled("Finished all tests in ",
133+
string(round((Tf - Ti) / 60; sigdigits=3)),
134+
" minutes."; bold=true, color=Base.info_color())
135+
println()
136+
@testset "Aqua" verbose = true begin
137+
using Aqua
138+
Aqua.test_all(TensorKit)
139+
end
140+
else
141+
Ti = time()
142+
#=using CUDA
143+
if CUDA.functional()
144+
end
145+
using AMDGPU
146+
if AMDGPU.functional()
147+
end=#
148+
Tf = time()
149+
printstyled("Finished all GPU tests in ",
150+
string(round((Tf - Ti) / 60; sigdigits=3)),
151+
" minutes."; bold=true, color=Base.info_color())
152+
println()
135153
end

0 commit comments

Comments
 (0)