@@ -61,16 +61,17 @@ jobs:
61
61
python-version : ${{ matrix.python-version }}
62
62
- uses : pre-commit/action@v3.0.1
63
63
64
- test_ubuntu :
65
- name : " Test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}"
64
+ test :
65
+ name : " ${{ matrix.os }} test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}"
66
66
needs :
67
67
- changes
68
68
- style
69
- runs-on : ubuntu-latest
69
+ runs-on : ${{ matrix.os }}
70
70
if : ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }}
71
71
strategy :
72
72
fail-fast : false
73
73
matrix :
74
+ os : ["ubuntu-latest"]
74
75
python-version : ["3.10", "3.12"]
75
76
fast-compile : [0, 1]
76
77
float32 : [0, 1]
@@ -103,30 +104,44 @@ jobs:
103
104
fast-compile : 1
104
105
include :
105
106
- install-numba : 1
107
+ os : " ubuntu-latest"
106
108
python-version : " 3.10"
107
109
fast-compile : 0
108
110
float32 : 0
109
111
part : " tests/link/numba"
110
112
- install-numba : 1
113
+ os : " ubuntu-latest"
111
114
python-version : " 3.12"
112
115
fast-compile : 0
113
116
float32 : 0
114
117
part : " tests/link/numba"
115
118
- install-jax : 1
119
+ os : " ubuntu-latest"
116
120
python-version : " 3.10"
117
121
fast-compile : 0
118
122
float32 : 0
119
123
part : " tests/link/jax"
120
124
- install-jax : 1
125
+ os : " ubuntu-latest"
121
126
python-version : " 3.12"
122
127
fast-compile : 0
123
128
float32 : 0
124
129
part : " tests/link/jax"
125
130
- install-torch : 1
131
+ os : " ubuntu-latest"
126
132
python-version : " 3.10"
127
133
fast-compile : 0
128
134
float32 : 0
129
135
part : " tests/link/pytorch"
136
+ - os : macos-latest
137
+ python-version : " 3.12"
138
+ fast-compile : 0
139
+ float32 : 0
140
+ install-numba : 0
141
+ install-jax : 0
142
+ install-torch : 0
143
+ part : " tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py"
144
+
130
145
steps :
131
146
- uses : actions/checkout@v4
132
147
with :
@@ -146,15 +161,19 @@ jobs:
146
161
MATRIX_CONTEXT : ${{ toJson(matrix) }}
147
162
run : |
148
163
echo $MATRIX_CONTEXT
149
- export MATRIX_ID=`echo $MATRIX_CONTEXT | md5sum | cut -c 1-32`
164
+ export MATRIX_ID=`echo $MATRIX_CONTEXT | sha256sum | cut -c 1-32`
150
165
echo $MATRIX_ID
151
166
echo "id=$MATRIX_ID" >> $GITHUB_OUTPUT
152
167
153
168
- name : Install dependencies
154
169
shell : micromamba-shell {0}
155
170
run : |
156
171
157
- micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock
172
+ if [[ $OS == "macos-latest" ]]; then
173
+ micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" numpy scipy pip graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock libblas=*=*accelerate;
174
+ else
175
+ micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock;
176
+ fi
158
177
if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi
159
178
if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi
160
179
if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" pytorch pytorch-cuda=12.1 "mkl<=2024.0" -c pytorch -c nvidia; fi
@@ -163,12 +182,17 @@ jobs:
163
182
pip install -e ./
164
183
micromamba list && pip freeze
165
184
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
166
- python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"'
185
+ if [[ $OS == "macos-latest" ]]; then
186
+ python -c 'import pytensor; assert pytensor.config.blas__ldflags.startswith("-framework Accelerate"), "Blas flags are not set to MacOS Accelerate"';
187
+ else
188
+ python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"';
189
+ fi
167
190
env :
168
191
PYTHON_VERSION : ${{ matrix.python-version }}
169
192
INSTALL_NUMBA : ${{ matrix.install-numba }}
170
193
INSTALL_JAX : ${{ matrix.install-jax }}
171
194
INSTALL_TORCH : ${{ matrix.install-torch}}
195
+ OS : ${{ matrix.os}}
172
196
173
197
- name : Run tests
174
198
shell : micromamba-shell {0}
@@ -249,10 +273,10 @@ jobs:
249
273
if : ${{ always() }}
250
274
runs-on : ubuntu-latest
251
275
name : " All tests"
252
- needs : [changes, style, test_ubuntu ]
276
+ needs : [changes, style, test ]
253
277
steps :
254
278
- name : Check build matrix status
255
- if : ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test_ubuntu .result != 'success') }}
279
+ if : ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test .result != 'success') }}
256
280
run : exit 1
257
281
258
282
upload-coverage :
0 commit comments