Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buildkite] Add CI builds on GPUs #113

Merged
merged 13 commits into from
Nov 6, 2024
103 changes: 103 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
steps:
- label: "Nvidia GPUs -- CUDA.jl"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
agents:
queue: "juliagpu"
cuda: "*"
env:
EXAMODELS_TEST_CUDA: "TRUE"
command: |
julia --color=yes -e '
using Pkg
Pkg.add("CUDA")
Pkg.add("KernelAbstractions")
Pkg.add("NLPModels")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on how you want to run the tests.
If you just want to use runtests.jl, we can modify it.
But with the current pipeline.yml, we can also run specific and longer tests that target specific GPUs without environment variables.

I did something similar in Krylov.jl, using buildkite to run GPU tests separately from CPU tests, which is recommended to avoid occupying the GPUs for too long, allowing other users and repositories to access them.

Pkg.add("JuMP")
Pkg.add("ForwardDiff")
Pkg.add("NLPModelsIpopt")
Pkg.add("NLPModelsJuMP")
Pkg.add("Percival")
Pkg.add("PowerModels")
Pkg.add("MadNLP")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is ideal. Maybe we can create a separate Project.toml file for testing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best solution is to create one Project.toml for each dependency. We can create a CI build for each extension if we do that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we do, say, Project.toml on /test and have Pkg.add("CUDA.jl") and Pkg.add("KernelAbstractions.jl") before project environment instantiation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we don't need to keep duplicate copies of Project.toml for testing

Copy link
Member Author

@amontoison amontoison Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this approach is good. Can we do it in this way?

Pkg.develop(path=".")
include("test/runtests.jl")'
timeout_in_minutes: 30

- label: "AMD GPUs -- AMDGPU.jl"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
agents:
queue: "juliagpu"
rocm: "*"
rocmgpu: "*"
env:
EXAMODELS_TEST_AMDGPU: "TRUE"
JULIA_NUM_THREADS: 4
JULIA_AMDGPU_CORE_MUST_LOAD: "1"
JULIA_AMDGPU_HIP_MUST_LOAD: "1"
JULIA_AMDGPU_DISABLE_ARTIFACTS: "1"
command: |
julia --color=yes -e '
using Pkg
Pkg.add("AMDGPU")
Pkg.add("KernelAbstractions")
Pkg.add("NLPModels")
Pkg.add("JuMP")
Pkg.add("ForwardDiff")
Pkg.add("NLPModelsIpopt")
Pkg.add("NLPModelsJuMP")
Pkg.add("Percival")
Pkg.add("PowerModels")
Pkg.add("MadNLP")
Pkg.develop(path=".")
include("test/runtests.jl")'
timeout_in_minutes: 30

- label: "Intel GPUs -- oneAPI.jl"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
agents:
queue: "juliagpu"
intel: "*"
env:
EXAMODELS_TEST_ONEAPI: "TRUE"
command: |
julia --color=yes -e '
using Pkg
Pkg.add("oneAPI")
Pkg.add("KernelAbstractions")
Pkg.add("NLPModels")
Pkg.add("JuMP")
Pkg.add("ForwardDiff")
Pkg.add("NLPModelsIpopt")
Pkg.add("NLPModelsJuMP")
Pkg.add("Percival")
Pkg.add("PowerModels")
Pkg.add("MadNLP")
Pkg.develop(path=".")
include("test/runtests.jl")'
timeout_in_minutes: 30

# - label: "Apple M1 GPUs -- Metal.jl"
# plugins:
# - JuliaCI/julia#v1:
# version: "1.10"
# agents:
# queue: "juliaecosystem"
# os: "macos"
# arch: "aarch64"
# env:
# EXAMODELS_TEST_METAL: "TRUE"
# command: |
# julia --color=yes --project -e '
# using Pkg
# Pkg.develop(path=".")
# Pkg.add("Metal")
# Pkg.add("KernelAbstractions")
# Pkg.instantiate()
# include("test/runtests.jl")'
# timeout_in_minutes: 30
42 changes: 21 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ jobs:
version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
test-self-hosted:
env:
EXAMODELS_TEST_CUDA: 1
EXAMODELS_TEST_AMDGPU: 1
EXAMODELS_TEST_ONEAPI: 1
runs-on: self-hosted
strategy:
matrix:
julia-version: ['1']
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
# test-self-hosted:
# env:
# EXAMODELS_TEST_CUDA: 1
# EXAMODELS_TEST_AMDGPU: 1
# EXAMODELS_TEST_ONEAPI: 1
# runs-on: self-hosted
# strategy:
# matrix:
# julia-version: ['1']
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@latest
# with:
# version: ${{ matrix.julia-version }}
# - uses: julia-actions/julia-buildpkg@latest
# - uses: julia-actions/julia-runtest@latest
# - uses: julia-actions/julia-processcoverage@v1
# - uses: codecov/codecov-action@v1
# with:
# file: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}
Loading