-
Notifications
You must be signed in to change notification settings - Fork 7
211 lines (165 loc) · 5.39 KB
/
test.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
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
branches:
- main
schedule:
# At minute 0 past hour 6. (see https://crontab.guru)
- cron: '00 06 * * *'
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit).
group: ci-build-test-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
SYSTEM_VERSION_COMPAT: 0
jobs:
test-mlir-bindings:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13, macos-14, windows-2022 ]
py_version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
exclude:
- os: macos-13
py_version: "3.8"
- os: macos-13
py_version: "3.9"
- os: macos-14
py_version: "3.8"
- os: macos-14
py_version: "3.9"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
allow-prereleases: true
- name: Free disk space
if: contains(matrix.os, 'ubuntu')
uses: descriptinc/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false # This frees space on the wrong partition.
- uses: Jimver/cuda-toolkit@v0.2.15
if: contains(matrix.os, 'ubuntu')
id: cuda-toolkit
with:
cuda: '12.4.1'
linux-local-args: '["--toolkit"]'
log-file-suffix: "${{ matrix.os }}-${{ matrix.py_version }}.txt"
- name: Install and configure
shell: bash
run: |
pip install .[test,mlir] -v -f https://makslevental.github.io/wheels
- name: Test
shell: bash
run: |
if [ ${{ matrix.os }} == 'windows-2022' ]; then
pytest -s tests
else
pytest --capture=tee-sys tests
fi
- name: Test mwe
shell: bash
run: |
python examples/mwe.py
test-other-host-bindings:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-12, macos-14, windows-2022 ]
py_version: [ "3.10", "3.11" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
allow-prereleases: true
- name: Install and configure
shell: bash
run: |
export PIP_FIND_LINKS=https://makslevental.github.io/wheels
HOST_MLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir pip install .[test,jax] -v
- name: Test
shell: bash
run: |
if [ ${{ matrix.os }} == 'windows-2022' ]; then
pytest -s tests/test_other_hosts.py
else
pytest --capture=tee-sys tests/test_other_hosts.py
fi
test-jupyter:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
py_version: [ "3.10" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
allow-prereleases: true
- name: Run notebook
shell: bash
run: |
pip install jupyter
pip install -q mlir-python-bindings -f https://makslevental.github.io/wheels
pip install -q .
sed -i.bak 's/OUTPUT_TIMEOUT = 10/OUTPUT_TIMEOUT = 100/g' \
$(python -c 'import site; print(site.getsitepackages()[0])')/jupyter_client/runapp.py
jupyter execute examples/mlir_python_extras.ipynb
jupyter execute examples/vectorization_e2e.ipynb
mlir-bindings-aarch64:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
py_version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install, configure, and test
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu20.04
dockerRunArgs: --volume "${{ github.workspace }}:/workspace"
install: |
apt-get update -q -y
apt-get install -y wget build-essential
mkdir -p ~/miniconda3
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O miniconda.sh
bash miniconda.sh -b -u -p /root/miniconda3
eval "$(/root/miniconda3/bin/conda shell.bash hook)"
conda init
run: |
eval "$(/root/miniconda3/bin/conda shell.bash hook)"
conda create -n env -q -y -c conda-forge/label/python_rc python=${{ matrix.py_version }}
conda activate env
cd /workspace
pip install -q .[test,mlir] -f https://makslevental.github.io/wheels
pytest --capture=tee-sys tests
python examples/mwe.py