diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee163e8cf2..ce6a708e59 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,55 +1,33 @@ name: ci on: - pull_request_review: - types: [submitted] + push: + branches-ignore: + - main + - dependabot/** jobs: approved: - if: github.event.review.state == 'approved' + if: github.event.pull_request.draft == false runs-on: ubuntu-latest + timeout-minutes: 120 strategy: fail-fast: false matrix: py-version: - - '3.10' - - '3.11' - - '3.12' - - '3.13' - - '3.14' + - '3.10' # Oldest supported + - '3.14' # Latest stable mpi: [ 'openmpi' ] install-options: [ '.', '.[hdf5,netcdf,pandas,zarr]' ] pytorch-version: - - 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' - - 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' - - 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' - - 'torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0' - - 'torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1' - - 'torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0' - - 'torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1' - - 'torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0' + - 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' # Oldest supported + - 'torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1' # JSC Stage 2026 + - 'torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0' # Latest stable exclude: - - py-version: '3.14' - pytorch-version: 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' - - py-version: '3.14' - pytorch-version: 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' - - py-version: '3.14' - pytorch-version: 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' - - py-version: '3.14' - pytorch-version: 'torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0' - - py-version: '3.14' - pytorch-version: 'torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1' - - py-version: '3.14' - pytorch-version: 'torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0' - - py-version: '3.13' - pytorch-version: 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' - - py-version: '3.13' - pytorch-version: 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' - - py-version: '3.13' - pytorch-version: 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' - py-version: '3.10' install-options: '.[hdf5,netcdf,pandas,zarr]' - + - py-version: '3.14' + pytorch-version: 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' name: Python ${{ matrix.py-version }} with ${{ matrix.pytorch-version }}; options ${{ matrix.install-options }} steps: @@ -60,18 +38,22 @@ jobs: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup MPI uses: mpi4py/setup-mpi@3969f247e8fceef153418744f9d9ee6fdaeda29f # v1.2.0 with: mpi: ${{ matrix.mpi }} + - name: Use Python ${{ matrix.py-version }} uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} architecture: x64 + - name: Test run: | pip install pytest pip install ${{ matrix.pytorch-version }} ${{ matrix.install-options }} --extra-index-url https://download.pytorch.org/whl/cpu - mpirun -n 3 pytest heat/ - mpirun -n 4 pytest heat/ + # use pytest -vv -x for debugging + pytest heat/ + mpirun -n 4 pytest -vv heat/ diff --git a/.github/workflows/ci_full.yaml b/.github/workflows/ci_full.yaml new file mode 100644 index 0000000000..479649312b --- /dev/null +++ b/.github/workflows/ci_full.yaml @@ -0,0 +1,85 @@ +name: ci_full + +on: + push: + branches: + - main + - stable + paths: + - 'heat/**' + - 'pyproject.toml' + - '.github/workflows/ci_full.yaml' + +jobs: + full_matrix_test: + runs-on: ubuntu-latest + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + py-version: + - '3.10' + - '3.11' + - '3.12' + - '3.13' + - '3.14' + mpi: [ 'openmpi' ] + install-options: [ '.', '.[hdf5,netcdf,pandas,zarr]' ] + pytorch-version: + - 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' + - 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' + - 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' + - 'torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0' + - 'torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1' + - 'torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0' + - 'torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1' + - 'torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0' + exclude: + - py-version: '3.14' + pytorch-version: 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' + - py-version: '3.14' + pytorch-version: 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' + - py-version: '3.14' + pytorch-version: 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' + - py-version: '3.14' + pytorch-version: 'torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0' + - py-version: '3.14' + pytorch-version: 'torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1' + - py-version: '3.14' + pytorch-version: 'torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0' + - py-version: '3.13' + pytorch-version: 'torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1' + - py-version: '3.13' + pytorch-version: 'torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1' + - py-version: '3.13' + pytorch-version: 'torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1' + - py-version: '3.10' + install-options: '.[hdf5,netcdf,pandas,zarr]' + + name: Python ${{ matrix.py-version }} with ${{ matrix.pytorch-version }}; options ${{ matrix.install-options }} + steps: + - name: Harden Runner + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 + with: + egress-policy: audit + + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup MPI + uses: mpi4py/setup-mpi@3969f247e8fceef153418744f9d9ee6fdaeda29f # v1.2.0 + with: + mpi: ${{ matrix.mpi }} + + - name: Use Python ${{ matrix.py-version }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: ${{ matrix.py-version }} + architecture: x64 + + - name: Test + run: | + pip install pytest + pip install ${{ matrix.pytorch-version }} ${{ matrix.install-options }} --extra-index-url https://download.pytorch.org/whl/cpu + mpirun -n 3 pytest heat/ + mpirun -n 4 pytest heat/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 08060fa610..2c96813e2d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -32,7 +32,7 @@ build: # If grep failed to find a match (exit code 1), then exit with 18 if [ $? -eq 1 ]; then echo "No relevant changes found. Skipping build." - exit 18 + exit 0 fi fi diff --git a/heat/core/tests/test_io.py b/heat/core/tests/test_io.py index 45a3776758..cd57f7aadd 100644 --- a/heat/core/tests/test_io.py +++ b/heat/core/tests/test_io.py @@ -990,6 +990,8 @@ def test_load_zarr_group(self): import zarr + ht.MPI_WORLD.Barrier() + # Write out a nested Zarr store original_data = np.arange(np.prod(self.ZARR_SHAPE)).reshape(self.ZARR_SHAPE) nested_group_name = "MAIN_0" @@ -1027,7 +1029,6 @@ def test_load_zarr_group(self): self.assertTrue(np.array_equal(ht_tensor_kw.numpy(), original_data)) ht.MPI_WORLD.Barrier() - # test loading with wildcard num_chunks = self.comm.size * 2 + 1 if self.comm.size > 3: @@ -1118,6 +1119,8 @@ def test_load_zarr_group(self): with self.assertRaises(FileNotFoundError): test = ht.load(self.ZARR_OUT_PATH, variable="NONEXSISTENT_CHUNK_*_SPLIT0/DATA", split=0) + ht.MPI_WORLD.Barrier() + def test_load_zarr_slice(self): if not ht.io.supports_zarr(): self.skipTest("Requires zarr")