diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f82d59b522..65108c92d7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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: diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eeacc5611e..7210e323d3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 }} @@ -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`: - # . - - ubuntu-22.04-arm - # Disable `macOS-13` until - # 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' @@ -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: @@ -170,4 +186,4 @@ jobs: - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v5 with: - files: lcov.info + files: lcov.info \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 411cf443ea..6e313480f1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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")