-
Notifications
You must be signed in to change notification settings - Fork 4
282 lines (276 loc) · 9.45 KB
/
checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
on:
pull_request:
branches: master
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install shellcheck
- name: Run shellcheck
shell: bash
run: |
shopt -s extglob nullglob globstar
shellcheck **/*.sh
pjrt-linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build PJRT + XLA binary
run: |
if [ ! "$(git diff --exit-code HEAD^ spidr/backend/VERSION)" ]; then
curl -LO --fail-with-body "https://github.com/joelberkeley/spidr/releases/download/c-xla-v$(cat spidr/backend/VERSION)/libc_xla-linux-x86_64.so"
else
# free up space not used if running in Docker, see
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
rm -rf /opt/hostedtoolcache
docker run \
-v $(pwd):/spidr -w /spidr \
tensorflow/build:latest-python3.9 \
sh -c "spidr/backend/build.sh"
fi
mv libc_xla-linux-x86_64.so libc_xla.so
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: libc_xla-linux-x86_64
path: libc_xla.so
if-no-files-found: error
pjrt-darwin-aarch64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build PJRT + XLA binary
run: |
if [ ! "$(git diff --exit-code HEAD^ spidr/backend/VERSION)" ]; then
curl -LO --fail-with-body "https://github.com/joelberkeley/spidr/releases/download/c-xla-v$(cat spidr/backend/VERSION)/libc_xla-darwin-aarch64.dylib"
else
./spidr/backend/build.sh
fi
mv libc_xla-darwin-aarch64.dylib libc_xla.dylib
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: libc_xla-darwin-aarch64
path: libc_xla.dylib
if-no-files-found: error
pjrt-plugin-xla-cpu-linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build or fetch XLA CPU PJRT plugin
run: |
if [ ! "$(git diff --exit-code HEAD^ XLA_VERSION)" ]; then
. ./dev.sh
rev=$(cat XLA_VERSION)
curl -LO --fail-with-body "https://github.com/joelberkeley/spidr/releases/download/xla-$(short_revision $rev)/pjrt_plugin_xla_cpu-linux-x86_64.so"
else
rm -rf /opt/hostedtoolcache
docker run \
-v $(pwd):/spidr -w /spidr \
tensorflow/build:latest-python3.9 \
sh -c "pjrt-plugins/xla-cpu/build.sh"
fi
mv pjrt_plugin_xla_cpu-linux-x86_64.so pjrt_plugin_xla_cpu.so
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: pjrt_plugin_xla_cpu-linux-x86_64
path: pjrt_plugin_xla_cpu.so
if-no-files-found: error
pjrt-plugin-xla-cpu-darwin-aarch64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build or fetch XLA CPU PJRT plugin
run: |
if [ ! "$(git diff --exit-code HEAD^ XLA_VERSION)" ]; then
. ./dev.sh
rev=$(cat XLA_VERSION)
curl -LO --fail-with-body "https://github.com/joelberkeley/spidr/releases/download/xla-$(short_revision $rev)/pjrt_plugin_xla_cpu-darwin-aarch64.dylib"
else
./pjrt-plugins/xla-cpu/build.sh
fi
mv pjrt_plugin_xla_cpu-darwin-aarch64.dylib pjrt_plugin_xla_cpu.dylib
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: pjrt_plugin_xla_cpu-darwin-aarch64
path: pjrt_plugin_xla_cpu.dylib
if-no-files-found: error
pjrt-plugin-xla-cuda-linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Build or fetch XLA CUDA PJRT plugin
run: |
if [ ! "$(git diff --exit-code HEAD^ XLA_VERSION)" ]; then
. ./dev.sh
rev=$(cat XLA_VERSION)
curl -LO --fail-with-body "https://github.com/joelberkeley/spidr/releases/download/xla-$(short_revision $rev)/pjrt_plugin_xla_cuda-linux-x86_64.so"
else
rm -rf /opt/hostedtoolcache
# note this implies specific versions of CUDA and cuDNN
docker run \
-v $(pwd):/spidr -w /spidr \
tensorflow/build:latest-python3.9 \
sh -c "pjrt-plugins/xla-cuda/build.sh"
fi
mv pjrt_plugin_xla_cuda-linux-x86_64.so pjrt_plugin_xla_cuda.so
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: pjrt_plugin_xla_cuda-linux-x86_64
path: pjrt_plugin_xla_cuda.so
if-no-files-found: error
build-tests-xla-cpu-linux-x86_64:
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
apt-get update && apt-get install -y curl
pack switch HEAD
- name: Build tests
working-directory: test/xla-cpu
run: |
SPIDR_INSTALL_SUPPORT_LIBS=false pack --no-prompt build xla-cpu.ipkg
tar cfz tests-xla-cpu.tar.gz -C build/exec .
- name: Upload tests
uses: actions/upload-artifact@v4
with:
name: tests-xla-cpu-linux-x86_64
path: test/xla-cpu/tests-xla-cpu.tar.gz
if-no-files-found: error
build-tests-xla-cpu-darwin-aarch64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
brew install chezscheme
git clone https://github.com/stefan-hoeck/idris2-pack.git
(cd idris2-pack && make micropack SCHEME=chez)
~/.pack/bin/pack switch HEAD
- name: Build tests
working-directory: test/xla-cpu
run: |
SPIDR_INSTALL_SUPPORT_LIBS=false ~/.pack/bin/pack --no-prompt build xla-cpu.ipkg
tar cfz tests-xla-cpu.tar.gz -C build/exec .
- name: Upload tests
uses: actions/upload-artifact@v4
with:
name: tests-xla-cpu-darwin-aarch64
path: test/xla-cpu/tests-xla-cpu.tar.gz
if-no-files-found: error
build-tests-xla-cuda-linux-x86_64:
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
apt-get update && apt-get install -y curl
pack switch HEAD
- name: Build tests
working-directory: test/xla-cuda
run: |
SPIDR_INSTALL_SUPPORT_LIBS=false pack --no-prompt build xla-cuda.ipkg
tar cfz tests-xla-cuda-linux-x86_64.tar.gz -C build/exec .
- name: Upload tests
uses: actions/upload-artifact@v4
with:
name: tests-xla-cuda-linux-x86_64
path: test/xla-cuda/tests-xla-cuda-linux-x86_64.tar.gz
if-no-files-found: error
test-xla-cpu-linux-x86_64:
needs:
- pjrt-linux-x86_64
- pjrt-plugin-xla-cpu-linux-x86_64
- build-tests-xla-cpu-linux-x86_64
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "{libc_xla-linux-x86_64,*cpu-linux-x86_64}"
merge-multiple: true
- name: Install runtime dependencies
run: |
sudo apt-get install chezscheme
- name: Run tests
run: |
tar xfz tests-xla-cpu.tar.gz . && rm tests-xla-cpu.tar.gz
./test
test-xla-cpu-darwin-aarch64:
needs:
- pjrt-darwin-aarch64
- pjrt-plugin-xla-cpu-darwin-aarch64
- build-tests-xla-cpu-darwin-aarch64
runs-on: macos-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "*darwin-aarch64"
merge-multiple: true
- name: Install runtime dependencies
run: |
brew install chezscheme
- name: Run tests
run: |
tar xfz tests-xla-cpu.tar.gz && rm tests-xla-cpu.tar.gz
./test
test-xla-cuda-linux-x86_64:
needs:
- pjrt-linux-x86_64
- pjrt-plugin-xla-cuda-linux-x86_64
- build-tests-xla-cuda-linux-x86_64
runs-on: ubuntu-latest # needs a CUDA runner
container: nvcr.io/nvidia/tensorrt:23.11-py3
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "{libc_xla-linux-x86_64,*cuda-linux-x86_64}"
merge-multiple: true
- name: Install runtime dependencies
run: |
apt-get update && apt-get install chezscheme
- name: Run tests
run: |
tar xfz tests-xla-cuda.tar.gz . && rm tests-xla-cuda.tar.gz
exit 0 # we can't run tests without a GPU
readme:
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack
steps:
- uses: actions/checkout@v4
- name: Type-check README
run: |
apt-get update && apt-get install -y curl
pack switch HEAD
SPIDR_INSTALL_SUPPORT_LIBS=false pack --no-prompt typecheck readme.ipkg
tutorials:
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack
steps:
- uses: actions/checkout@v4
- name: Type-check tutorials
run: |
apt-get update && apt-get install -y curl
pack switch HEAD
export SPIDR_INSTALL_SUPPORT_LIBS=false
res=0; for f in tutorials/*.ipkg; do pack --no-prompt typecheck $f || res=$?; done; $(exit $res)