From 200f31d5dfe37c7699dcbee539587b920562e12d Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Wed, 31 Jul 2019 22:48:51 -0400 Subject: [PATCH 1/2] GPU color autodiff --- .gitlab-ci.yml | 61 ++++++++++++++++++++++ Project.toml | 3 +- src/SparseDiffTools.jl | 1 + src/differentiation/compute_jacobian_ad.jl | 12 +++-- test/test_gpu_ad.jl | 18 +++++++ 5 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 test/test_gpu_ad.jl diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..677a4a2f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,61 @@ +image: "julia:1" + +variables: + JULIA_DEPOT_PATH: "$CI_PROJECT_DIR/.julia/" + JULIA_NUM_THREADS: '8' + +cache: + paths: + - .julia/ + +build: + stage: build + tags: + - 'p6000' + script: + - curl https://julialang-s3.julialang.org/bin/linux/x64/1.1/julia-1.1.1-linux-x86_64.tar.gz -o julia.tar.gz + - unp julia.tar.gz + - export PATH="$(pwd)/julia-1.1.1/bin:$PATH" + - julia -e "using InteractiveUtils; + versioninfo()" + - julia --project -e "using Pkg; + Pkg.update(); + Pkg.instantiate(); + Pkg.add(\"SparseDiffTools\"); + pkg\"precompile\"; + using SparseDiffTools;" + only: + - master + - tags + - external + - pushes + artifacts: + untracked: true + paths: + - .julia/**/* + - julia-1.1.1/**/* + +test-GPU: + stage: test + tags: + - 'p6000' + dependencies: + - build + variables: + GROUP: "GPU" + script: + - export PATH="$(pwd)/julia-1.1.1/bin:$PATH" + - julia -e "using InteractiveUtils; + versioninfo()" + - julia --project -e "using Pkg; Pkg.add(\"CuArrays\"); + Pkg.test(\"SparseDiffTools\"; coverage=true);" + only: + - master + - tags + - external + - pushes + artifacts: + untracked: true + paths: + - .julia/**/* + - julia-1.1.1/**/* diff --git a/Project.toml b/Project.toml index bebbbe47..6b0a833a 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,8 @@ authors = ["Pankaj Mishra ", "Chris Rackauckas Date: Wed, 31 Jul 2019 22:53:42 -0400 Subject: [PATCH 2/2] gpu CI --- test/runtests.jl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index ee0a95c1..df43cf34 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,20 @@ using SafeTestsets -@time @safetestset "Exact coloring via contraction" begin include("test_contraction.jl") end -@time @safetestset "Greedy distance-1 coloring" begin include("test_greedy_d1.jl") end -@time @safetestset "Greedy star coloring" begin include("test_greedy_star.jl") end -@time @safetestset "Matrix to graph conversion" begin include("test_matrix2graph.jl") end -@time @safetestset "AD using color vector" begin include("test_ad.jl") end -@time @safetestset "Integration test" begin include("test_integration.jl") end -@time @safetestset "Special matrices" begin include("test_specialmatrices.jl") end -@time @safetestset "Jac Vecs and Hes Vecs" begin include("test_jaches_products.jl") end +const GROUP = get(ENV, "GROUP", "All") +const is_APPVEYOR = ( Sys.iswindows() && haskey(ENV,"APPVEYOR") ) +const is_TRAVIS = haskey(ENV,"TRAVIS") + +if GROUP == "All" + @time @safetestset "Exact coloring via contraction" begin include("test_contraction.jl") end + @time @safetestset "Greedy distance-1 coloring" begin include("test_greedy_d1.jl") end + @time @safetestset "Greedy star coloring" begin include("test_greedy_star.jl") end + @time @safetestset "Matrix to graph conversion" begin include("test_matrix2graph.jl") end + @time @safetestset "AD using color vector" begin include("test_ad.jl") end + @time @safetestset "Integration test" begin include("test_integration.jl") end + @time @safetestset "Special matrices" begin include("test_specialmatrices.jl") end + @time @safetestset "Jac Vecs and Hes Vecs" begin include("test_jaches_products.jl") end +end + +if GROUP == "GPU" + @time @safetestset "GPU AD" begin include("test_gpu_ad.jl") end +end