From 5daf63ac6474fb2a4f6d007efb729f6c6149fb3c Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:37:18 +0100 Subject: [PATCH 1/6] test: set up buildkite for GPU testing --- .buildkite/pipeline.yml | 12 ++++++++++++ .../CompatHelper.yml | 0 .../Documentation.yml | 0 .../Register.yml | 0 .../{workflows => workflows_deactivated}/TagBot.yml | 0 .../{workflows => workflows_deactivated}/Test.yml | 0 DifferentiationInterface/test/GPU/CUDA/simple.jl | 5 +++++ 7 files changed, 17 insertions(+) create mode 100644 .buildkite/pipeline.yml rename .github/{workflows => workflows_deactivated}/CompatHelper.yml (100%) rename .github/{workflows => workflows_deactivated}/Documentation.yml (100%) rename .github/{workflows => workflows_deactivated}/Register.yml (100%) rename .github/{workflows => workflows_deactivated}/TagBot.yml (100%) rename .github/{workflows => workflows_deactivated}/Test.yml (100%) create mode 100644 DifferentiationInterface/test/GPU/CUDA/simple.jl diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 000000000..eea595a73 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,12 @@ +steps: + - label: "DI GPU tests" + plugins: + - JuliaCI/julia#v1: + version: "1" + command: | + julia ./DifferentiationInterface/test/GPU/CUDA/simple.jl + agents: + queue: "juliagpu" + cuda: "*" + if: build.message !~ /\[skip tests\]/ + timeout_in_minutes: 60 \ No newline at end of file diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows_deactivated/CompatHelper.yml similarity index 100% rename from .github/workflows/CompatHelper.yml rename to .github/workflows_deactivated/CompatHelper.yml diff --git a/.github/workflows/Documentation.yml b/.github/workflows_deactivated/Documentation.yml similarity index 100% rename from .github/workflows/Documentation.yml rename to .github/workflows_deactivated/Documentation.yml diff --git a/.github/workflows/Register.yml b/.github/workflows_deactivated/Register.yml similarity index 100% rename from .github/workflows/Register.yml rename to .github/workflows_deactivated/Register.yml diff --git a/.github/workflows/TagBot.yml b/.github/workflows_deactivated/TagBot.yml similarity index 100% rename from .github/workflows/TagBot.yml rename to .github/workflows_deactivated/TagBot.yml diff --git a/.github/workflows/Test.yml b/.github/workflows_deactivated/Test.yml similarity index 100% rename from .github/workflows/Test.yml rename to .github/workflows_deactivated/Test.yml diff --git a/DifferentiationInterface/test/GPU/CUDA/simple.jl b/DifferentiationInterface/test/GPU/CUDA/simple.jl new file mode 100644 index 000000000..11870c127 --- /dev/null +++ b/DifferentiationInterface/test/GPU/CUDA/simple.jl @@ -0,0 +1,5 @@ +@info "Trying out CUDA" +using Pkg +Pkg.add("CUDA") +using CUDA +CUDA.versioninfo() From 55bd526685463549c0e379d7616830c5739a40b7 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:36:26 +0100 Subject: [PATCH 2/6] Don't run buildkite on drafts --- .buildkite/pipeline.yml | 4 +- .../CompatHelper.yml | 0 .../Documentation.yml | 0 .../Register.yml | 0 .../TagBot.yml | 0 .../Test.yml | 0 .../src/tests/correctness_eval.jl | 88 +++++++++++-------- 7 files changed, 55 insertions(+), 37 deletions(-) rename .github/{workflows_deactivated => workflows}/CompatHelper.yml (100%) rename .github/{workflows_deactivated => workflows}/Documentation.yml (100%) rename .github/{workflows_deactivated => workflows}/Register.yml (100%) rename .github/{workflows_deactivated => workflows}/TagBot.yml (100%) rename .github/{workflows_deactivated => workflows}/Test.yml (100%) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index eea595a73..fb621257d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,5 +1,8 @@ steps: - label: "DI GPU tests" + if: | + !build.pull_request.draft && + build.message !~ /skip tests/ plugins: - JuliaCI/julia#v1: version: "1" @@ -8,5 +11,4 @@ steps: agents: queue: "juliagpu" cuda: "*" - if: build.message !~ /\[skip tests\]/ timeout_in_minutes: 60 \ No newline at end of file diff --git a/.github/workflows_deactivated/CompatHelper.yml b/.github/workflows/CompatHelper.yml similarity index 100% rename from .github/workflows_deactivated/CompatHelper.yml rename to .github/workflows/CompatHelper.yml diff --git a/.github/workflows_deactivated/Documentation.yml b/.github/workflows/Documentation.yml similarity index 100% rename from .github/workflows_deactivated/Documentation.yml rename to .github/workflows/Documentation.yml diff --git a/.github/workflows_deactivated/Register.yml b/.github/workflows/Register.yml similarity index 100% rename from .github/workflows_deactivated/Register.yml rename to .github/workflows/Register.yml diff --git a/.github/workflows_deactivated/TagBot.yml b/.github/workflows/TagBot.yml similarity index 100% rename from .github/workflows_deactivated/TagBot.yml rename to .github/workflows/TagBot.yml diff --git a/.github/workflows_deactivated/Test.yml b/.github/workflows/Test.yml similarity index 100% rename from .github/workflows_deactivated/Test.yml rename to .github/workflows/Test.yml diff --git a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl index da91c0e6c..34b67b4c3 100644 --- a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl +++ b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl @@ -452,10 +452,12 @@ for op in ALL_OPS @test isempty(preptup_noval) || only(preptup_noval) isa $P @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - @test all(res1_out1_val .≈ scen.res1) - @test all(res1_out2_val .≈ scen.res1) - @test all(res1_out1_noval .≈ scen.res1) - @test all(res1_out2_noval .≈ scen.res1) + for b in eachindex(scen.res1) + @test res1_out1_val[b] ≈ scen.res1[b] + @test res1_out2_val[b] ≈ scen.res1[b] + @test res1_out1_noval[b] ≈ scen.res1[b] + @test res1_out2_noval[b] ≈ scen.res1[b] + end end end scenario_intact && @test new_scen == scen @@ -509,14 +511,16 @@ for op in ALL_OPS @test isempty(preptup_noval) || only(preptup_noval) isa $P @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - @test all(res1_in1_val .≈ scen.res1) - @test all(res1_in2_val .≈ scen.res1) - @test all(res1_out1_val .≈ scen.res1) - @test all(res1_out2_val .≈ scen.res1) - @test all(res1_in1_noval .≈ scen.res1) - @test all(res1_in2_noval .≈ scen.res1) - @test all(res1_out1_noval .≈ scen.res1) - @test all(res1_out2_noval .≈ scen.res1) + for b in eachindex(scen.res1) + @test res1_in1_val[b] ≈ scen.res1[b] + @test res1_in2_val[b] ≈ scen.res1[b] + @test res1_out1_val[b] ≈ scen.res1[b] + @test res1_out2_val[b] ≈ scen.res1[b] + @test res1_in1_noval[b] ≈ scen.res1[b] + @test res1_in2_noval[b] ≈ scen.res1[b] + @test res1_out1_noval[b] ≈ scen.res1[b] + @test res1_out2_noval[b] ≈ scen.res1[b] + end end end scenario_intact && @test new_scen == scen @@ -573,10 +577,12 @@ for op in ALL_OPS @test y_in2_val ≈ scen.y @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - @test all(res1_out1_val .≈ scen.res1) - @test all(res1_out2_val .≈ scen.res1) - @test all(res1_out1_noval .≈ scen.res1) - @test all(res1_out2_noval .≈ scen.res1) + for b in eachindex(scen.res1) + @test res1_out1_val[b] ≈ scen.res1[b] + @test res1_out2_val[b] ≈ scen.res1[b] + @test res1_out1_noval[b] ≈ scen.res1[b] + @test res1_out2_noval[b] ≈ scen.res1[b] + end end end scenario_intact && @test new_scen == scen @@ -647,14 +653,16 @@ for op in ALL_OPS @test y_in2_val ≈ scen.y @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - @test all(res1_in1_val .≈ scen.res1) - @test all(res1_in2_val .≈ scen.res1) - @test all(res1_out1_val .≈ scen.res1) - @test all(res1_out2_val .≈ scen.res1) - @test all(res1_in1_noval .≈ scen.res1) - @test all(res1_in2_noval .≈ scen.res1) - @test all(res1_out1_noval .≈ scen.res1) - @test all(res1_out2_noval .≈ scen.res1) + for b in eachindex(scen.res1) + @test res1_in1_val[b] ≈ scen.res1[b] + @test res1_in2_val[b] ≈ scen.res1[b] + @test res1_out1_val[b] ≈ scen.res1[b] + @test res1_out2_val[b] ≈ scen.res1[b] + @test res1_in1_noval[b] ≈ scen.res1[b] + @test res1_in2_noval[b] ≈ scen.res1[b] + @test res1_out1_noval[b] ≈ scen.res1[b] + @test res1_out2_noval[b] ≈ scen.res1[b] + end end end scenario_intact && @test new_scen == scen @@ -699,12 +707,16 @@ for op in ALL_OPS ) let (≈)(x, y) = isapprox(x, y; atol, rtol) @test isempty(preptup_noval) || only(preptup_noval) isa $P - @test all(res2_out1_noval .≈ scen.res2) - @test all(res2_out2_noval .≈ scen.res2) @test res1_out1_val ≈ scen.res1 @test res1_out2_val ≈ scen.res1 - @test all(res2_out1_val .≈ scen.res2) - @test all(res2_out2_val .≈ scen.res2) + @testset "HVP" begin + for b in eachindex(scen.res2) + @test res2_out1_noval[b] ≈ scen.res2[b] + @test res2_out2_noval[b] ≈ scen.res2[b] + @test res2_out1_val[b] ≈ scen.res2[b] + @test res2_out2_val[b] ≈ scen.res2[b] + end + end end end scenario_intact && @test new_scen == scen @@ -770,18 +782,22 @@ for op in ALL_OPS ) let (≈)(x, y) = isapprox(x, y; atol, rtol) @test isempty(preptup_noval) || only(preptup_noval) isa $P - @test all(res2_in1_noval .≈ scen.res2) - @test all(res2_in2_noval .≈ scen.res2) - @test all(res2_out1_noval .≈ scen.res2) - @test all(res2_out2_noval .≈ scen.res2) @test res1_in1_val ≈ scen.res1 @test res1_in2_val ≈ scen.res1 @test res1_out1_val ≈ scen.res1 @test res1_out2_val ≈ scen.res1 - @test all(res2_in1_val .≈ scen.res2) - @test all(res2_in2_val .≈ scen.res2) - @test all(res2_out1_val .≈ scen.res2) - @test all(res2_out2_val .≈ scen.res2) + @testset "HVP" begin + for b in eachindex(scen.res2) + @test res2_in1_noval[b] ≈ scen.res2[b] + @test res2_in2_noval[b] ≈ scen.res2[b] + @test res2_out1_noval[b] ≈ scen.res2[b] + @test res2_out2_noval[b] ≈ scen.res2[b] + @test res2_in1_val[b] ≈ scen.res2[b] + @test res2_in2_val[b] ≈ scen.res2[b] + @test res2_out1_val[b] ≈ scen.res2[b] + @test res2_out2_val[b] ≈ scen.res2[b] + end + end end end scenario_intact && @test new_scen == scen From 6161e562cb18319213975a254191dbf547401264 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:38:42 +0100 Subject: [PATCH 3/6] Remove diff --- .../src/tests/correctness_eval.jl | 88 ++++++++----------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl index 34b67b4c3..da91c0e6c 100644 --- a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl +++ b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl @@ -452,12 +452,10 @@ for op in ALL_OPS @test isempty(preptup_noval) || only(preptup_noval) isa $P @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - for b in eachindex(scen.res1) - @test res1_out1_val[b] ≈ scen.res1[b] - @test res1_out2_val[b] ≈ scen.res1[b] - @test res1_out1_noval[b] ≈ scen.res1[b] - @test res1_out2_noval[b] ≈ scen.res1[b] - end + @test all(res1_out1_val .≈ scen.res1) + @test all(res1_out2_val .≈ scen.res1) + @test all(res1_out1_noval .≈ scen.res1) + @test all(res1_out2_noval .≈ scen.res1) end end scenario_intact && @test new_scen == scen @@ -511,16 +509,14 @@ for op in ALL_OPS @test isempty(preptup_noval) || only(preptup_noval) isa $P @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - for b in eachindex(scen.res1) - @test res1_in1_val[b] ≈ scen.res1[b] - @test res1_in2_val[b] ≈ scen.res1[b] - @test res1_out1_val[b] ≈ scen.res1[b] - @test res1_out2_val[b] ≈ scen.res1[b] - @test res1_in1_noval[b] ≈ scen.res1[b] - @test res1_in2_noval[b] ≈ scen.res1[b] - @test res1_out1_noval[b] ≈ scen.res1[b] - @test res1_out2_noval[b] ≈ scen.res1[b] - end + @test all(res1_in1_val .≈ scen.res1) + @test all(res1_in2_val .≈ scen.res1) + @test all(res1_out1_val .≈ scen.res1) + @test all(res1_out2_val .≈ scen.res1) + @test all(res1_in1_noval .≈ scen.res1) + @test all(res1_in2_noval .≈ scen.res1) + @test all(res1_out1_noval .≈ scen.res1) + @test all(res1_out2_noval .≈ scen.res1) end end scenario_intact && @test new_scen == scen @@ -577,12 +573,10 @@ for op in ALL_OPS @test y_in2_val ≈ scen.y @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - for b in eachindex(scen.res1) - @test res1_out1_val[b] ≈ scen.res1[b] - @test res1_out2_val[b] ≈ scen.res1[b] - @test res1_out1_noval[b] ≈ scen.res1[b] - @test res1_out2_noval[b] ≈ scen.res1[b] - end + @test all(res1_out1_val .≈ scen.res1) + @test all(res1_out2_val .≈ scen.res1) + @test all(res1_out1_noval .≈ scen.res1) + @test all(res1_out2_noval .≈ scen.res1) end end scenario_intact && @test new_scen == scen @@ -653,16 +647,14 @@ for op in ALL_OPS @test y_in2_val ≈ scen.y @test y_out1_val ≈ scen.y @test y_out2_val ≈ scen.y - for b in eachindex(scen.res1) - @test res1_in1_val[b] ≈ scen.res1[b] - @test res1_in2_val[b] ≈ scen.res1[b] - @test res1_out1_val[b] ≈ scen.res1[b] - @test res1_out2_val[b] ≈ scen.res1[b] - @test res1_in1_noval[b] ≈ scen.res1[b] - @test res1_in2_noval[b] ≈ scen.res1[b] - @test res1_out1_noval[b] ≈ scen.res1[b] - @test res1_out2_noval[b] ≈ scen.res1[b] - end + @test all(res1_in1_val .≈ scen.res1) + @test all(res1_in2_val .≈ scen.res1) + @test all(res1_out1_val .≈ scen.res1) + @test all(res1_out2_val .≈ scen.res1) + @test all(res1_in1_noval .≈ scen.res1) + @test all(res1_in2_noval .≈ scen.res1) + @test all(res1_out1_noval .≈ scen.res1) + @test all(res1_out2_noval .≈ scen.res1) end end scenario_intact && @test new_scen == scen @@ -707,16 +699,12 @@ for op in ALL_OPS ) let (≈)(x, y) = isapprox(x, y; atol, rtol) @test isempty(preptup_noval) || only(preptup_noval) isa $P + @test all(res2_out1_noval .≈ scen.res2) + @test all(res2_out2_noval .≈ scen.res2) @test res1_out1_val ≈ scen.res1 @test res1_out2_val ≈ scen.res1 - @testset "HVP" begin - for b in eachindex(scen.res2) - @test res2_out1_noval[b] ≈ scen.res2[b] - @test res2_out2_noval[b] ≈ scen.res2[b] - @test res2_out1_val[b] ≈ scen.res2[b] - @test res2_out2_val[b] ≈ scen.res2[b] - end - end + @test all(res2_out1_val .≈ scen.res2) + @test all(res2_out2_val .≈ scen.res2) end end scenario_intact && @test new_scen == scen @@ -782,22 +770,18 @@ for op in ALL_OPS ) let (≈)(x, y) = isapprox(x, y; atol, rtol) @test isempty(preptup_noval) || only(preptup_noval) isa $P + @test all(res2_in1_noval .≈ scen.res2) + @test all(res2_in2_noval .≈ scen.res2) + @test all(res2_out1_noval .≈ scen.res2) + @test all(res2_out2_noval .≈ scen.res2) @test res1_in1_val ≈ scen.res1 @test res1_in2_val ≈ scen.res1 @test res1_out1_val ≈ scen.res1 @test res1_out2_val ≈ scen.res1 - @testset "HVP" begin - for b in eachindex(scen.res2) - @test res2_in1_noval[b] ≈ scen.res2[b] - @test res2_in2_noval[b] ≈ scen.res2[b] - @test res2_out1_noval[b] ≈ scen.res2[b] - @test res2_out2_noval[b] ≈ scen.res2[b] - @test res2_in1_val[b] ≈ scen.res2[b] - @test res2_in2_val[b] ≈ scen.res2[b] - @test res2_out1_val[b] ≈ scen.res2[b] - @test res2_out2_val[b] ≈ scen.res2[b] - end - end + @test all(res2_in1_val .≈ scen.res2) + @test all(res2_in2_val .≈ scen.res2) + @test all(res2_out1_val .≈ scen.res2) + @test all(res2_out2_val .≈ scen.res2) end end scenario_intact && @test new_scen == scen From a31d75cb27a2b3a897c26a6089918820b484a757 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:40:25 +0100 Subject: [PATCH 4/6] Trigger CI --- DifferentiationInterface/test/GPU/CUDA/simple.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DifferentiationInterface/test/GPU/CUDA/simple.jl b/DifferentiationInterface/test/GPU/CUDA/simple.jl index 11870c127..e5c7ce4fa 100644 --- a/DifferentiationInterface/test/GPU/CUDA/simple.jl +++ b/DifferentiationInterface/test/GPU/CUDA/simple.jl @@ -1,4 +1,4 @@ -@info "Trying out CUDA" +@info "Testing CUDA" using Pkg Pkg.add("CUDA") using CUDA From 987d6a3b3122cf88b431b89ef50ba8c83d130b90 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:44:07 +0100 Subject: [PATCH 5/6] Condition on "gpu" label --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index fb621257d..68aa085ee 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ steps: - label: "DI GPU tests" if: | !build.pull_request.draft && - build.message !~ /skip tests/ + build.pull_request.labels includes "gpu" plugins: - JuliaCI/julia#v1: version: "1" From d66936bce227660e4420fb52e1b096fa2b4dfbc2 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:45:13 +0100 Subject: [PATCH 6/6] Trigger CI --- DifferentiationInterface/test/GPU/CUDA/simple.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DifferentiationInterface/test/GPU/CUDA/simple.jl b/DifferentiationInterface/test/GPU/CUDA/simple.jl index e5c7ce4fa..efc38541f 100644 --- a/DifferentiationInterface/test/GPU/CUDA/simple.jl +++ b/DifferentiationInterface/test/GPU/CUDA/simple.jl @@ -1,4 +1,4 @@ -@info "Testing CUDA" +@info "Testing on CUDA" using Pkg Pkg.add("CUDA") using CUDA