From bf641c8d42ba30d63c8ab8424d2f7061482866f0 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 14:32:55 -0700 Subject: [PATCH 01/15] Add cmake Linux build and test job --- .ci/docker/conda-env-ci.txt | 1 + .ci/docker/requirements-ci.txt | 1 + .ci/scripts/test-cmake.sh | 38 ++++++++++++++++++++++++++++++++++ .ci/scripts/test.sh | 10 ++------- .ci/scripts/utils.sh | 10 +++++++++ .github/workflows/pull.yml | 18 ++++++++++++++++ 6 files changed, 70 insertions(+), 8 deletions(-) create mode 100755 .ci/scripts/test-cmake.sh create mode 100644 .ci/scripts/utils.sh diff --git a/.ci/docker/conda-env-ci.txt b/.ci/docker/conda-env-ci.txt index 467bac5e422..945958a6ed4 100644 --- a/.ci/docker/conda-env-ci.txt +++ b/.ci/docker/conda-env-ci.txt @@ -1,3 +1,4 @@ # TODO: We might need to update this to install flatbuffers from the pinned commit # in fbcode/executorch/third-party/flatbuffers.submodule.txt flatbuffers=2.0.0 +cmake=3.22.1 diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 88793b9498c..daea5048832 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -3,4 +3,5 @@ numpy==1.25.2 PyYAML==6.0.1 ruamel.yaml==0.17.32 sympy==1.12 +tomli==2.0.1 zstd==1.5.5.1 diff --git a/.ci/scripts/test-cmake.sh b/.ci/scripts/test-cmake.sh new file mode 100755 index 00000000000..40a06fce452 --- /dev/null +++ b/.ci/scripts/test-cmake.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +set -exu + +# shellcheck source=/dev/null +source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" + +build_and_test_executorch() { + CMAKE_OUTPUT_DIR=cmake-out + # Build executorch runtime using cmake + rm -rf "${CMAKE_OUTPUT_DIR}" && mkdir "${CMAKE_OUTPUT_DIR}" + + pushd "${CMAKE_OUTPUT_DIR}" + cmake -DBUCK2=buck2 .. + popd + + if [ "$(uname)" == "Darwin" ]; then + CMAKE_JOBS=$(( $(sysctl -n hw.ncpu) - 1 )) + else + CMAKE_JOBS=$(( $(nproc) - 1 )) + fi + cmake --build "${CMAKE_OUTPUT_DIR}" -j "${CMAKE_JOBS}" + + which python + # Export a test model + python -m examples.export.export_example --model_name="linear" + + # Run test model + ./"${CMAKE_OUTPUT_DIR}"/executor_runner -- --model_path ./linear.pte +} + +install_executorch +build_and_test_executorch diff --git a/.ci/scripts/test.sh b/.ci/scripts/test.sh index 89f274e1962..957d6b87ca2 100755 --- a/.ci/scripts/test.sh +++ b/.ci/scripts/test.sh @@ -7,14 +7,8 @@ set -exu -install_executorch() { - which pip - # Install executorch, this assumes that Executorch is checked out in the - # current directory - pip install . - # Just print out the list of packages for debugging - pip list -} +# shellcheck source=/dev/null +source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" build_and_test_executorch() { # Build executorch runtime diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh new file mode 100644 index 00000000000..40e2efb4533 --- /dev/null +++ b/.ci/scripts/utils.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +install_executorch() { + which pip + # Install executorch, this assumes that Executorch is checked out in the + # current directory + pip install . + # Just print out the list of packages for debugging + pip list +} diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index fc355e59b1e..2181b6aaee2 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -47,3 +47,21 @@ jobs: # Build and test Executorch bash .ci/scripts/test.sh popd + + cmake-build-test-linux: + name: cmake-build-test-linux + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + runner: linux.2xlarge + docker-image: executorch-ubuntu-22.04-clang12 + fetch-depth: 0 + submodules: 'true' + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + script: | + PYTHON_VERSION=3.10 + # TODO: Figure out why /opt/conda/envs/py_$PYTHON_VERSION/bin is not in the path + # here, as it's there in the container + export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}" + + # Build and test Executorch + bash .ci/scripts/test-cmake.sh From b6e43c3deaafc851eab734be783f9d054e109aa4 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 15:45:50 -0700 Subject: [PATCH 02/15] Debug new Linux job --- .github/workflows/pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 2181b6aaee2..64c5ac0b8c6 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -50,7 +50,7 @@ jobs: cmake-build-test-linux: name: cmake-build-test-linux - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@linux-job-mount-to-repo-name with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 From 61b22af70f12a2be4f668480efe67c9dc35f2bce Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 15:52:02 -0700 Subject: [PATCH 03/15] Debug cmake include path --- .github/workflows/pull.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 64c5ac0b8c6..596334c66c4 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -54,6 +54,7 @@ jobs: with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 + repository: executorch fetch-depth: 0 submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} From a8a28b1701e6535618ff35426d49955faffdb197 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 16:00:31 -0700 Subject: [PATCH 04/15] Debug Linux job --- .github/workflows/pull.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 596334c66c4..64c5ac0b8c6 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -54,7 +54,6 @@ jobs: with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 - repository: executorch fetch-depth: 0 submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} From f29fd8d2854488b431bc90cba7787c4f7daa5ee0 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 16:15:51 -0700 Subject: [PATCH 05/15] Debug --- .github/workflows/pull.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 64c5ac0b8c6..b4978ac9d8b 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -63,5 +63,6 @@ jobs: # here, as it's there in the container export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}" + echo "${REPOSITORY}" # Build and test Executorch bash .ci/scripts/test-cmake.sh From df86fd99b8884985ec3d858f8ef578c5d3e2d9aa Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 16:19:56 -0700 Subject: [PATCH 06/15] Set repo name explicitly --- .github/workflows/pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index b4978ac9d8b..d7089c31a12 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -54,6 +54,7 @@ jobs: with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 + repository: pytorch/executorch fetch-depth: 0 submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} @@ -63,6 +64,5 @@ jobs: # here, as it's there in the container export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}" - echo "${REPOSITORY}" # Build and test Executorch bash .ci/scripts/test-cmake.sh From b77f25315742675e0910f44001327d9a8220c5a3 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 16:25:06 -0700 Subject: [PATCH 07/15] Debug Linux job --- .github/workflows/pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index d7089c31a12..969a534fde4 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -54,8 +54,8 @@ jobs: with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 - repository: pytorch/executorch fetch-depth: 0 + test-infra-ref: linux-job-mount-to-repo-name submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: | From 3115847c7a138532ed3ef26cf353f7198ef73775 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 17:16:00 -0700 Subject: [PATCH 08/15] Debug cmake build --- .github/workflows/pull.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 969a534fde4..2181b6aaee2 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -50,12 +50,11 @@ jobs: cmake-build-test-linux: name: cmake-build-test-linux - uses: pytorch/test-infra/.github/workflows/linux_job.yml@linux-job-mount-to-repo-name + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-clang12 fetch-depth: 0 - test-infra-ref: linux-job-mount-to-repo-name submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: | From b8081ac21771ab539f7daaf314967227f3545bf6 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 18:10:24 -0700 Subject: [PATCH 09/15] Use LLD --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1387672f1e2..876268641e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,13 @@ add_subdirectory(third-party/flatbuffers) add_subdirectory(third-party/gflags) +# +# Use LLVM linker if possible +# +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + add_link_options("-fuse-ld=lld") +endif() + # # program_schema: Generated .h files from schema/*.fbs inputs # @@ -246,8 +253,7 @@ target_link_libraries(portable_kernels_bindings INTERFACE portable_kernels) # Ensure that the load-time constructor functions run. By default, the linker # would remove them since there are no other references to them. -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL - "AppleClang") +if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") target_link_options( portable_kernels_bindings INTERFACE @@ -256,8 +262,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL # once because it's in this list of args. See if there's a way to avoid # that. -Wl,-force_load,libportable_kernels_bindings.a) -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Using gcc +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # Using gcc/ld or clang/lld target_link_options( portable_kernels_bindings INTERFACE # TODO(dbort): This will cause the .a to show up on the link line twice From 6a3aa1bedf3bff07f7f5e2e2eb39f2566b597ea1 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 9 Aug 2023 18:22:21 -0700 Subject: [PATCH 10/15] Fix command param --- .ci/scripts/test-cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test-cmake.sh b/.ci/scripts/test-cmake.sh index 40a06fce452..59f11fa7fb3 100755 --- a/.ci/scripts/test-cmake.sh +++ b/.ci/scripts/test-cmake.sh @@ -31,7 +31,7 @@ build_and_test_executorch() { python -m examples.export.export_example --model_name="linear" # Run test model - ./"${CMAKE_OUTPUT_DIR}"/executor_runner -- --model_path ./linear.pte + ./"${CMAKE_OUTPUT_DIR}"/executor_runner --model_path ./linear.pte } install_executorch From 529bedd6154a135fb6cc75a19582b4e1871a945b Mon Sep 17 00:00:00 2001 From: Huy Do Date: Fri, 11 Aug 2023 15:57:06 -0700 Subject: [PATCH 11/15] Fix lint --- .ci/scripts/utils.sh | 5 +++++ CMakeLists.txt | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index 40e2efb4533..a14f16a6170 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. install_executorch() { which pip diff --git a/CMakeLists.txt b/CMakeLists.txt index f1d6d0c4cf6..38d63be9274 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,8 @@ add_subdirectory(third-party/gflags) # # Use LLVM linker if possible # -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") add_link_options("-fuse-ld=lld") endif() From f5f81d02bebd79bcd0712a35389f635ae5389106 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Fri, 11 Aug 2023 16:39:28 -0700 Subject: [PATCH 12/15] Use gcc_kernel_link_options --- CMakeLists.txt | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38d63be9274..5630eb0c562 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,14 +123,6 @@ add_subdirectory(third-party/flatbuffers) add_subdirectory(third-party/gflags) -# -# Use LLVM linker if possible -# -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" - AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - add_link_options("-fuse-ld=lld") -endif() - # # program_schema: Generated .h files from schema/*.fbs inputs # @@ -266,20 +258,9 @@ target_link_libraries(portable_kernels_bindings PRIVATE executorch) target_link_libraries(portable_kernels_bindings INTERFACE portable_kernels) # Ensure that the load-time constructor functions run. By default, the linker -# would remove them since there are no other references to them. -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL - "AppleClang") - if(CMAKE_TOOLCHAIN_FILE MATCHES ".*android\.toolchain\.cmake$") - # For Android tool chain - gcc_kernel_link_options(portable_kernels_bindings) - else() - # For host tool chain - clang_kernel_link_options(portable_kernels_bindings) - endif() -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Using gcc - gcc_kernel_link_options(portable_kernels_bindings) -endif() +# would remove them since there are no other references to them. The --whole-archive +# linker option works with both GNU ld and LLVM LLD +gcc_kernel_link_options(portable_kernels_bindings) # # executor_runner: A simple commandline tool that loads and runs a program file. From 8e07adf5951bb95ec6464ef1d67eb782562ce5e0 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Mon, 14 Aug 2023 12:14:11 -0700 Subject: [PATCH 13/15] Address review comments --- .ci/scripts/test-cmake.sh | 15 ++++++++++----- .ci/scripts/test.sh | 14 ++++++++++---- CMakeLists.txt | 5 ++--- build/Utils.cmake | 16 ++-------------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.ci/scripts/test-cmake.sh b/.ci/scripts/test-cmake.sh index 59f11fa7fb3..975e7aa016e 100755 --- a/.ci/scripts/test-cmake.sh +++ b/.ci/scripts/test-cmake.sh @@ -10,6 +10,14 @@ set -exu # shellcheck source=/dev/null source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" +test_model() { + MODEL_NAME=$1 + python -m examples.export.export_example --model_name="${MODEL_NAME}" + + # Run test model + ./"${CMAKE_OUTPUT_DIR}"/executor_runner --model_path "./${MODEL_NAME}.pte" +} + build_and_test_executorch() { CMAKE_OUTPUT_DIR=cmake-out # Build executorch runtime using cmake @@ -27,11 +35,8 @@ build_and_test_executorch() { cmake --build "${CMAKE_OUTPUT_DIR}" -j "${CMAKE_JOBS}" which python - # Export a test model - python -m examples.export.export_example --model_name="linear" - - # Run test model - ./"${CMAKE_OUTPUT_DIR}"/executor_runner --model_path ./linear.pte + # Test the example linear model + test_model "linear" } install_executorch diff --git a/.ci/scripts/test.sh b/.ci/scripts/test.sh index 957d6b87ca2..53569342c56 100755 --- a/.ci/scripts/test.sh +++ b/.ci/scripts/test.sh @@ -10,15 +10,21 @@ set -exu # shellcheck source=/dev/null source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" +test_model() { + MODEL_NAME=$1 + python -m examples.export.export_example --model_name="${MODEL_NAME}" + + # Run test model + buck2 run //examples/executor_runner:executor_runner -- --model_path "./${MODEL_NAME}.pte" +} + build_and_test_executorch() { # Build executorch runtime buck2 build //examples/executor_runner:executor_runner which python - # Export a test model - python -m examples.export.export_example --model_name="linear" - # Run test model - buck2 run //examples/executor_runner:executor_runner -- --model_path ./linear.pte + # Test the example linear model + test_model "linear" } install_executorch diff --git a/CMakeLists.txt b/CMakeLists.txt index 5630eb0c562..62402eca3a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,9 +258,8 @@ target_link_libraries(portable_kernels_bindings PRIVATE executorch) target_link_libraries(portable_kernels_bindings INTERFACE portable_kernels) # Ensure that the load-time constructor functions run. By default, the linker -# would remove them since there are no other references to them. The --whole-archive -# linker option works with both GNU ld and LLVM LLD -gcc_kernel_link_options(portable_kernels_bindings) +# would remove them since there are no other references to them. +kernel_link_options(portable_kernels_bindings) # # executor_runner: A simple commandline tool that loads and runs a program file. diff --git a/build/Utils.cmake b/build/Utils.cmake index 09446bf4d69..fdaf6ab77f0 100644 --- a/build/Utils.cmake +++ b/build/Utils.cmake @@ -22,20 +22,8 @@ function(executorch_print_configuration_summary) message(STATUS " REGISTER_EXAMPLE_CUSTOM_OPS : ${REGISTER_EXAMPLE_CUSTOM_OPS}") endfunction() -# This is the funtion to use -Wl to link static library, used for clang -function(clang_kernel_link_options target_name) - target_link_options(${target_name} - INTERFACE - # TODO(dbort): This will cause the .a to show up on the link line twice - # for targets that depend on this library; once because CMake will add - # it, and once because it's in this list of args. See if there's a way - # to avoid that. - -Wl,$ - ) -endfunction() - -# This is the funtion to use -Wl, --whole-archive to link static library, used for gcc -function(gcc_kernel_link_options target_name) +# This is the funtion to use -Wl, --whole-archive to link static library +function(kernel_link_options target_name) target_link_options(${target_name} INTERFACE # TODO(dbort): This will cause the .a to show up on the link line twice From 801a3ea35cddb222a342acfeabe2384c73303627 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Tue, 15 Aug 2023 15:32:58 -0700 Subject: [PATCH 14/15] Address review comments --- examples/custom_ops/CMakeLists.txt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/custom_ops/CMakeLists.txt b/examples/custom_ops/CMakeLists.txt index c5b39bc257f..930e1196d62 100644 --- a/examples/custom_ops/CMakeLists.txt +++ b/examples/custom_ops/CMakeLists.txt @@ -31,6 +31,9 @@ endif() if(NOT TORCH_ROOT) set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch) endif() + +include(${EXECUTORCH_ROOT}/build/Utils.cmake) + # Command to generate selected_operators.yaml from custom_ops.yaml. set(_oplist_yaml ${CMAKE_CURRENT_BINARY_DIR}/selected_operators.yaml) file(GLOB_RECURSE _codegen_tools_srcs "${EXECUTORCH_ROOT}/codegen/tools/*.py") @@ -107,16 +110,7 @@ if(REGISTER_EXAMPLE_CUSTOM_OP_2) # Ensure that the load-time constructor functions run. By default, the linker # would remove them since there are no other references to them. - if((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") - OR (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - target_link_options(custom_ops_aot_lib INTERFACE - "-Wl,-force_load,$") - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - target_link_options( - custom_ops_aot_lib INTERFACE - "-Wl,--whole-archive,$,--no-whole-archive" - ) - endif() + kernel_link_options("custom_ops_aot_lib") endif() # 1. C++ library to register custom ops into Executorch runtime. From e685bc2aacd3a6e017a00f30beb432c61e1d6e8e Mon Sep 17 00:00:00 2001 From: Huy Do Date: Tue, 15 Aug 2023 17:19:46 -0700 Subject: [PATCH 15/15] Run test_custom_ops.sh --- .github/workflows/pull.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 2181b6aaee2..be48eb181d6 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -30,6 +30,9 @@ jobs: # Build and test Executorch bash .ci/scripts/test.sh + # Test custom ops + bash examples/custom_ops/test_custom_ops.sh + buck-build-test-macos: name: buck-build-test-macos uses: pytorch/test-infra/.github/workflows/macos_job.yml@main