Skip to content

Commit 83a2c1d

Browse files
avik-palgiordano
andauthored
ci: run tests if julia file changes (#742)
* ci: run tests if julia file changes * ci: separate out testing with local jll * fix: don't use billy's special clang by default * chore: bump enzymejax commit * ci: cache bazel + run only single mac job * fix: typo in macos check * Update .github/workflows/CI.yml Co-authored-by: Mosè Giordano <[email protected]> * ci: fixes from code review * Update .github/workflows/CI-localjll.yml Co-authored-by: Mosè Giordano <[email protected]> * ci: remove timeout minutes * fix: device_list moved to new file --------- Co-authored-by: Mosè Giordano <[email protected]>
1 parent 0a37253 commit 83a2c1d

File tree

9 files changed

+97
-35
lines changed

9 files changed

+97
-35
lines changed

.github/workflows/CI-localjll.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: CI with local libReactant
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/CI-localjll.yml'
7+
- 'deps/**'
8+
push:
9+
branches:
10+
- main
11+
- release-*
12+
tags: '*'
13+
paths:
14+
- '.github/workflows/CI-localjll.yml'
15+
- 'deps/**'
16+
17+
concurrency:
18+
# Skip intermediate builds: always.
19+
# Cancel intermediate builds: only if it is a pull request build.
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
22+
23+
jobs:
24+
test:
25+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - local libReactant - ${{ github.event_name }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
version:
31+
- '1.10'
32+
- '1.11'
33+
os:
34+
- ubuntu-24.04
35+
- macOS-latest
36+
exclude:
37+
- os: macOS-latest
38+
version: '1.10'
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: julia-actions/setup-julia@v2
42+
with:
43+
version: ${{ matrix.version }}
44+
- uses: julia-actions/cache@v2
45+
- uses: bazel-contrib/[email protected]
46+
name: Set up Bazel
47+
with:
48+
# Avoid downloading Bazel every time.
49+
bazelisk-cache: true
50+
# Store build cache per workflow.
51+
disk-cache: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.version }}
52+
# Share repository cache between workflows.
53+
repository-cache: true
54+
bazelisk-version: 1.x
55+
- name: Prepare build on macOS
56+
if: ${{ startsWith(matrix.os, 'macOS-') }}
57+
run: |
58+
echo "SDKROOT=$(xcrun --show-sdk-path)" >> "${GITHUB_ENV}"
59+
- name: Build libReactant
60+
run: |
61+
python -m pip install numpy
62+
julia --color=yes --project=deps -e 'using Pkg; Pkg.instantiate()'
63+
julia --color=yes --project=deps deps/build_local.jl
64+
cp LocalPreferences.toml test/
65+
- name: "Install Dependencies"
66+
run: |
67+
import Pkg
68+
Pkg.Registry.update()
69+
# Install packages present in subdirectories
70+
dev_pks = Pkg.PackageSpec[]
71+
for path in ("lib/ReactantCore",)
72+
push!(dev_pks, Pkg.PackageSpec(; path))
73+
end
74+
Pkg.develop(dev_pks)
75+
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
76+
# Only in Julia v1.10 we need to install `ReactantCore` manually.
77+
if: ${{ matrix.version == '1.10' }}
78+
env:
79+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
80+
- name: "Run Tests"
81+
run: |
82+
import Pkg
83+
Pkg.Registry.update()
84+
Pkg.test(; coverage="user")
85+
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
86+
id: run_tests
87+
env:
88+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
89+
XLA_FLAGS: "--xla_force_host_platform_device_count=8"
90+
- uses: julia-actions/julia-processcoverage@v1
91+
- uses: codecov/codecov-action@v5
92+
with:
93+
files: lcov.info

.github/workflows/CI.yml

+1-24
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on:
1717
tags: '*'
1818
paths:
1919
- '.github/workflows/CI.yml'
20-
- 'deps/**'
2120
- 'ext/**'
2221
- 'lib/**'
2322
- 'src/**'
@@ -33,7 +32,7 @@ concurrency:
3332
jobs:
3433
test:
3534
timeout-minutes: 90
36-
name: Julia ${{ matrix.version }} - ${{ matrix.test_group }} - ${{ matrix.os }} - ${{ matrix.libReactant }} libReactant - assertions=${{ matrix.assertions }} - ${{ github.event_name }}
35+
name: Julia ${{ matrix.version }} - ${{ matrix.test_group }} - ${{ matrix.os }} - assertions=${{ matrix.assertions }} - ${{ github.event_name }}
3736
runs-on: ${{ matrix.os }}
3837
strategy:
3938
fail-fast: false
@@ -55,20 +54,16 @@ jobs:
5554
- integration
5655
assertions:
5756
- false
58-
libReactant: [packaged]
5957
include:
6058
- os: ubuntu-24.04
61-
libReactant: packaged
6259
version: '1.10'
6360
assertions: true
6461
test_group: core
6562
- os: ubuntu-24.04
66-
libReactant: packaged
6763
version: '1.10'
6864
assertions: true
6965
test_group: neural_networks
7066
- os: ubuntu-24.04
71-
libReactant: packaged
7267
version: '1.10'
7368
assertions: true
7469
test_group: integration
@@ -103,22 +98,6 @@ jobs:
10398
sed -i.bak 's/exit 2/exit 0/g' julia/deps/tools/jlchecksum
10499
make -C julia -j $(nproc) FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1 JULIA_PRECOMPILE=0
105100
echo $PWD/julia/usr/bin >> $GITHUB_PATH
106-
- name: Build libReactant
107-
if: ${{ matrix.libReactant == 'local' && !startsWith(matrix.os, 'macOS-') }}
108-
id: build_libreactant
109-
run: |
110-
python -m pip install numpy
111-
julia --color=yes --project=deps -e 'using Pkg; Pkg.instantiate()'
112-
julia --color=yes --project=deps deps/build_local.jl
113-
cp LocalPreferences.toml test/
114-
- name: Build libReactant MacOS
115-
if: ${{ matrix.libReactant == 'local' && !startsWith(matrix.os, 'macOS-') }}
116-
id: build_libreactant_mac
117-
run: |
118-
python -m pip install numpy
119-
julia --color=yes --project=deps -e 'using Pkg; Pkg.instantiate()'
120-
SDKROOT=`xcrun --show-sdk-path` julia --color=yes --project=deps deps/build_local.jl
121-
cp LocalPreferences.toml test/
122101
- name: "Install Dependencies"
123102
run: |
124103
import Pkg
@@ -146,8 +125,6 @@ jobs:
146125
REACTANT_TEST_GROUP: ${{ matrix.test_group }}
147126
XLA_FLAGS: "--xla_force_host_platform_device_count=8"
148127
- uses: julia-actions/julia-processcoverage@v1
149-
if: steps.run_tests.outcome == 'success'
150128
- uses: codecov/codecov-action@v5
151-
if: steps.run_tests.outcome == 'success'
152129
with:
153130
files: lcov.info

.github/workflows/downgrade.yml

-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ jobs:
6565
REACTANT_TEST_GROUP: ${{ matrix.test_group }}
6666
XLA_FLAGS: "--xla_force_host_platform_device_count=8"
6767
- uses: julia-actions/julia-processcoverage@v1
68-
if: steps.run_tests.outcome == 'success'
6968
- uses: codecov/codecov-action@v5
70-
if: steps.run_tests.outcome == 'success'
7169
with:
7270
files: lcov.info

deps/ReactantExtra/API.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#include "xla/python/ifrt/compiler.h"
8181
#include "xla/python/ifrt/device.h"
8282
#include "xla/python/ifrt/device_list.h"
83+
#include "xla/python/ifrt/basic_device_list.h"
8384
#include "xla/python/ifrt/dtype.h"
8485
#include "xla/python/ifrt/executable.h"
8586
#include "xla/python/ifrt/hlo/hlo_program.h"

deps/ReactantExtra/WORKSPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ http_archive(
99
urls = ["https://github.com/wsmoses/nsync/archive/{commit}.tar.gz".format(commit = NSYNC_COMMIT)],
1010
)
1111

12-
ENZYMEXLA_COMMIT = "b1290ed840695ef888819c15415a23f6567dbeb6"
12+
ENZYMEXLA_COMMIT = "a7d380a96fafdf3e26e9526d348df00ef3e99fb5"
1313
ENZYMEXLA_SHA256 = ""
1414

1515
http_archive(

deps/build_local.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ s = ArgParseSettings()
2121
default = "/usr/bin/gcc"
2222
arg_type = String
2323
"--cc"
24-
default = "/home/wmoses/llvms/llvm16-r/clang+llvm-16.0.2-x86_64-linux-gnu-ubuntu-22.04/bin/clang"
24+
default = "/usr/bin/cc"
2525
arg_type = String
2626
"--hermetic_python_version"
2727
help = "Hermetic Python version."

deps/clang

-2
This file was deleted.

deps/clang++

-2
This file was deleted.

deps/gcc

-3
This file was deleted.

0 commit comments

Comments
 (0)