From 432283c095e9b72c2e474d3a6c13c073f14644dd Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 29 Jan 2024 12:02:03 +0000 Subject: [PATCH 1/2] CI fix - Use pytest<8 in unittest jobs (#8239) --- .github/scripts/unittest.sh | 3 ++- .github/workflows/tests.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/unittest.sh b/.github/scripts/unittest.sh index 8f0ad92218c..fc4cb8f2796 100755 --- a/.github/scripts/unittest.sh +++ b/.github/scripts/unittest.sh @@ -8,7 +8,8 @@ set -euo pipefail eval "$($(which conda) shell.bash hook)" && conda deactivate && conda activate ci echo '::group::Install testing utilities' -pip install --progress-bar=off pytest pytest-mock pytest-cov expecttest!=0.2.0 +# TODO: remove the <8 constraint on pytest when https://github.com/pytorch/vision/issues/8238 is closed +pip install --progress-bar=off "pytest<8" pytest-mock pytest-cov expecttest!=0.2.0 echo '::endgroup::' python test/smoke_test.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb6290fdfe9..bd483db6e4b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -164,7 +164,8 @@ jobs: echo '::endgroup::' echo '::group::Install testing utilities' - pip install --progress-bar=off pytest + # TODO: remove the <8 constraint on pytest when https://github.com/pytorch/vision/issues/8238 is closed + pip install --progress-bar=off "pytest<8" echo '::endgroup::' echo '::group::Run extended unittests' From 0be6c7e6f9aa6d635e53ed83c5d07927c21ce58d Mon Sep 17 00:00:00 2001 From: "Li-Huai (Allan) Lin" Date: Mon, 29 Jan 2024 16:53:03 -0800 Subject: [PATCH 2/2] [MPS] Link essential libraries in cmake (#8230) Fixes #8222 I think we don't have tests for cmake build. It was built successfully on my Mac. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd485d7a24..8798b64351d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,12 @@ ENDFOREACH() add_library(${PROJECT_NAME} SHARED ${ALL_SOURCES}) target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES}) +if(WITH_MPS) + find_library(metal NAMES Metal) + find_library(foundation NAMES Foundation) + target_link_libraries(${PROJECT_NAME} PRIVATE ${metal} ${foundation}) +endif() + if (WITH_PNG) target_link_libraries(${PROJECT_NAME} PRIVATE ${PNG_LIBRARY}) endif()