Skip to content

CI Try caching precompilation #1530

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
steps:
- group: ":test_tube: Tests"
steps:
- label: ":julia: :linux: CUDA Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
matrix:
setup:
version:
- "1.10"
group:
- core
- neural_networks
- integration
runtime:
- "PJRT"
- "IFRT"
plugins:
- JuliaCI/julia#v1:
version: "{{matrix.version}}"
- JuliaCI/julia-coverage#v1:
codecov: true
dirs:
- src
- ext
- lib/ReactantCore/src
commands: |
touch LocalPreferences.toml
# steps:
# - group: ":test_tube: Tests"
# steps:
# - label: ":julia: :linux: CUDA Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
# matrix:
# setup:
# version:
# - "1.10"
# group:
# - core
# - neural_networks
# - integration
# runtime:
# - "PJRT"
# - "IFRT"
# plugins:
# - JuliaCI/julia#v1:
# version: "{{matrix.version}}"
# - JuliaCI/julia-coverage#v1:
# codecov: true
# dirs:
# - src
# - ext
# - lib/ReactantCore/src
# commands: |
# touch LocalPreferences.toml

echo "[Reactant]" >> LocalPreferences.toml
echo "xla_runtime = \"{{matrix.runtime}}\"" >> LocalPreferences.toml
# echo "[Reactant]" >> LocalPreferences.toml
# echo "xla_runtime = \"{{matrix.runtime}}\"" >> LocalPreferences.toml

cat LocalPreferences.toml
# cat LocalPreferences.toml

julia --project=. -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([PackageSpec(path="lib/ReactantCore")])'
# julia --project=. -e 'println("--- :julia: Instantiating project")
# using Pkg
# Pkg.develop([PackageSpec(path="lib/ReactantCore")])'

julia --project=. -e 'println("--- :julia: Run Tests")
using Pkg
Pkg.test(; coverage="user")'
agents:
queue: "juliagpu"
cuda: "*"
env:
REACTANT_TEST_GROUP: "{{matrix.group}}"
JULIA_DEBUG: "Reactant,Reactant_jll"
CUDA_VISIBLE_DEVICES: 0
REACTANT_BACKEND_GROUP: "GPU"
if: build.message !~ /\[skip tests\]/
timeout_in_minutes: 120
# julia --project=. -e 'println("--- :julia: Run Tests")
# using Pkg
# Pkg.test(; coverage="user")'
# agents:
# queue: "juliagpu"
# cuda: "*"
# env:
# REACTANT_TEST_GROUP: "{{matrix.group}}"
# JULIA_DEBUG: "Reactant,Reactant_jll"
# CUDA_VISIBLE_DEVICES: 0
# REACTANT_BACKEND_GROUP: "GPU"
# if: build.message !~ /\[skip tests\]/
# timeout_in_minutes: 120

# - group: ":racehorse: Benchmarks"
# steps:
Expand Down
72 changes: 44 additions & 28 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,46 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
cache-warmup:
runs-on: ubuntu-24.04
strategy:
matrix:
version: ["1.10"]
os: [ubuntu-24.04]
runtime: ["PJRT"]
assertions: [false]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
with:
cache-name: julia-cache;workflow=${{ github.workflow }};version=${{ matrix.version }};os=${{ matrix.os }};runtime=${{ matrix.runtime }};assertions=${{ matrix.assertions }}
include-matrix: false
- name: "Run Tests to warm cache"
run: |
import Pkg
Pkg.Registry.update()
Pkg.test(allow_reresolve=false)
shell: julia --color=yes --depwarn=yes --project=. {0}
env:
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
ENABLE_PJRT_COMPATIBILITY: 1
REACTANT_TEST_GROUP: "none"
XLA_FLAGS: "--xla_force_host_platform_device_count=12"
JULIA_DEBUG: "Reactant,Reactant_jll"

- name: Warm cache
run: |
import Pkg
Pkg.Registry.update()
Pkg.instantiate()
Pkg.resolve()
Pkg.precompile()
shell: julia --project=. {0}
test:
needs: cache-warmup
timeout-minutes: 90
name: Julia ${{ matrix.version }} - ${{ matrix.test_group }} - ${{ matrix.os }} - ${{ matrix.runtime }} - assertions=${{ matrix.assertions }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
Expand All @@ -40,47 +79,21 @@ jobs:
matrix:
version:
- "1.10"
- "1.11"
# - 'nightly'
os:
- ubuntu-24.04
# `ubuntu-22.04-arm` is considered more stable than `ubuntu-24.04-arm`:
# <https://github.com/orgs/community/discussions/148648#discussioncomment-12099554>.
- ubuntu-22.04-arm
# Disable `macOS-13` until
# <https://github.com/EnzymeAD/Reactant.jl/issues/867> is resolved.
# - macOS-13
- macOS-latest
test_group:
- core
- neural_networks
- integration
runtime:
- "PJRT"
- "IFRT"
assertions:
- false
include:
- os: linux-x86-ct6e-180-4tpu
version: "1.11"
assertions: false
test_group: core
runtime: "IFRT"
# Keep just one include for testing
- os: ubuntu-24.04
version: "1.10"
assertions: true
test_group: core
runtime: "PJRT"
- os: ubuntu-24.04
version: "1.10"
assertions: true
test_group: neural_networks
runtime: "PJRT"
- os: ubuntu-24.04
version: "1.10"
assertions: true
test_group: integration
runtime: "PJRT"
# - os: ubuntu-24.04
# libReactant: packaged
# version: '1.10'
Expand Down Expand Up @@ -109,6 +122,9 @@ jobs:
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
with:
cache-name: julia-cache;workflow=${{ github.workflow }};version=${{ matrix.version }};os=${{ matrix.os }};runtime=${{ matrix.runtime }};assertions=${{ matrix.assertions }}
include-matrix: false
- uses: actions/checkout@v4
if: ${{ matrix.assertions }}
with:
Expand Down Expand Up @@ -170,4 +186,4 @@ jobs:
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info
files: lcov.info
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ end

const REACTANT_TEST_GROUP = lowercase(get(ENV, "REACTANT_TEST_GROUP", "all"))

# this is for the CI to precompile everything before running tests
if REACTANT_TEST_GROUP == "none"
println("Skipping all tests as REACTANT_TEST_GROUP is set to 'none'")
exit(0)
end

@testset "Reactant.jl Tests" begin
if REACTANT_TEST_GROUP == "all" || REACTANT_TEST_GROUP == "core"
if Sys.isapple() && haskey(Reactant.XLA.global_backend_state.clients, "metal")
Expand Down
Loading