From 7b677f7fbb592d5de119fe02598b69ce992d9317 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Thu, 14 Nov 2024 10:33:48 +0100 Subject: [PATCH 1/6] CI: parametrize over Array API modules Keep testing with array-api-strict, add numpy, torch and jax.numpy --- .github/workflows/test.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a58f1841..b3e9bbac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.11"] + array-api-module: ["array_api_strict", "numpy", "torch", "jax.numpy"] + fail-fast: false steps: - name: Checkout array-api-tests @@ -22,11 +24,19 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install array-api-strict + if [ ${{ matrix.array-api-module }} = 'torch' ] + then + python -m pip install torch --index-url https://download.pytorch.org/whl/cpu + elif [ ${{ matrix.array-api-module }} = 'jax.numpy' ] + then + python -m pip install "jax[cpu]" + else + python -m pip install ${{ matrix.array-api-module }} + fi python -m pip install -r requirements.txt - name: Run the test suite env: - ARRAY_API_TESTS_MODULE: array_api_strict + ARRAY_API_TESTS_MODULE: ${{ matrix.array-api-module }} ARRAY_API_STRICT_API_VERSION: 2023.12 run: | pytest -v -rxXfE --skips-file array-api-strict-skips.txt array_api_tests/ From 1c430ecd5d332d2e356fe3ee788d79edd4810588 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Wed, 20 Nov 2024 18:03:24 +0200 Subject: [PATCH 2/6] CI: try using -compat-wrapped modules --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3e9bbac..2f395d56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: python-version: ["3.11"] - array-api-module: ["array_api_strict", "numpy", "torch", "jax.numpy"] + array-api-module: ["array_api_strict", "array_api_compat.numpy", "array_api_compat.torch", "jax.numpy"] fail-fast: false steps: @@ -24,16 +24,17 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - if [ ${{ matrix.array-api-module }} = 'torch' ] + if [[ ${{ matrix.array-api-module }} == *"torch"* ]] then python -m pip install torch --index-url https://download.pytorch.org/whl/cpu - elif [ ${{ matrix.array-api-module }} = 'jax.numpy' ] + elif [[ ${{ matrix.array-api-module }} == *"jax.numpy"* ]] then python -m pip install "jax[cpu]" else python -m pip install ${{ matrix.array-api-module }} fi python -m pip install -r requirements.txt + python -m pip install array-api-compat - name: Run the test suite env: ARRAY_API_TESTS_MODULE: ${{ matrix.array-api-module }} From ff7eadaefacb7317f130253a9515320652977942 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Wed, 20 Nov 2024 18:07:11 +0200 Subject: [PATCH 3/6] . --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f395d56..ab0895e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: elif [[ ${{ matrix.array-api-module }} == *"jax.numpy"* ]] then python -m pip install "jax[cpu]" + elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]] + python -m pip install numpy else python -m pip install ${{ matrix.array-api-module }} fi From 348283082109e1e0b4a879d7da99b9af1c40709b Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Wed, 20 Nov 2024 18:08:18 +0200 Subject: [PATCH 4/6] .. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab0895e1..eb1db929 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: elif [[ ${{ matrix.array-api-module }} == *"jax.numpy"* ]] then python -m pip install "jax[cpu]" - elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]] + elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]] then python -m pip install numpy else python -m pip install ${{ matrix.array-api-module }} From 94e35ab08b73cfd2d7c96fbc03f9196988e900f4 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Wed, 20 Nov 2024 18:09:26 +0200 Subject: [PATCH 5/6] ... --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb1db929..472e6172 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: elif [[ ${{ matrix.array-api-module }} == *"jax.numpy"* ]] then python -m pip install "jax[cpu]" - elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]] then + elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]]; then python -m pip install numpy else python -m pip install ${{ matrix.array-api-module }} From 7d26f3c65fd5eb698b1ea6305e9a92fd5146c041 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Wed, 20 Nov 2024 18:15:00 +0200 Subject: [PATCH 6/6] use -compat @ main --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 472e6172..806dd395 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: python -m pip install ${{ matrix.array-api-module }} fi python -m pip install -r requirements.txt - python -m pip install array-api-compat + python -m pip install git+https://github.com/data-apis/array-api-compat.git - name: Run the test suite env: ARRAY_API_TESTS_MODULE: ${{ matrix.array-api-module }}