From b585f017eaaf9ee0dd4ae13fcb7172a4090ec76f Mon Sep 17 00:00:00 2001 From: jathu Date: Fri, 21 Mar 2025 07:49:57 -0700 Subject: [PATCH 01/11] address comments --- backends/apple/coreml/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/backends/apple/coreml/CMakeLists.txt b/backends/apple/coreml/CMakeLists.txt index 06807279978..a04c6e7d2bb 100644 --- a/backends/apple/coreml/CMakeLists.txt +++ b/backends/apple/coreml/CMakeLists.txt @@ -25,8 +25,6 @@ endif() option(COREML_BUILD_EXECUTOR_RUNNER "Build CoreML executor runner." OFF) -set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) - # inmemoryfs sources set(INMEMORYFS_SOURCES runtime/inmemoryfs/inmemory_filesystem.cpp From 6fb5f745ee59552ee5c76172eb1d71395a884887 Mon Sep 17 00:00:00 2001 From: jathu Date: Fri, 21 Mar 2025 08:18:37 -0700 Subject: [PATCH 02/11] address comments --- backends/apple/coreml/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/apple/coreml/CMakeLists.txt b/backends/apple/coreml/CMakeLists.txt index a04c6e7d2bb..06807279978 100644 --- a/backends/apple/coreml/CMakeLists.txt +++ b/backends/apple/coreml/CMakeLists.txt @@ -25,6 +25,8 @@ endif() option(COREML_BUILD_EXECUTOR_RUNNER "Build CoreML executor runner." OFF) +set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) + # inmemoryfs sources set(INMEMORYFS_SOURCES runtime/inmemoryfs/inmemory_filesystem.cpp From dc333f336fc66c4173bfbc3b30e7b44f9b1206c6 Mon Sep 17 00:00:00 2001 From: jathu Date: Thu, 20 Mar 2025 17:39:19 -0700 Subject: [PATCH 03/11] split targets --- backends/apple/coreml/CMakeLists.txt | 45 +++++++++++----------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/backends/apple/coreml/CMakeLists.txt b/backends/apple/coreml/CMakeLists.txt index 06807279978..f94ca5021eb 100644 --- a/backends/apple/coreml/CMakeLists.txt +++ b/backends/apple/coreml/CMakeLists.txt @@ -118,31 +118,20 @@ set(PROTOBUF_SOURCES runtime/sdk/format/WordTagger.pb.cc ) -find_library(FOUNDATION_FRAMEWORK Foundation) - # CoreML util -add_library(coreml_util ${UTIL_SOURCES}) -target_include_directories(coreml_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util) -target_link_libraries(coreml_util PRIVATE ${FOUNDATION_FRAMEWORK}) - -install( - TARGETS coreml_util - DESTINATION lib - INCLUDES - DESTINATION ${_common_include_directories} +add_library(coreml_util) +target_sources(coreml_util PRIVATE ${UTIL_SOURCES}) +target_include_directories(coreml_util + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util ) # CoreML inmemoryfs -add_library(coreml_inmemoryfs ${INMEMORYFS_SOURCES}) -target_include_directories(coreml_inmemoryfs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs) -target_link_libraries(coreml_inmemoryfs PRIVATE coreml_util ${FOUNDATION_FRAMEWORK}) - -install( - TARGETS coreml_inmemoryfs - DESTINATION lib - INCLUDES - DESTINATION ${_common_include_directories} +add_library(coreml_inmemoryfs) +target_sources(coreml_inmemoryfs PRIVATE ${INMEMORYFS_SOURCES}) +target_include_directories(coreml_inmemoryfs + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs ) +target_link_libraries(coreml_inmemoryfs PRIVATE coreml_util) # Define the delegate library add_library(coremldelegate) @@ -160,6 +149,9 @@ target_include_directories( target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..) target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10) target_compile_definitions(coremldelegate PRIVATE C10_USING_CUSTOM_GENERATED_MACROS) +target_link_libraries(coremldelegate PRIVATE coreml_util) +target_link_libraries(coremldelegate PRIVATE coreml_inmemoryfs) +target_link_libraries(coremldelegate PRIVATE executorch_core) if(EXECUTORCH_BUILD_DEVTOOLS) target_sources(coremldelegate PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES}) @@ -179,17 +171,13 @@ endif() find_library(ACCELERATE_FRAMEWORK Accelerate) find_library(COREML_FRAMEWORK CoreML) +find_library(FOUNDATION_FRAMEWORK Foundation) find_library(SQLITE_LIBRARY sqlite3) target_link_libraries( coremldelegate - PUBLIC coreml_util - coreml_inmemoryfs - PRIVATE executorch_core - ${ACCELERATE_FRAMEWORK} - ${COREML_FRAMEWORK} - ${FOUNDATION_FRAMEWORK} - ${SQLITE_LIBRARY} + PRIVATE executorch_core ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK} + ${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY} ) target_link_options_shared_lib(coremldelegate) @@ -244,5 +232,6 @@ if(EXECUTORCH_BUILD_COREML AND EXECUTORCH_BUILD_PYBIND) if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") target_compile_options(executorchcoreml PRIVATE -g) endif() - target_link_libraries(executorchcoreml PRIVATE coreml_util coreml_inmemoryfs) + target_link_libraries(executorchcoreml PRIVATE coreml_util) + target_link_libraries(executorchcoreml PRIVATE coreml_inmemoryfs) endif() From 25163927ef6707151b3bf64e8b41320e2293ce96 Mon Sep 17 00:00:00 2001 From: jathu Date: Fri, 21 Mar 2025 07:49:57 -0700 Subject: [PATCH 04/11] address comments --- backends/apple/coreml/CMakeLists.txt | 45 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/backends/apple/coreml/CMakeLists.txt b/backends/apple/coreml/CMakeLists.txt index f94ca5021eb..06807279978 100644 --- a/backends/apple/coreml/CMakeLists.txt +++ b/backends/apple/coreml/CMakeLists.txt @@ -118,20 +118,31 @@ set(PROTOBUF_SOURCES runtime/sdk/format/WordTagger.pb.cc ) +find_library(FOUNDATION_FRAMEWORK Foundation) + # CoreML util -add_library(coreml_util) -target_sources(coreml_util PRIVATE ${UTIL_SOURCES}) -target_include_directories(coreml_util - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util +add_library(coreml_util ${UTIL_SOURCES}) +target_include_directories(coreml_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util) +target_link_libraries(coreml_util PRIVATE ${FOUNDATION_FRAMEWORK}) + +install( + TARGETS coreml_util + DESTINATION lib + INCLUDES + DESTINATION ${_common_include_directories} ) # CoreML inmemoryfs -add_library(coreml_inmemoryfs) -target_sources(coreml_inmemoryfs PRIVATE ${INMEMORYFS_SOURCES}) -target_include_directories(coreml_inmemoryfs - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs +add_library(coreml_inmemoryfs ${INMEMORYFS_SOURCES}) +target_include_directories(coreml_inmemoryfs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs) +target_link_libraries(coreml_inmemoryfs PRIVATE coreml_util ${FOUNDATION_FRAMEWORK}) + +install( + TARGETS coreml_inmemoryfs + DESTINATION lib + INCLUDES + DESTINATION ${_common_include_directories} ) -target_link_libraries(coreml_inmemoryfs PRIVATE coreml_util) # Define the delegate library add_library(coremldelegate) @@ -149,9 +160,6 @@ target_include_directories( target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..) target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10) target_compile_definitions(coremldelegate PRIVATE C10_USING_CUSTOM_GENERATED_MACROS) -target_link_libraries(coremldelegate PRIVATE coreml_util) -target_link_libraries(coremldelegate PRIVATE coreml_inmemoryfs) -target_link_libraries(coremldelegate PRIVATE executorch_core) if(EXECUTORCH_BUILD_DEVTOOLS) target_sources(coremldelegate PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES}) @@ -171,13 +179,17 @@ endif() find_library(ACCELERATE_FRAMEWORK Accelerate) find_library(COREML_FRAMEWORK CoreML) -find_library(FOUNDATION_FRAMEWORK Foundation) find_library(SQLITE_LIBRARY sqlite3) target_link_libraries( coremldelegate - PRIVATE executorch_core ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK} - ${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY} + PUBLIC coreml_util + coreml_inmemoryfs + PRIVATE executorch_core + ${ACCELERATE_FRAMEWORK} + ${COREML_FRAMEWORK} + ${FOUNDATION_FRAMEWORK} + ${SQLITE_LIBRARY} ) target_link_options_shared_lib(coremldelegate) @@ -232,6 +244,5 @@ if(EXECUTORCH_BUILD_COREML AND EXECUTORCH_BUILD_PYBIND) if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") target_compile_options(executorchcoreml PRIVATE -g) endif() - target_link_libraries(executorchcoreml PRIVATE coreml_util) - target_link_libraries(executorchcoreml PRIVATE coreml_inmemoryfs) + target_link_libraries(executorchcoreml PRIVATE coreml_util coreml_inmemoryfs) endif() From 71e5f48ff17b612bb16e1c4d056ee4eaf15696df Mon Sep 17 00:00:00 2001 From: jathu Date: Thu, 20 Mar 2025 19:36:32 -0700 Subject: [PATCH 05/11] build inmemoryfs when coreml or pybindings enabled --- CMakeLists.txt | 2 ++ setup.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6509d4adeef..e83e4046529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -811,6 +811,7 @@ if(EXECUTORCH_BUILD_PYBIND) if(EXECUTORCH_BUILD_COREML) list(APPEND _dep_libs coremldelegate) + list(APPEND _dep_libs coreml_inmemoryfs_pybinding) endif() if(EXECUTORCH_BUILD_MPS) @@ -935,6 +936,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER) if(EXECUTORCH_BUILD_COREML) list(APPEND _executor_runner_libs coremldelegate) + list(APPEND _executor_runner_libs coreml_inmemoryfs_pybinding) endif() add_executable(executor_runner ${_executor_runner__srcs}) diff --git a/setup.py b/setup.py index 871fdf329c2..e73ed1eb4da 100644 --- a/setup.py +++ b/setup.py @@ -139,6 +139,10 @@ def mps(cls) -> bool: def xnnpack(cls) -> bool: return cls._is_cmake_arg_enabled("EXECUTORCH_BUILD_XNNPACK", default=False) + @classmethod + def coreml(cls) -> bool: + return cls._is_env_enabled("EXECUTORCH_BUILD_COREML", default=False) + @classmethod def training(cls) -> bool: return cls._is_cmake_arg_enabled( @@ -843,6 +847,15 @@ def get_ext_modules() -> List[Extension]: ] ) + if ShouldBuild.pybindings() or ShouldBuild.coreml(): + ext_modules.append( + BuiltExtension( + src="coreml_inmemoryfs_pybinding.*", + src_dir="backends/apple/coreml", + modpath="executorch.backends.apple.coreml.inmemoryfs", + ) + ) + if ShouldBuild.pybindings(): ext_modules.append( # Install the prebuilt pybindings extension wrapper for the runtime, From c2bcafc59289421002ca4dec53372e48aaa4769a Mon Sep 17 00:00:00 2001 From: jathu Date: Thu, 20 Mar 2025 19:39:13 -0700 Subject: [PATCH 06/11] update usage --- CMakeLists.txt | 2 -- setup.py | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e83e4046529..6509d4adeef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -811,7 +811,6 @@ if(EXECUTORCH_BUILD_PYBIND) if(EXECUTORCH_BUILD_COREML) list(APPEND _dep_libs coremldelegate) - list(APPEND _dep_libs coreml_inmemoryfs_pybinding) endif() if(EXECUTORCH_BUILD_MPS) @@ -936,7 +935,6 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER) if(EXECUTORCH_BUILD_COREML) list(APPEND _executor_runner_libs coremldelegate) - list(APPEND _executor_runner_libs coreml_inmemoryfs_pybinding) endif() add_executable(executor_runner ${_executor_runner__srcs}) diff --git a/setup.py b/setup.py index e73ed1eb4da..871fdf329c2 100644 --- a/setup.py +++ b/setup.py @@ -139,10 +139,6 @@ def mps(cls) -> bool: def xnnpack(cls) -> bool: return cls._is_cmake_arg_enabled("EXECUTORCH_BUILD_XNNPACK", default=False) - @classmethod - def coreml(cls) -> bool: - return cls._is_env_enabled("EXECUTORCH_BUILD_COREML", default=False) - @classmethod def training(cls) -> bool: return cls._is_cmake_arg_enabled( @@ -847,15 +843,6 @@ def get_ext_modules() -> List[Extension]: ] ) - if ShouldBuild.pybindings() or ShouldBuild.coreml(): - ext_modules.append( - BuiltExtension( - src="coreml_inmemoryfs_pybinding.*", - src_dir="backends/apple/coreml", - modpath="executorch.backends.apple.coreml.inmemoryfs", - ) - ) - if ShouldBuild.pybindings(): ext_modules.append( # Install the prebuilt pybindings extension wrapper for the runtime, From 8bd2588048e508b543368f6e4fdb89bff63bb741 Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 26 Mar 2025 09:11:04 -0700 Subject: [PATCH 07/11] add ci test --- .ci/scripts/test_model.sh | 9 ++++++--- .ci/scripts/wheel/test_macos.py | 14 ++++++-------- .github/workflows/build-wheels-linux.yml | 3 +++ .github/workflows/build-wheels-macos.yml | 17 ++++++++++++----- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index cd543ff1424..268584f138f 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -224,19 +224,22 @@ test_model_with_coreml() { "${PYTHON_EXECUTABLE}" -m examples.apple.coreml.scripts.export --model_name="${MODEL_NAME}" --compute_precision "${DTYPE}" EXPORTED_MODEL=$(find "." -type f -name "${MODEL_NAME}*.pte" -print -quit) - # TODO: + if [ -n "$EXPORTED_MODEL" ]; then EXPORTED_MODEL_WITH_DTYPE="${EXPORTED_MODEL%.pte}_${DTYPE}.pte" mv "$EXPORTED_MODEL" "$EXPORTED_MODEL_WITH_DTYPE" EXPORTED_MODEL="$EXPORTED_MODEL_WITH_DTYPE" - echo "Renamed file path: $EXPORTED_MODEL" + echo "OK exported model: $EXPORTED_MODEL" else - echo "No .pte file found" + echo "[error] failed to export model: no .pte file found" exit 1 fi # Run the model if [ "${should_test}" = true ]; then + echo "Installing requirements needed to build coreml_executor_runner..." + backends/apple/coreml/scripts/install_requirements.sh + echo "Testing exported model with coreml_executor_runner..." local out_dir=$(mktemp -d) COREML_EXECUTOR_RUNNER_OUT_DIR="${out_dir}" examples/apple/coreml/scripts/build_executor_runner.sh diff --git a/.ci/scripts/wheel/test_macos.py b/.ci/scripts/wheel/test_macos.py index cd4bce6c136..6be8c89adc8 100644 --- a/.ci/scripts/wheel/test_macos.py +++ b/.ci/scripts/wheel/test_macos.py @@ -11,15 +11,13 @@ if __name__ == "__main__": test_base.run_tests( model_tests=[ - test_base.ModelTest( - model=Model.Mv3, - backend=Backend.XnnpackQuantizationDelegation, - ), - # Enable this once CoreML is suppported out-of-the-box - # https://github.com/pytorch/executorch/issues/9019 # test_base.ModelTest( # model=Model.Mv3, - # backend=Backend.CoreMlTest, - # ) + # backend=Backend.XnnpackQuantizationDelegation, + # ), + test_base.ModelTest( + model=Model.Mv3, + backend=Backend.CoreMlTest, + ) ] ) diff --git a/.github/workflows/build-wheels-linux.yml b/.github/workflows/build-wheels-linux.yml index 62d8728b8a5..4c08968f3d6 100644 --- a/.github/workflows/build-wheels-linux.yml +++ b/.github/workflows/build-wheels-linux.yml @@ -6,6 +6,9 @@ on: paths: - .ci/**/* - .github/workflows/build-wheels-linux.yml + - examples/**/* + - pyproject.toml + - setup.py push: branches: - nightly diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index 490f01a46ca..32a1c3a9b6b 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -6,6 +6,9 @@ on: paths: - .ci/**/* - .github/workflows/build-wheels-macos.yml + - examples/**/* + - pyproject.toml + - setup.py push: branches: - nightly @@ -19,12 +22,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@jathu/fix-mac-miniconda with: package-type: wheel os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: jathu/fix-mac-miniconda with-cuda: disabled with-rocm: disabled python-versions: '["3.10", "3.11", "3.12"]' @@ -44,12 +47,12 @@ jobs: smoke-test-script: .ci/scripts/wheel/test_macos.py package-name: executorch name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main + uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@jathu/fix-mac-miniconda with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: jathu/fix-mac-miniconda build-matrix: ${{ needs.generate-matrix.outputs.matrix }} submodules: recursive delocate-wheel: false @@ -57,6 +60,10 @@ jobs: pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} - runner-type: macos-m1-stable + # Meta's macOS runners do not have Xcode, so use GitHub's runners. + runner-type: macos-latest-xlarge + setup-miniconda: true smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} + +# Attempt: 7 From 984dc14f689d472812ecb88a6007badf6b2bb666 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 26 Mar 2025 12:53:25 -0700 Subject: [PATCH 08/11] Update build-wheels-macos.yml to use macos-14-xlarge --- .github/workflows/build-wheels-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index 32a1c3a9b6b..9e11321860b 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -61,7 +61,7 @@ jobs: post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} # Meta's macOS runners do not have Xcode, so use GitHub's runners. - runner-type: macos-latest-xlarge + runner-type: macos-14-xlarge setup-miniconda: true smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} From 45bff15e41e96bee0a74617181e874d1752abfaa Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 26 Mar 2025 12:54:06 -0700 Subject: [PATCH 09/11] Update build-wheels-macos.yml to use test-infra main --- .github/workflows/build-wheels-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index 9e11321860b..fc931da8c21 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -52,7 +52,7 @@ jobs: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: jathu/fix-mac-miniconda + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} submodules: recursive delocate-wheel: false From 6a2370868e9f796cb5391861e5815663c56d1981 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 26 Mar 2025 12:54:57 -0700 Subject: [PATCH 10/11] Clean up --- .ci/scripts/test_model.sh | 4 ++-- .github/workflows/build-wheels-macos.yml | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index 268584f138f..eb4f7caefae 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -237,8 +237,8 @@ test_model_with_coreml() { # Run the model if [ "${should_test}" = true ]; then - echo "Installing requirements needed to build coreml_executor_runner..." - backends/apple/coreml/scripts/install_requirements.sh + # echo "Installing requirements needed to build coreml_executor_runner..." + # backends/apple/coreml/scripts/install_requirements.sh echo "Testing exported model with coreml_executor_runner..." local out_dir=$(mktemp -d) diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index fc931da8c21..3a394cff64b 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -22,12 +22,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@jathu/fix-mac-miniconda + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: wheel os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: jathu/fix-mac-miniconda + test-infra-ref: main with-cuda: disabled with-rocm: disabled python-versions: '["3.10", "3.11", "3.12"]' @@ -47,7 +47,7 @@ jobs: smoke-test-script: .ci/scripts/wheel/test_macos.py package-name: executorch name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@jathu/fix-mac-miniconda + uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main with: repository: ${{ matrix.repository }} ref: "" @@ -61,9 +61,7 @@ jobs: post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} # Meta's macOS runners do not have Xcode, so use GitHub's runners. - runner-type: macos-14-xlarge + runner-type: macos-latest-xlarge setup-miniconda: true smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} - -# Attempt: 7 From 5f3137d04044cb3d060475bbbd335a27bd6ddf66 Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 26 Mar 2025 13:49:53 -0700 Subject: [PATCH 11/11] clean up --- .ci/scripts/test_model.sh | 4 ++-- .ci/scripts/wheel/test_macos.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index eb4f7caefae..268584f138f 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -237,8 +237,8 @@ test_model_with_coreml() { # Run the model if [ "${should_test}" = true ]; then - # echo "Installing requirements needed to build coreml_executor_runner..." - # backends/apple/coreml/scripts/install_requirements.sh + echo "Installing requirements needed to build coreml_executor_runner..." + backends/apple/coreml/scripts/install_requirements.sh echo "Testing exported model with coreml_executor_runner..." local out_dir=$(mktemp -d) diff --git a/.ci/scripts/wheel/test_macos.py b/.ci/scripts/wheel/test_macos.py index 6be8c89adc8..e0a5342186b 100644 --- a/.ci/scripts/wheel/test_macos.py +++ b/.ci/scripts/wheel/test_macos.py @@ -11,13 +11,13 @@ if __name__ == "__main__": test_base.run_tests( model_tests=[ - # test_base.ModelTest( - # model=Model.Mv3, - # backend=Backend.XnnpackQuantizationDelegation, - # ), + test_base.ModelTest( + model=Model.Mv3, + backend=Backend.XnnpackQuantizationDelegation, + ), test_base.ModelTest( model=Model.Mv3, backend=Backend.CoreMlTest, - ) + ), ] )