-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow job on mac to check blas
- Loading branch information
1 parent
b4e9531
commit e655429
Showing
1 changed file
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,16 +61,17 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
- uses: pre-commit/[email protected] | ||
|
||
test_ubuntu: | ||
name: "Test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}" | ||
test: | ||
name: "${{ matrix.os }} test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}" | ||
needs: | ||
- changes | ||
- style | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python-version: ["3.10", "3.12"] | ||
fast-compile: [0, 1] | ||
float32: [0, 1] | ||
|
@@ -103,30 +104,44 @@ jobs: | |
fast-compile: 1 | ||
include: | ||
- install-numba: 1 | ||
os: "ubuntu-latest" | ||
python-version: "3.10" | ||
fast-compile: 0 | ||
float32: 0 | ||
part: "tests/link/numba" | ||
- install-numba: 1 | ||
os: "ubuntu-latest" | ||
python-version: "3.12" | ||
fast-compile: 0 | ||
float32: 0 | ||
part: "tests/link/numba" | ||
- install-jax: 1 | ||
os: "ubuntu-latest" | ||
python-version: "3.10" | ||
fast-compile: 0 | ||
float32: 0 | ||
part: "tests/link/jax" | ||
- install-jax: 1 | ||
os: "ubuntu-latest" | ||
python-version: "3.12" | ||
fast-compile: 0 | ||
float32: 0 | ||
part: "tests/link/jax" | ||
- install-torch: 1 | ||
os: "ubuntu-latest" | ||
python-version: "3.10" | ||
fast-compile: 0 | ||
float32: 0 | ||
part: "tests/link/pytorch" | ||
- os: macos-latest | ||
python-version: "3.12" | ||
fast-compile: 0 | ||
float32: 0 | ||
install-numba: 0 | ||
install-jax: 0 | ||
install-torch: 0 | ||
part: "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -146,15 +161,19 @@ jobs: | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | ||
run: | | ||
echo $MATRIX_CONTEXT | ||
export MATRIX_ID=`echo $MATRIX_CONTEXT | md5sum | cut -c 1-32` | ||
export MATRIX_ID=`echo $MATRIX_CONTEXT | sha256sum | cut -c 1-32` | ||
echo $MATRIX_ID | ||
echo "id=$MATRIX_ID" >> $GITHUB_OUTPUT | ||
- name: Install dependencies | ||
shell: micromamba-shell {0} | ||
run: | | ||
micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock | ||
if [[ $OS == "macos-latest" ]]; then | ||
micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" numpy scipy pip graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock libblas=*=*accelerate; | ||
else | ||
micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock; | ||
fi | ||
if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi | ||
if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi | ||
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: | |
pip install -e ./ | ||
micromamba list && pip freeze | ||
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))' | ||
python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"' | ||
if [[ $OS == "macos-latest" ]]; then | ||
python -c 'import pytensor; assert pytensor.config.blas__ldflags.startswith("-framework Accelerate"), "Blas flags are not set to MacOS Accelerate"'; | ||
else | ||
python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"'; | ||
fi | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
INSTALL_NUMBA: ${{ matrix.install-numba }} | ||
INSTALL_JAX: ${{ matrix.install-jax }} | ||
INSTALL_TORCH: ${{ matrix.install-torch}} | ||
OS: ${{ matrix.os}} | ||
|
||
- name: Run tests | ||
shell: micromamba-shell {0} | ||
|
@@ -249,10 +273,10 @@ jobs: | |
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
name: "All tests" | ||
needs: [changes, style, test_ubuntu] | ||
needs: [changes, style, test] | ||
steps: | ||
- name: Check build matrix status | ||
if: ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test_ubuntu.result != 'success') }} | ||
if: ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test.result != 'success') }} | ||
run: exit 1 | ||
|
||
upload-coverage: | ||
|