From 948e682514d4dce092e04b6582246cb49045868d Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 12 Mar 2025 08:53:53 -0700 Subject: [PATCH 1/4] Move build cmake files out of top-level build folder --- backends/cadence/CMakeLists.txt | 2 +- backends/cadence/fusion_g3/operators/CMakeLists.txt | 2 +- backends/cadence/hifi/operators/CMakeLists.txt | 2 +- backends/cadence/reference/operators/CMakeLists.txt | 2 +- configurations/CMakeLists.txt | 2 +- docs/source/kernel-library-selective-build.md | 2 +- examples/apple/mps/CMakeLists.txt | 2 +- examples/arm/CMakeLists.txt | 2 +- examples/devtools/CMakeLists.txt | 2 +- examples/mediatek/CMakeLists.txt | 2 +- examples/models/llama/runner/CMakeLists.txt | 2 +- examples/models/llava/runner/CMakeLists.txt | 2 +- examples/portable/custom_ops/CMakeLists.txt | 2 +- examples/qualcomm/CMakeLists.txt | 2 +- examples/selective_build/CMakeLists.txt | 2 +- extension/llm/custom_ops/CMakeLists.txt | 2 +- extension/llm/runner/CMakeLists.txt | 2 +- kernels/optimized/CMakeLists.txt | 2 +- kernels/portable/CMakeLists.txt | 2 +- kernels/quantized/CMakeLists.txt | 2 +- {build => util/build}/Codegen.cmake | 0 21 files changed, 20 insertions(+), 20 deletions(-) rename {build => util/build}/Codegen.cmake (100%) diff --git a/backends/cadence/CMakeLists.txt b/backends/cadence/CMakeLists.txt index 65dd5430588..64181685eba 100644 --- a/backends/cadence/CMakeLists.txt +++ b/backends/cadence/CMakeLists.txt @@ -28,7 +28,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/.. add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS) if(EXECUTORCH_CADENCE_CPU_RUNNER) - include(${EXECUTORCH_ROOT}/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/fusion_g3/operators/CMakeLists.txt b/backends/cadence/fusion_g3/operators/CMakeLists.txt index f39614ee4f3..995eaf5063a 100644 --- a/backends/cadence/fusion_g3/operators/CMakeLists.txt +++ b/backends/cadence/fusion_g3/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/hifi/operators/CMakeLists.txt b/backends/cadence/hifi/operators/CMakeLists.txt index 28b3c3b6aca..83f618ee918 100644 --- a/backends/cadence/hifi/operators/CMakeLists.txt +++ b/backends/cadence/hifi/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/reference/operators/CMakeLists.txt b/backends/cadence/reference/operators/CMakeLists.txt index 69a104277fd..9c81d65830c 100644 --- a/backends/cadence/reference/operators/CMakeLists.txt +++ b/backends/cadence/reference/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index cf304d92523..672534f04b9 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) # Merge optimized and portable definitions, taking optimized where available. diff --git a/docs/source/kernel-library-selective-build.md b/docs/source/kernel-library-selective-build.md index 1a7562942e0..979210938b7 100644 --- a/docs/source/kernel-library-selective-build.md +++ b/docs/source/kernel-library-selective-build.md @@ -36,7 +36,7 @@ The basic flow looks like this: ## APIs -We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/build/Codegen.cmake#L12)`, to allow users specifying op info: +We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/util/build/Codegen.cmake#L12)`, to allow users specifying op info: ``` gen_selected_ops( diff --git a/examples/apple/mps/CMakeLists.txt b/examples/apple/mps/CMakeLists.txt index 319d8159ced..f9c5fc868a4 100644 --- a/examples/apple/mps/CMakeLists.txt +++ b/examples/apple/mps/CMakeLists.txt @@ -63,7 +63,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$") # portable_ops_lib include(${EXECUTORCH_ROOT}/build/Utils.cmake) - include(${EXECUTORCH_ROOT}/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) gen_selected_ops(LIB_NAME "mps_portable_ops_lib" INCLUDE_ALL_OPS "ON") generate_bindings_for_kernels( LIB_NAME "mps_portable_ops_lib" FUNCTIONS_YAML diff --git a/examples/arm/CMakeLists.txt b/examples/arm/CMakeLists.txt index 0c754beaaaf..ef9036fa935 100644 --- a/examples/arm/CMakeLists.txt +++ b/examples/arm/CMakeLists.txt @@ -36,7 +36,7 @@ find_package(executorch CONFIG REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}) target_include_directories(executorch INTERFACE ${_common_include_directories}) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # Generate C++ bindings to register kernels into both PyTorch (for AOT) and # Executorch (for runtime). Here select all ops in functions.yaml diff --git a/examples/devtools/CMakeLists.txt b/examples/devtools/CMakeLists.txt index 7ed5232ba41..fa38e2b47da 100644 --- a/examples/devtools/CMakeLists.txt +++ b/examples/devtools/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/mediatek/CMakeLists.txt b/examples/mediatek/CMakeLists.txt index 826a2c17fa0..f5dcc525030 100644 --- a/examples/mediatek/CMakeLists.txt +++ b/examples/mediatek/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/models/llama/runner/CMakeLists.txt b/examples/models/llama/runner/CMakeLists.txt index b707f385f33..bc29494f078 100644 --- a/examples/models/llama/runner/CMakeLists.txt +++ b/examples/models/llama/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/examples/models/llava/runner/CMakeLists.txt b/examples/models/llava/runner/CMakeLists.txt index 2d0c30a620e..113931b3d25 100644 --- a/examples/models/llava/runner/CMakeLists.txt +++ b/examples/models/llava/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # Let files say "include ". set(_common_include_directories ${EXECUTORCH_ROOT}/..) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index 02736cca964..f43d34f10fa 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/qualcomm/CMakeLists.txt b/examples/qualcomm/CMakeLists.txt index 0a46c061b64..c7a581cf3dd 100644 --- a/examples/qualcomm/CMakeLists.txt +++ b/examples/qualcomm/CMakeLists.txt @@ -16,7 +16,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index c2ce3f09e7a..35eeabe9a14 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -22,7 +22,7 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index eeb118d4344..dcc8594c42c 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations -fPIC) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/extension/llm/runner/CMakeLists.txt b/extension/llm/runner/CMakeLists.txt index a9245768b9d..63ff65a15c1 100644 --- a/extension/llm/runner/CMakeLists.txt +++ b/extension/llm/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 23e26bfa72b..3f87e400a24 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -34,7 +34,7 @@ list(APPEND _common_compile_options -DET_BUILD_WITH_BLAS) # compiling for avx2 for now punting this to come back include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/portable/CMakeLists.txt b/kernels/portable/CMakeLists.txt index e15970329c1..df917067a3b 100644 --- a/kernels/portable/CMakeLists.txt +++ b/kernels/portable/CMakeLists.txt @@ -24,7 +24,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/quantized/CMakeLists.txt b/kernels/quantized/CMakeLists.txt index 6b01ba4fc27..9d88898761f 100644 --- a/kernels/quantized/CMakeLists.txt +++ b/kernels/quantized/CMakeLists.txt @@ -27,7 +27,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/build/Codegen.cmake b/util/build/Codegen.cmake similarity index 100% rename from build/Codegen.cmake rename to util/build/Codegen.cmake From a374c29e1426c26f606124db165028c305fde86c Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 12 Mar 2025 15:55:36 -0700 Subject: [PATCH 2/4] util/build -> script/build --- backends/cadence/CMakeLists.txt | 2 +- backends/cadence/fusion_g3/operators/CMakeLists.txt | 2 +- backends/cadence/hifi/operators/CMakeLists.txt | 2 +- backends/cadence/reference/operators/CMakeLists.txt | 2 +- configurations/CMakeLists.txt | 2 +- docs/source/kernel-library-selective-build.md | 2 +- examples/apple/mps/CMakeLists.txt | 2 +- examples/arm/CMakeLists.txt | 2 +- examples/devtools/CMakeLists.txt | 2 +- examples/mediatek/CMakeLists.txt | 2 +- examples/models/llama/runner/CMakeLists.txt | 2 +- examples/models/llava/runner/CMakeLists.txt | 2 +- examples/portable/custom_ops/CMakeLists.txt | 2 +- examples/qualcomm/CMakeLists.txt | 2 +- examples/selective_build/CMakeLists.txt | 2 +- extension/llm/custom_ops/CMakeLists.txt | 2 +- extension/llm/runner/CMakeLists.txt | 2 +- kernels/optimized/CMakeLists.txt | 2 +- kernels/portable/CMakeLists.txt | 2 +- kernels/quantized/CMakeLists.txt | 2 +- {util => scripts}/build/Codegen.cmake | 0 21 files changed, 20 insertions(+), 20 deletions(-) rename {util => scripts}/build/Codegen.cmake (100%) diff --git a/backends/cadence/CMakeLists.txt b/backends/cadence/CMakeLists.txt index 64181685eba..60832108012 100644 --- a/backends/cadence/CMakeLists.txt +++ b/backends/cadence/CMakeLists.txt @@ -28,7 +28,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/.. add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS) if(EXECUTORCH_CADENCE_CPU_RUNNER) - include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/fusion_g3/operators/CMakeLists.txt b/backends/cadence/fusion_g3/operators/CMakeLists.txt index 995eaf5063a..8070f13df1a 100644 --- a/backends/cadence/fusion_g3/operators/CMakeLists.txt +++ b/backends/cadence/fusion_g3/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/hifi/operators/CMakeLists.txt b/backends/cadence/hifi/operators/CMakeLists.txt index 83f618ee918..cd6d548fe53 100644 --- a/backends/cadence/hifi/operators/CMakeLists.txt +++ b/backends/cadence/hifi/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/reference/operators/CMakeLists.txt b/backends/cadence/reference/operators/CMakeLists.txt index 9c81d65830c..12aaf54d4a4 100644 --- a/backends/cadence/reference/operators/CMakeLists.txt +++ b/backends/cadence/reference/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index 672534f04b9..bd730b570a7 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) # Merge optimized and portable definitions, taking optimized where available. diff --git a/docs/source/kernel-library-selective-build.md b/docs/source/kernel-library-selective-build.md index 979210938b7..857d777c5b0 100644 --- a/docs/source/kernel-library-selective-build.md +++ b/docs/source/kernel-library-selective-build.md @@ -36,7 +36,7 @@ The basic flow looks like this: ## APIs -We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/util/build/Codegen.cmake#L12)`, to allow users specifying op info: +We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/script/build/Codegen.cmake#L12)`, to allow users specifying op info: ``` gen_selected_ops( diff --git a/examples/apple/mps/CMakeLists.txt b/examples/apple/mps/CMakeLists.txt index f9c5fc868a4..4b573f05461 100644 --- a/examples/apple/mps/CMakeLists.txt +++ b/examples/apple/mps/CMakeLists.txt @@ -63,7 +63,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$") # portable_ops_lib include(${EXECUTORCH_ROOT}/build/Utils.cmake) - include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) gen_selected_ops(LIB_NAME "mps_portable_ops_lib" INCLUDE_ALL_OPS "ON") generate_bindings_for_kernels( LIB_NAME "mps_portable_ops_lib" FUNCTIONS_YAML diff --git a/examples/arm/CMakeLists.txt b/examples/arm/CMakeLists.txt index ef9036fa935..34b079ff401 100644 --- a/examples/arm/CMakeLists.txt +++ b/examples/arm/CMakeLists.txt @@ -36,7 +36,7 @@ find_package(executorch CONFIG REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}) target_include_directories(executorch INTERFACE ${_common_include_directories}) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) # Generate C++ bindings to register kernels into both PyTorch (for AOT) and # Executorch (for runtime). Here select all ops in functions.yaml diff --git a/examples/devtools/CMakeLists.txt b/examples/devtools/CMakeLists.txt index fa38e2b47da..20d24ff8789 100644 --- a/examples/devtools/CMakeLists.txt +++ b/examples/devtools/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/mediatek/CMakeLists.txt b/examples/mediatek/CMakeLists.txt index f5dcc525030..fe513f30e2f 100644 --- a/examples/mediatek/CMakeLists.txt +++ b/examples/mediatek/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/models/llama/runner/CMakeLists.txt b/examples/models/llama/runner/CMakeLists.txt index bc29494f078..9a5c60d7db2 100644 --- a/examples/models/llama/runner/CMakeLists.txt +++ b/examples/models/llama/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/examples/models/llava/runner/CMakeLists.txt b/examples/models/llava/runner/CMakeLists.txt index 113931b3d25..dcb60da6975 100644 --- a/examples/models/llava/runner/CMakeLists.txt +++ b/examples/models/llava/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) # Let files say "include ". set(_common_include_directories ${EXECUTORCH_ROOT}/..) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index f43d34f10fa..ece8a55ce91 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/qualcomm/CMakeLists.txt b/examples/qualcomm/CMakeLists.txt index c7a581cf3dd..c9b7cfae424 100644 --- a/examples/qualcomm/CMakeLists.txt +++ b/examples/qualcomm/CMakeLists.txt @@ -16,7 +16,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index 35eeabe9a14..ebbc8ecb8ff 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -22,7 +22,7 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index dcc8594c42c..0cb9e63dfa7 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations -fPIC) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/extension/llm/runner/CMakeLists.txt b/extension/llm/runner/CMakeLists.txt index 63ff65a15c1..49f0beda7ec 100644 --- a/extension/llm/runner/CMakeLists.txt +++ b/extension/llm/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 3f87e400a24..5a0506125c7 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -34,7 +34,7 @@ list(APPEND _common_compile_options -DET_BUILD_WITH_BLAS) # compiling for avx2 for now punting this to come back include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/portable/CMakeLists.txt b/kernels/portable/CMakeLists.txt index df917067a3b..7fe785c5566 100644 --- a/kernels/portable/CMakeLists.txt +++ b/kernels/portable/CMakeLists.txt @@ -24,7 +24,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/quantized/CMakeLists.txt b/kernels/quantized/CMakeLists.txt index 9d88898761f..ce4a6af6121 100644 --- a/kernels/quantized/CMakeLists.txt +++ b/kernels/quantized/CMakeLists.txt @@ -27,7 +27,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/util/build/Codegen.cmake b/scripts/build/Codegen.cmake similarity index 100% rename from util/build/Codegen.cmake rename to scripts/build/Codegen.cmake From bf2d1591d9fd93935999735bbb3ffde8e0697f21 Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 12 Mar 2025 15:56:06 -0700 Subject: [PATCH 3/4] Revert "util/build -> script/build" This reverts commit 232c5937e93274c5e0e48ccc82b82402cca8cb96. --- backends/cadence/CMakeLists.txt | 2 +- backends/cadence/fusion_g3/operators/CMakeLists.txt | 2 +- backends/cadence/hifi/operators/CMakeLists.txt | 2 +- backends/cadence/reference/operators/CMakeLists.txt | 2 +- configurations/CMakeLists.txt | 2 +- docs/source/kernel-library-selective-build.md | 2 +- examples/apple/mps/CMakeLists.txt | 2 +- examples/arm/CMakeLists.txt | 2 +- examples/devtools/CMakeLists.txt | 2 +- examples/mediatek/CMakeLists.txt | 2 +- examples/models/llama/runner/CMakeLists.txt | 2 +- examples/models/llava/runner/CMakeLists.txt | 2 +- examples/portable/custom_ops/CMakeLists.txt | 2 +- examples/qualcomm/CMakeLists.txt | 2 +- examples/selective_build/CMakeLists.txt | 2 +- extension/llm/custom_ops/CMakeLists.txt | 2 +- extension/llm/runner/CMakeLists.txt | 2 +- kernels/optimized/CMakeLists.txt | 2 +- kernels/portable/CMakeLists.txt | 2 +- kernels/quantized/CMakeLists.txt | 2 +- {scripts => util}/build/Codegen.cmake | 0 21 files changed, 20 insertions(+), 20 deletions(-) rename {scripts => util}/build/Codegen.cmake (100%) diff --git a/backends/cadence/CMakeLists.txt b/backends/cadence/CMakeLists.txt index 60832108012..64181685eba 100644 --- a/backends/cadence/CMakeLists.txt +++ b/backends/cadence/CMakeLists.txt @@ -28,7 +28,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/.. add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS) if(EXECUTORCH_CADENCE_CPU_RUNNER) - include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/fusion_g3/operators/CMakeLists.txt b/backends/cadence/fusion_g3/operators/CMakeLists.txt index 8070f13df1a..995eaf5063a 100644 --- a/backends/cadence/fusion_g3/operators/CMakeLists.txt +++ b/backends/cadence/fusion_g3/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/hifi/operators/CMakeLists.txt b/backends/cadence/hifi/operators/CMakeLists.txt index cd6d548fe53..83f618ee918 100644 --- a/backends/cadence/hifi/operators/CMakeLists.txt +++ b/backends/cadence/hifi/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/reference/operators/CMakeLists.txt b/backends/cadence/reference/operators/CMakeLists.txt index 12aaf54d4a4..9c81d65830c 100644 --- a/backends/cadence/reference/operators/CMakeLists.txt +++ b/backends/cadence/reference/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index bd730b570a7..672534f04b9 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) # Merge optimized and portable definitions, taking optimized where available. diff --git a/docs/source/kernel-library-selective-build.md b/docs/source/kernel-library-selective-build.md index 857d777c5b0..979210938b7 100644 --- a/docs/source/kernel-library-selective-build.md +++ b/docs/source/kernel-library-selective-build.md @@ -36,7 +36,7 @@ The basic flow looks like this: ## APIs -We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/script/build/Codegen.cmake#L12)`, to allow users specifying op info: +We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/util/build/Codegen.cmake#L12)`, to allow users specifying op info: ``` gen_selected_ops( diff --git a/examples/apple/mps/CMakeLists.txt b/examples/apple/mps/CMakeLists.txt index 4b573f05461..f9c5fc868a4 100644 --- a/examples/apple/mps/CMakeLists.txt +++ b/examples/apple/mps/CMakeLists.txt @@ -63,7 +63,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$") # portable_ops_lib include(${EXECUTORCH_ROOT}/build/Utils.cmake) - include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) gen_selected_ops(LIB_NAME "mps_portable_ops_lib" INCLUDE_ALL_OPS "ON") generate_bindings_for_kernels( LIB_NAME "mps_portable_ops_lib" FUNCTIONS_YAML diff --git a/examples/arm/CMakeLists.txt b/examples/arm/CMakeLists.txt index 34b079ff401..ef9036fa935 100644 --- a/examples/arm/CMakeLists.txt +++ b/examples/arm/CMakeLists.txt @@ -36,7 +36,7 @@ find_package(executorch CONFIG REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}) target_include_directories(executorch INTERFACE ${_common_include_directories}) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # Generate C++ bindings to register kernels into both PyTorch (for AOT) and # Executorch (for runtime). Here select all ops in functions.yaml diff --git a/examples/devtools/CMakeLists.txt b/examples/devtools/CMakeLists.txt index 20d24ff8789..fa38e2b47da 100644 --- a/examples/devtools/CMakeLists.txt +++ b/examples/devtools/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/mediatek/CMakeLists.txt b/examples/mediatek/CMakeLists.txt index fe513f30e2f..f5dcc525030 100644 --- a/examples/mediatek/CMakeLists.txt +++ b/examples/mediatek/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/models/llama/runner/CMakeLists.txt b/examples/models/llama/runner/CMakeLists.txt index 9a5c60d7db2..bc29494f078 100644 --- a/examples/models/llama/runner/CMakeLists.txt +++ b/examples/models/llama/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/examples/models/llava/runner/CMakeLists.txt b/examples/models/llava/runner/CMakeLists.txt index dcb60da6975..113931b3d25 100644 --- a/examples/models/llava/runner/CMakeLists.txt +++ b/examples/models/llava/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # Let files say "include ". set(_common_include_directories ${EXECUTORCH_ROOT}/..) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index ece8a55ce91..f43d34f10fa 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/qualcomm/CMakeLists.txt b/examples/qualcomm/CMakeLists.txt index c9b7cfae424..c7a581cf3dd 100644 --- a/examples/qualcomm/CMakeLists.txt +++ b/examples/qualcomm/CMakeLists.txt @@ -16,7 +16,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index ebbc8ecb8ff..35eeabe9a14 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -22,7 +22,7 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index 0cb9e63dfa7..dcc8594c42c 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations -fPIC) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/extension/llm/runner/CMakeLists.txt b/extension/llm/runner/CMakeLists.txt index 49f0beda7ec..63ff65a15c1 100644 --- a/extension/llm/runner/CMakeLists.txt +++ b/extension/llm/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 5a0506125c7..3f87e400a24 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -34,7 +34,7 @@ list(APPEND _common_compile_options -DET_BUILD_WITH_BLAS) # compiling for avx2 for now punting this to come back include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/portable/CMakeLists.txt b/kernels/portable/CMakeLists.txt index 7fe785c5566..df917067a3b 100644 --- a/kernels/portable/CMakeLists.txt +++ b/kernels/portable/CMakeLists.txt @@ -24,7 +24,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/quantized/CMakeLists.txt b/kernels/quantized/CMakeLists.txt index ce4a6af6121..9d88898761f 100644 --- a/kernels/quantized/CMakeLists.txt +++ b/kernels/quantized/CMakeLists.txt @@ -27,7 +27,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/script/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/scripts/build/Codegen.cmake b/util/build/Codegen.cmake similarity index 100% rename from scripts/build/Codegen.cmake rename to util/build/Codegen.cmake From 3061b7c440ef999a38721ec89670172422a14c91 Mon Sep 17 00:00:00 2001 From: jathu Date: Wed, 12 Mar 2025 15:56:49 -0700 Subject: [PATCH 4/4] util/build -> scripts/build --- backends/cadence/CMakeLists.txt | 2 +- backends/cadence/fusion_g3/operators/CMakeLists.txt | 2 +- backends/cadence/hifi/operators/CMakeLists.txt | 2 +- backends/cadence/reference/operators/CMakeLists.txt | 2 +- configurations/CMakeLists.txt | 2 +- docs/source/kernel-library-selective-build.md | 2 +- examples/apple/mps/CMakeLists.txt | 2 +- examples/arm/CMakeLists.txt | 2 +- examples/devtools/CMakeLists.txt | 2 +- examples/mediatek/CMakeLists.txt | 2 +- examples/models/llama/runner/CMakeLists.txt | 2 +- examples/models/llava/runner/CMakeLists.txt | 2 +- examples/portable/custom_ops/CMakeLists.txt | 2 +- examples/qualcomm/CMakeLists.txt | 2 +- examples/selective_build/CMakeLists.txt | 2 +- extension/llm/custom_ops/CMakeLists.txt | 2 +- extension/llm/runner/CMakeLists.txt | 2 +- kernels/optimized/CMakeLists.txt | 2 +- kernels/portable/CMakeLists.txt | 2 +- kernels/quantized/CMakeLists.txt | 2 +- {util => scripts}/build/Codegen.cmake | 0 21 files changed, 20 insertions(+), 20 deletions(-) rename {util => scripts}/build/Codegen.cmake (100%) diff --git a/backends/cadence/CMakeLists.txt b/backends/cadence/CMakeLists.txt index 64181685eba..a96d38e5141 100644 --- a/backends/cadence/CMakeLists.txt +++ b/backends/cadence/CMakeLists.txt @@ -28,7 +28,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/.. add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS) if(EXECUTORCH_CADENCE_CPU_RUNNER) - include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/fusion_g3/operators/CMakeLists.txt b/backends/cadence/fusion_g3/operators/CMakeLists.txt index 995eaf5063a..b3dbcae4135 100644 --- a/backends/cadence/fusion_g3/operators/CMakeLists.txt +++ b/backends/cadence/fusion_g3/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/hifi/operators/CMakeLists.txt b/backends/cadence/hifi/operators/CMakeLists.txt index 83f618ee918..36469dc92e7 100644 --- a/backends/cadence/hifi/operators/CMakeLists.txt +++ b/backends/cadence/hifi/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/backends/cadence/reference/operators/CMakeLists.txt b/backends/cadence/reference/operators/CMakeLists.txt index 9c81d65830c..7d213a12813 100644 --- a/backends/cadence/reference/operators/CMakeLists.txt +++ b/backends/cadence/reference/operators/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index 672534f04b9..5279ffa566c 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) # Merge optimized and portable definitions, taking optimized where available. diff --git a/docs/source/kernel-library-selective-build.md b/docs/source/kernel-library-selective-build.md index 979210938b7..fe2d53c8be8 100644 --- a/docs/source/kernel-library-selective-build.md +++ b/docs/source/kernel-library-selective-build.md @@ -36,7 +36,7 @@ The basic flow looks like this: ## APIs -We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/util/build/Codegen.cmake#L12)`, to allow users specifying op info: +We expose a CMake macro `[gen_selected_ops](https://github.com/pytorch/executorch/blob/main/scripts/build/Codegen.cmake#L12)`, to allow users specifying op info: ``` gen_selected_ops( diff --git a/examples/apple/mps/CMakeLists.txt b/examples/apple/mps/CMakeLists.txt index f9c5fc868a4..e88bcc90781 100644 --- a/examples/apple/mps/CMakeLists.txt +++ b/examples/apple/mps/CMakeLists.txt @@ -63,7 +63,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$") # portable_ops_lib include(${EXECUTORCH_ROOT}/build/Utils.cmake) - include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) + include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) gen_selected_ops(LIB_NAME "mps_portable_ops_lib" INCLUDE_ALL_OPS "ON") generate_bindings_for_kernels( LIB_NAME "mps_portable_ops_lib" FUNCTIONS_YAML diff --git a/examples/arm/CMakeLists.txt b/examples/arm/CMakeLists.txt index ef9036fa935..2f8055ce5e9 100644 --- a/examples/arm/CMakeLists.txt +++ b/examples/arm/CMakeLists.txt @@ -36,7 +36,7 @@ find_package(executorch CONFIG REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}) target_include_directories(executorch INTERFACE ${_common_include_directories}) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) # Generate C++ bindings to register kernels into both PyTorch (for AOT) and # Executorch (for runtime). Here select all ops in functions.yaml diff --git a/examples/devtools/CMakeLists.txt b/examples/devtools/CMakeLists.txt index fa38e2b47da..9319135f8e9 100644 --- a/examples/devtools/CMakeLists.txt +++ b/examples/devtools/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/mediatek/CMakeLists.txt b/examples/mediatek/CMakeLists.txt index f5dcc525030..d8e2a5bf667 100644 --- a/examples/mediatek/CMakeLists.txt +++ b/examples/mediatek/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/models/llama/runner/CMakeLists.txt b/examples/models/llama/runner/CMakeLists.txt index bc29494f078..919bc356551 100644 --- a/examples/models/llama/runner/CMakeLists.txt +++ b/examples/models/llama/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/examples/models/llava/runner/CMakeLists.txt b/examples/models/llava/runner/CMakeLists.txt index 113931b3d25..7bad4a827ae 100644 --- a/examples/models/llava/runner/CMakeLists.txt +++ b/examples/models/llava/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) # Let files say "include ". set(_common_include_directories ${EXECUTORCH_ROOT}/..) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index f43d34f10fa..9d165d342d0 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/qualcomm/CMakeLists.txt b/examples/qualcomm/CMakeLists.txt index c7a581cf3dd..c8946f63a6b 100644 --- a/examples/qualcomm/CMakeLists.txt +++ b/examples/qualcomm/CMakeLists.txt @@ -16,7 +16,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index 35eeabe9a14..6647f0a62b4 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -22,7 +22,7 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) set(TORCH_ROOT ${EXECUTORCH_ROOT}/third-party/pytorch) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index dcc8594c42c..6dec5d136ea 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations -fPIC) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/extension/llm/runner/CMakeLists.txt b/extension/llm/runner/CMakeLists.txt index 63ff65a15c1..7adb980d224 100644 --- a/extension/llm/runner/CMakeLists.txt +++ b/extension/llm/runner/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT EXECUTORCH_ROOT) endif() include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) # # The `__srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 3f87e400a24..6ed55c73e28 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -34,7 +34,7 @@ list(APPEND _common_compile_options -DET_BUILD_WITH_BLAS) # compiling for avx2 for now punting this to come back include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/portable/CMakeLists.txt b/kernels/portable/CMakeLists.txt index df917067a3b..5072723296c 100644 --- a/kernels/portable/CMakeLists.txt +++ b/kernels/portable/CMakeLists.txt @@ -24,7 +24,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/kernels/quantized/CMakeLists.txt b/kernels/quantized/CMakeLists.txt index 9d88898761f..c3c4c161b5f 100644 --- a/kernels/quantized/CMakeLists.txt +++ b/kernels/quantized/CMakeLists.txt @@ -27,7 +27,7 @@ endif() set(_common_compile_options -Wno-deprecated-declarations) include(${EXECUTORCH_ROOT}/build/Utils.cmake) -include(${EXECUTORCH_ROOT}/util/build/Codegen.cmake) +include(${EXECUTORCH_ROOT}/scripts/build/Codegen.cmake) if(NOT PYTHON_EXECUTABLE) resolve_python_executable() diff --git a/util/build/Codegen.cmake b/scripts/build/Codegen.cmake similarity index 100% rename from util/build/Codegen.cmake rename to scripts/build/Codegen.cmake