MAINT: migrate chndtr to boost #5
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
name: Array API | |
on: | |
push: | |
branches: | |
- maintenance/** | |
pull_request: | |
branches: | |
- main | |
- maintenance/** | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
env: | |
CCACHE_DIR: "${{ github.workspace }}/.ccache" | |
INSTALLDIR: "build-install" | |
# Only run tests that use the `xp` fixture | |
XP_TESTS: -m array_api_backends | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
get_commit_message: | |
name: Get commit message | |
uses: ./.github/workflows/commit_message.yml | |
xp_cpu: | |
name: Linux PyTorch/JAX/Dask/xp-strict CPU | |
needs: get_commit_message | |
if: > | |
needs.get_commit_message.outputs.message == 1 | |
&& (github.repository == 'scipy/scipy' || github.repository == '') | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
maintenance-branch: | |
- ${{ contains(github.ref, 'maintenance/') || contains(github.base_ref, 'maintenance/') }} | |
exclude: | |
- maintenance-branch: true | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: recursive | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # not using a path to also cache pytorch | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev | |
- name: Install Python packages | |
run: | | |
python -m pip install numpy cython pytest pytest-xdist pytest-timeout pybind11 mpmath gmpy2 pythran ninja meson click rich-click doit pydevtool pooch hypothesis array-api-strict==2.1.0 | |
- name: Install PyTorch CPU | |
run: | | |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
- name: Install JAX | |
run: | | |
python -m pip install "jax[cpu]" | |
- name: Install Dask | |
run: | | |
python -m pip install dask[array] | |
- name: Install MArray | |
run: | | |
python -m pip install marray | |
- name: Prepare compiler cache | |
id: prep-ccache | |
shell: bash | |
run: | | |
mkdir -p "${CCACHE_DIR}" | |
echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT | |
NOW=$(date -u +"%F-%T") | |
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT | |
- name: Setup compiler cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
id: cache-ccache | |
with: | |
path: ${{ steps.prep-ccache.outputs.dir }} | |
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }} | |
restore-keys: | | |
${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux- | |
- name: Setup build and install scipy | |
run: | | |
python dev.py build | |
- name: Test SciPy | |
run: | | |
export OMP_NUM_THREADS=2 | |
python dev.py --no-build test -b all $XP_TESTS -- --durations 3 --timeout=60 | |
- name: Test SciPy with torch/float32 | |
run: | | |
export SCIPY_DEFAULT_DTYPE="float32" | |
python dev.py --no-build test -b torch $XP_TESTS -- --durations 3 --timeout=60 |