Skip to content

Commit b9a7eb2

Browse files
committed
Split up the test suite into three test groups
1 parent f9d0482 commit b9a7eb2

File tree

8 files changed

+342
-307
lines changed

8 files changed

+342
-307
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# env:
2-
# SECRET_CODECOV_TOKEN: "..."
1+
env:
2+
JULIA_NUM_THREADS: "1"
3+
# SECRET_CODECOV_TOKEN: "..."
34

45
steps:
56
- label: "Julia 1.5"

.github/workflow/CompatHelper.yml renamed to .github/workflows/CompatHelper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CompatHelper
22
on:
33
schedule:
4-
- cron: '00 00 * * *'
4+
- cron: 0 0 * * *
55
workflow_dispatch:
66
jobs:
77
CompatHelper:
@@ -12,5 +12,5 @@ jobs:
1212
- name: CompatHelper.main()
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
1616
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/ci-julia-nightly.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ on:
99
tags: '*'
1010
jobs:
1111
test-julia-nightly:
12-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
12+
name: Julia ${{ matrix.version }}/${{ matrix.os }}/${{ matrix.arch }}/group ${{ matrix.group }}/${{ matrix.threads }} threads/${{ github.event_name }}
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
JULIA_NUM_THREADS:
17+
arch:
18+
- x64
19+
group:
1820
- '1'
19-
- '6'
20-
version:
21-
- 'nightly'
21+
- '2'
22+
- '3'
2223
os:
2324
- ubuntu-latest
24-
arch:
25-
- x64
25+
threads:
26+
- '1'
27+
- '2'
28+
version:
29+
- 'nightly'
2630
steps:
2731
- uses: actions/checkout@v2
2832
- uses: julia-actions/setup-julia@v1
@@ -41,6 +45,8 @@ jobs:
4145
${{ runner.os }}-
4246
- uses: julia-actions/julia-buildpkg@v1
4347
- uses: julia-actions/julia-runtest@v1
48+
env:
49+
JULIA_NUM_THREADS: ${{ matrix.threads }}
4450
- uses: julia-actions/julia-processcoverage@v1
4551
- uses: codecov/codecov-action@v1
4652
with:

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ on:
99
tags: '*'
1010
jobs:
1111
test:
12-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
12+
name: Julia ${{ matrix.version }}/${{ matrix.os }}/${{ matrix.arch }}/group ${{ matrix.group }}/${{ matrix.threads }} threads/${{ github.event_name }}
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
JULIA_NUM_THREADS:
17+
arch:
18+
- x64
19+
group:
20+
- '1'
21+
- '2'
22+
- '3'
23+
os:
24+
- ubuntu-latest
25+
threads:
1826
- '1'
19-
- '6'
27+
- '2'
2028
version:
2129
- '1.4'
2230
- '1' # automatically expands to the latest stable 1.x release of Julia
23-
os:
24-
- ubuntu-latest
25-
arch:
26-
- x64
2731
steps:
2832
- uses: actions/checkout@v2
2933
- uses: julia-actions/setup-julia@v1
@@ -43,7 +47,7 @@ jobs:
4347
- uses: julia-actions/julia-buildpkg@v1
4448
- uses: julia-actions/julia-runtest@v1
4549
env:
46-
JULIA_NUM_THREADS: ${{ matrix.JULIA_NUM_THREADS }}
50+
JULIA_NUM_THREADS: ${{ matrix.threads }}
4751
- uses: julia-actions/julia-processcoverage@v1
4852
- uses: codecov/codecov-action@v1
4953
with:

test/group-1.jl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#===== stuff =====#
2+
3+
t2 = time()
4+
5+
@testset "parsing all the things" begin include("parsing.jl") end
6+
7+
@testset "tests from Einsum.jl" begin include("einsum.jl") end
8+
9+
@info @sprintf("Basic tests took %.1f seconds", time()-t2)
10+
11+
@testset "internal pieces" begin include("utils.jl") end
12+
13+
@testset "matrix multiplication" begin
14+
# size 200 is big enough to test block_halves even with MINIBLOCK = 64^3
15+
@testset "size $N, elements $T" for N in [2, 20, 200], T in [1:99, Float32, Float64, ComplexF64]
16+
for f in [identity, adjoint]
17+
A = f(rand(T, N,N));
18+
B = f(rand(T, N,N));
19+
@test A * B @tullio C[i,k] := A[i,j] * B[j,k]
20+
end
21+
if N < 200
22+
X = rand(T, N,N+1);
23+
Y = rand(T, N+1,N+2);
24+
Z = rand(T, N+2,N+1);
25+
@test X * Y * Z @tullio C[a,d] := X[a,b] * Y[b,c] * Z[c,d]
26+
end
27+
end
28+
@testset "@allocated" begin
29+
m!(C,A,B) = @tullio C[i,k] = A[i,j] * B[j,k] threads=false
30+
C1, A1, B1 = rand(4,4), rand(4,4), rand(4,4)
31+
@allocated m!(C1, A1, B1)
32+
@test 0 == @allocated m!(C1, A1, B1)
33+
end
34+
end
35+
36+
#===== Tracker =====#
37+
38+
t3 = time()
39+
using Tracker
40+
41+
GRAD = :Tracker
42+
_gradient(x...) = Tracker.gradient(x...)
43+
44+
@tullio grad=Base
45+
@testset "gradients: Tracker + DiffRules" begin include("gradients.jl") end
46+
47+
@tullio grad=Dual
48+
@testset "gradients: Tracker + ForwardDiff" begin include("gradients.jl") end
49+
50+
@info @sprintf("Tracker tests took %.1f seconds", time()-t3)

test/group-2.jl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#===== KernelAbstractions =====#
2+
3+
t4 = time()
4+
using KernelAbstractions
5+
6+
using Tracker
7+
8+
GRAD = :Tracker
9+
_gradient(x...) = Tracker.gradient(x...)
10+
11+
@testset "KernelAbstractions + gradients" begin
12+
A = (rand(3,4));
13+
B = (rand(4,5));
14+
@tullio C[i,k] := A[i,j] * B[j,k] threads=false # verbose=2
15+
@test C A * B
16+
17+
@tullio threads=false # else KernelAbstractions CPU kernels not used
18+
include("gradients.jl")
19+
@tullio threads=true
20+
21+
for sy in Tullio.SYMBOLS
22+
@test !isdefined(@__MODULE__, sy)
23+
end
24+
end
25+
26+
using CUDA
27+
28+
if is_buildkite
29+
# If we are on Buildkite, we should assert that we have a CUDA GPU available
30+
@test CUDA.has_cuda_gpu()
31+
end
32+
33+
if CUDA.has_cuda_gpu()
34+
@info "===== found a GPU, starting CUDA tests ====="
35+
@testset "===== CUDA tests on GPU =====" begin
36+
include("cuda.jl")
37+
end
38+
end
39+
40+
@info @sprintf("KernelAbstractions tests took %.1f seconds", time()-t4)
41+
42+
@tullio cuda=false

0 commit comments

Comments
 (0)