From 5dd10aed55932a8ea8a79b6edf7bb0d0e95c13fc Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 6 Jun 2024 11:13:35 +0100 Subject: [PATCH 1/5] Use macos-m1-13 and put back MPS build --- .github/workflows/tests.yml | 2 +- setup.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad327129912..bf5f8c108fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: - "3.10" - "3.11" - "3.12" - runner: ["macos-m1-stable"] + runner: ["macos-m1-13"] fail-fast: false uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: diff --git a/setup.py b/setup.py index 753a50ffeed..f26f1638a5a 100644 --- a/setup.py +++ b/setup.py @@ -205,14 +205,9 @@ def get_extensions(): nvcc_flags = [] extra_compile_args["nvcc"] = nvcc_flags - # FIXME: MPS build breaks custom ops registration, so it was disabled. - # See https://github.com/pytorch/vision/issues/8456. - # TODO: Fix MPS build, remove warning below, and put back commented-out elif block.V - if force_mps: - warnings.warn("MPS build is temporarily disabled!!!!") - # elif torch.backends.mps.is_available() or force_mps: - # source_mps = glob.glob(os.path.join(extensions_dir, "ops", "mps", "*.mm")) - # sources += source_mps + elif torch.backends.mps.is_available() or force_mps: + source_mps = glob.glob(os.path.join(extensions_dir, "ops", "mps", "*.mm")) + sources += source_mps if sys.platform == "win32": define_macros += [("torchvision_EXPORTS", None)] From b6d88ed5c9f71282ddd57f0a59b3b19614a5ba14 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 6 Jun 2024 11:17:51 +0100 Subject: [PATCH 2/5] Update other jobs --- .github/workflows/build-cmake.yml | 2 +- .github/workflows/build-conda-m1.yml | 2 +- .github/workflows/build-wheels-m1.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 1dce7b8446a..8b6b1303272 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: include: - - runner: macos-m1-stable + - runner: macos-m1-13 fail-fast: false uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: diff --git a/.github/workflows/build-conda-m1.yml b/.github/workflows/build-conda-m1.yml index bd10e4e4634..264403b0982 100644 --- a/.github/workflows/build-conda-m1.yml +++ b/.github/workflows/build-conda-m1.yml @@ -46,7 +46,7 @@ jobs: post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} smoke-test-script: ${{ matrix.smoke-test-script }} - runner-type: macos-m1-stable + runner-type: macos-m1-13 trigger-event: ${{ github.event_name }} secrets: CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index 76709b755e8..ace4700d593 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -47,6 +47,6 @@ jobs: pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} - runner-type: macos-m1-stable + runner-type: macos-m1-13 smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} From c190ce00015a0321128426705d5fc5ab44f659e8 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 6 Jun 2024 11:21:34 +0100 Subject: [PATCH 3/5] remove warning --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index f26f1638a5a..f1ae2cadbd1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ import shutil import subprocess import sys -import warnings import torch from pkg_resources import DistributionNotFound, get_distribution, parse_version From e0e9b204f71c977235b23eb027f9c5df3faf6faf Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 6 Jun 2024 12:29:46 +0100 Subject: [PATCH 4/5] reverty --- test/conftest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 89b4946e612..a9768598ded 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -49,8 +49,7 @@ def pytest_collection_modifyitems(items): # There are special cases though, see below item.add_marker(pytest.mark.skip(reason=CUDA_NOT_AVAILABLE_MSG)) - # TODO: uncoment when MPS works again - see FIXME in setup.py - if needs_mps: # and not torch.backends.mps.is_available(): + if needs_mps and not torch.backends.mps.is_available(): item.add_marker(pytest.mark.skip(reason=MPS_NOT_AVAILABLE_MSG)) if IN_FBCODE: From f1562195d8585a97d36f63d1a962968962e8fae5 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 7 Jun 2024 09:20:01 +0100 Subject: [PATCH 5/5] Use stable --- .github/workflows/build-cmake.yml | 2 +- .github/workflows/build-conda-m1.yml | 2 +- .github/workflows/build-wheels-m1.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 8b6b1303272..1dce7b8446a 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: include: - - runner: macos-m1-13 + - runner: macos-m1-stable fail-fast: false uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: diff --git a/.github/workflows/build-conda-m1.yml b/.github/workflows/build-conda-m1.yml index 264403b0982..bd10e4e4634 100644 --- a/.github/workflows/build-conda-m1.yml +++ b/.github/workflows/build-conda-m1.yml @@ -46,7 +46,7 @@ jobs: post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} smoke-test-script: ${{ matrix.smoke-test-script }} - runner-type: macos-m1-13 + runner-type: macos-m1-stable trigger-event: ${{ github.event_name }} secrets: CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index ace4700d593..76709b755e8 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -47,6 +47,6 @@ jobs: pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} - runner-type: macos-m1-13 + runner-type: macos-m1-stable smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf5f8c108fb..ad327129912 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: - "3.10" - "3.11" - "3.12" - runner: ["macos-m1-13"] + runner: ["macos-m1-stable"] fail-fast: false uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: