Skip to content

Commit d18233a

Browse files
committed
CI staging
1 parent c4adf67 commit d18233a

File tree

7 files changed

+302
-197
lines changed

7 files changed

+302
-197
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ForwardDiff and Tracker tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
julia-version: [1.0.5, 1.2.0, 1.3]
16+
julia-arch: [x64, x86]
17+
os: [ubuntu-latest, macOS-latest]
18+
exclude:
19+
- os: macOS-latest
20+
julia-arch: x86
21+
22+
steps:
23+
- uses: actions/[email protected]
24+
- uses: julia-actions/setup-julia@latest
25+
with:
26+
version: ${{ matrix.julia-version }}
27+
- uses: julia-actions/julia-runtest@master
28+
env:
29+
STAGE: ForwardDiff_Tracker

.github/workflows/CI.yml renamed to .github/workflows/Others.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Other tests
22

33
on:
44
push:
@@ -25,3 +25,5 @@ jobs:
2525
with:
2626
version: ${{ matrix.julia-version }}
2727
- uses: julia-actions/julia-runtest@master
28+
env:
29+
STAGE: Others

.github/workflows/Zygote.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Zygote tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
julia-version: [1.0.5, 1.2.0, 1.3]
16+
julia-arch: [x64, x86]
17+
os: [ubuntu-latest, macOS-latest]
18+
exclude:
19+
- os: macOS-latest
20+
julia-arch: x86
21+
22+
steps:
23+
- uses: actions/[email protected]
24+
- uses: julia-actions/setup-julia@latest
25+
with:
26+
version: ${{ matrix.julia-version }}
27+
- uses: julia-actions/julia-runtest@master
28+
env:
29+
STAGE: Zygote

test/distributions.jl

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ matrix_cont_dists = [
456456
#DistSpec(:TuringInverseWishart, (dim, cov_mat), fill(cov_mat, 2)),
457457
]
458458
xmatrix_cont_dists = [
459-
matrix_cont_dists;
460-
461459
# Matrix x
462460
filter(!isnothing, filldist_spec.(uni_cont_dists; n = (2, 2)));
463461
filter(!isnothing, filldist_spec.(multi_cont_dists; disttype = :multi, n = 2));
@@ -469,6 +467,8 @@ xmatrix_cont_dists = [
469467
filter(!isnothing, filldist_spec.(multi_cont_dists; disttype = :multi, n = 2, d = 2));
470468
filter(!isnothing, arraydist_spec.(uni_cont_dists; n = (2, 2), d = 2));
471469
filter(!isnothing, arraydist_spec.(multi_cont_dists; disttype = :multi, n = 2, d = 2));
470+
471+
matrix_cont_dists;
472472
]
473473
broken_matrix_cont_dists = [
474474
# Other
@@ -478,65 +478,67 @@ broken_matrix_cont_dists = [
478478
DistSpec(:MatrixFDist, (dim, dim, cov_mat), cov_mat),
479479
]
480480

481-
test_head(s) = println("\n"*s*"\n")
482-
separator() = println("\n"*"="^50)
483-
484-
separator()
485-
@testset "Univariate discrete distributions" begin
486-
test_head("Testing: Univariate discrete distributions")
487-
for d in uni_disc_dists
488-
test_info(d.name)
489-
for testf in get_all_functions(d, false)
490-
test_ad(testf.f, testf.x)
481+
if get_stage() != "Others"
482+
test_head(s) = println("\n"*s*"\n")
483+
separator() = println("\n"*"="^50)
484+
485+
separator()
486+
@testset "Univariate discrete distributions" begin
487+
test_head("Testing: Univariate discrete distributions")
488+
for d in uni_disc_dists
489+
test_info(d.name)
490+
for testf in get_all_functions(d, false)
491+
test_ad(testf.f, testf.x)
492+
end
491493
end
492494
end
493-
end
494-
separator()
495-
496-
# Note: broadcasting logpdf with univariate distributions having tracked parameters breaks
497-
# Tracker. Ref: https://github.com/FluxML/Tracker.jl/issues/65
498-
# filldist works around this so it is the recommended way for AD-friendly "broadcasting"
499-
# of logpdf with univariate distributions
500-
@testset "Univariate continuous distributions" begin
501-
test_head("Testing: Univariate continuous distributions")
502-
for d in uni_cont_dists
503-
test_info(d.name)
504-
for testf in get_all_functions(d, true)
505-
test_ad(testf.f, testf.x)
495+
separator()
496+
497+
# Note: broadcasting logpdf with univariate distributions having tracked parameters breaks
498+
# Tracker. Ref: https://github.com/FluxML/Tracker.jl/issues/65
499+
# filldist works around this so it is the recommended way for AD-friendly "broadcasting"
500+
# of logpdf with univariate distributions
501+
@testset "Univariate continuous distributions" begin
502+
test_head("Testing: Univariate continuous distributions")
503+
for d in uni_cont_dists
504+
test_info(d.name)
505+
for testf in get_all_functions(d, true)
506+
test_ad(testf.f, testf.x)
507+
end
506508
end
507509
end
508-
end
509-
separator()
510-
511-
@testset "Multivariate discrete distributions" begin
512-
test_head("Testing: Multivariate discrete distributions")
513-
for d in xmulti_disc_dists
514-
test_info(d.name)
515-
for testf in get_all_functions(d, false)
516-
test_ad(testf.f, testf.x)
510+
separator()
511+
512+
@testset "Multivariate discrete distributions" begin
513+
test_head("Testing: Multivariate discrete distributions")
514+
for d in xmulti_disc_dists
515+
test_info(d.name)
516+
for testf in get_all_functions(d, false)
517+
test_ad(testf.f, testf.x)
518+
end
517519
end
518520
end
519-
end
520521

521-
separator()
522-
@testset "Multivariate continuous distributions" begin
523-
test_head("Testing: Multivariate continuous distributions")
524-
for d in xmulti_cont_dists
525-
test_info(d.name)
526-
for testf in get_all_functions(d, true)
527-
test_ad(testf.f, testf.x)
522+
separator()
523+
@testset "Multivariate continuous distributions" begin
524+
test_head("Testing: Multivariate continuous distributions")
525+
for d in xmulti_cont_dists
526+
test_info(d.name)
527+
for testf in get_all_functions(d, true)
528+
test_ad(testf.f, testf.x)
529+
end
528530
end
529531
end
530-
end
531-
separator()
532-
533-
@testset "Matrix-variate continuous distributions" begin
534-
test_head("Testing: Matrix-variate continuous distributions")
535-
for d in xmatrix_cont_dists
536-
test_info(d.name)
537-
for testf in get_all_functions(d, true)
538-
test_ad(testf.f, testf.x)
532+
separator()
533+
534+
@testset "Matrix-variate continuous distributions" begin
535+
test_head("Testing: Matrix-variate continuous distributions")
536+
for d in xmatrix_cont_dists
537+
test_info(d.name)
538+
for testf in get_all_functions(d, true)
539+
test_ad(testf.f, testf.x)
540+
end
539541
end
540542
end
543+
separator()
541544
end
542-
separator()

0 commit comments

Comments
 (0)