Skip to content

Commit

Permalink
Merge pull request #106 from SciML/gpu
Browse files Browse the repository at this point in the history
Test GPU
  • Loading branch information
ChrisRackauckas authored Dec 4, 2022
2 parents fb7e767 + 621c54a commit b1d39dd
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- label: "Julia 1"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1:
coverage: false # 1000x slowdown
agents:
queue: "juliagpu"
cuda: "*"
timeout_in_minutes: 30
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/

env:
GROUP: GPU
JULIA_PKG_SERVER: "" # it often struggles with our large artifacts
# SECRET_CODECOV_TOKEN: "..."
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[![codecov](https://codecov.io/gh/SciML/NonlinearSolve.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/NonlinearSolve.jl)
[![Build Status](https://github.com/SciML/NonlinearSolve.jl/workflows/CI/badge.svg)](https://github.com/SciML/NonlinearSolve.jl/actions?query=workflow%3ACI)
[![Build status](https://badge.buildkite.com/413dc8df7d555cc14c262aba066503a9e7a42023f9cfb75a55.svg)](https://buildkite.com/julialang/nonlinearsolve-dot-jl)

[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
Expand Down Expand Up @@ -45,7 +46,7 @@ you can now use SimpleNonlinearSolve.jl. `Falsi`, `Bisection`, and `NewtonRahpso
implementations designed for scalar and static vector inputs have all moved to the
lower dependency version. NonlinearSolve.jl is thus designed for the larger scale
more complex implementations, with `NewtonRahpson` now sporting support for
LinearSolve.jl and soon SparseDiffTools.jl to allow for preconditioned Newton-Krylov and
LinearSolve.jl and soon SparseDiffTools.jl to allow for preconditioned Newton-Krylov and
exploitation of sparsity. The two pieces will continue to grow in this direction,
with NonlinearSolve.jl gaining more and more wrapped solver libraries and support
for more complex methods, while SimpleNonlinearSolve.jl will keep a lower dependency
Expand Down
7 changes: 7 additions & 0 deletions test/GPU/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"

[compat]
CUDA = "3.12"
NonlinearSolve = "1"
12 changes: 12 additions & 0 deletions test/gpu.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using CUDA, NonlinearSolve

A = cu(rand(4, 4))
u0 = cu(rand(4))
b = cu(rand(4))

function f(du, u, p)
du .= A * u .+ b
end

prob = NonlinearProblem(f, u0)
sol = solve(prob, NewtonRaphson())
19 changes: 15 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,20 @@ const LONGER_TESTS = false
const GROUP = get(ENV, "GROUP", "All")
const is_APPVEYOR = Sys.iswindows() && haskey(ENV, "APPVEYOR")

function activate_downstream_env()
Pkg.activate("GPU")
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
Pkg.instantiate()
end

@time begin
if GROUP == "All" || GROUP == "Core"
@time @safetestset "Basic Tests + Some AD" begin include("basictests.jl") end
@time @safetestset "Sparsity Tests" begin include("sparse.jl") end
end

if GROUP == "All" || GROUP == "Core"
@time @safetestset "Basic Tests + Some AD" begin include("basictests.jl") end
@time @safetestset "Sparsity Tests" begin include("sparse.jl") end
end end
if GROUP == "GPU"
activate_downstream_env()
@time @safetestset "GPU Tests" begin include("gpu.jl") end
end
end

0 comments on commit b1d39dd

Please sign in to comment.