Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
07adf1a
Update
swolchok Feb 8, 2025
bc3fd39
Update
swolchok Feb 9, 2025
00ce927
Update
swolchok Feb 10, 2025
6440d3d
Update
swolchok Feb 10, 2025
e62191a
Update
swolchok Feb 10, 2025
630bdd0
Update
swolchok Feb 10, 2025
098432f
Update
swolchok Feb 10, 2025
773ff37
Update
swolchok Feb 12, 2025
87513d8
Update
swolchok Feb 12, 2025
b61319b
Update
swolchok Feb 12, 2025
4265c31
Update
swolchok Feb 12, 2025
190bea8
Update
swolchok Feb 12, 2025
d4aaa36
Update
swolchok Feb 10, 2025
15bc325
Update
swolchok Feb 12, 2025
6b9b4cc
Update
swolchok Feb 12, 2025
ca4c14e
Update
swolchok Feb 12, 2025
372da45
Update
swolchok Feb 12, 2025
de924fe
Update
swolchok Feb 12, 2025
a0e9eb9
Update
swolchok Feb 12, 2025
4878a6b
Update
swolchok Feb 12, 2025
da6fd97
Update
swolchok Feb 12, 2025
ef00f3d
Update
swolchok Feb 12, 2025
e5edad6
Update
swolchok Feb 12, 2025
e9d552e
Update
swolchok Feb 12, 2025
8ed9894
Update
swolchok Feb 12, 2025
3f80407
Update
swolchok Feb 12, 2025
8ee4ee4
Update
swolchok Feb 12, 2025
4787a21
Update
swolchok Feb 12, 2025
8016e33
Update
swolchok Feb 12, 2025
a947148
Update
swolchok Feb 12, 2025
e3ae7b5
Update
swolchok Feb 12, 2025
827e9c5
Update
swolchok Feb 12, 2025
46df5cc
Update
swolchok Feb 12, 2025
a826c40
Update
swolchok Feb 12, 2025
6601683
Update
swolchok Feb 12, 2025
7a8397f
Update
swolchok Feb 12, 2025
d282727
Update
swolchok Feb 12, 2025
857bfa7
Update
swolchok Feb 12, 2025
f7c1205
Update
swolchok Feb 19, 2025
4b35d1e
Update
swolchok Feb 19, 2025
fe6b9c7
Update
swolchok Feb 19, 2025
6fe249c
Update
swolchok Feb 19, 2025
741d8a9
Update
swolchok Feb 19, 2025
ff128f7
Update
swolchok Feb 21, 2025
f06ee2f
Update
swolchok Feb 22, 2025
a1b9a76
Update
swolchok Feb 22, 2025
59355b9
Update
swolchok Feb 22, 2025
3c522ee
Update
swolchok Feb 22, 2025
9027194
Update
swolchok Feb 22, 2025
95cfe7d
Update
swolchok Feb 24, 2025
cb0234b
Update
swolchok Feb 24, 2025
0d53925
Update
swolchok Feb 24, 2025
3b24ef4
Update
swolchok Feb 24, 2025
5a920ed
Update
swolchok Feb 24, 2025
056ee1d
Update
swolchok Feb 24, 2025
9d8e434
Update
swolchok Feb 24, 2025
3a2d555
Update
swolchok Feb 24, 2025
b8f2a5b
Update
swolchok Feb 24, 2025
719b63d
Update
swolchok Feb 24, 2025
19bab0b
Update
swolchok Feb 24, 2025
4fde311
Update
swolchok Feb 24, 2025
f02844b
Update
swolchok Feb 25, 2025
1b47bf0
Update
swolchok Feb 25, 2025
61f045d
Update
swolchok Feb 25, 2025
4eb72d3
Update
swolchok Feb 25, 2025
9c7b3d1
Update
swolchok Feb 25, 2025
25a26e2
Update
swolchok Feb 25, 2025
aafa130
Update
swolchok Feb 25, 2025
8dc7ba0
Update
swolchok Feb 25, 2025
8d9394f
Update
swolchok Feb 25, 2025
71ef8af
Update
swolchok Feb 25, 2025
b52f223
Update
swolchok Feb 25, 2025
8df2f1d
Update
swolchok Feb 25, 2025
7f5cfd3
Update
swolchok Feb 25, 2025
832f410
Update
swolchok Feb 25, 2025
51478b5
Update
swolchok Feb 25, 2025
aa296c7
rebase
swolchok Aug 12, 2025
6e2be2b
rebase
swolchok Aug 12, 2025
4780849
rebase
swolchok Aug 12, 2025
4184f07
Update
swolchok Aug 13, 2025
da62330
Update
swolchok Aug 13, 2025
31f198c
Update
swolchok Aug 13, 2025
4d2bfd2
Update
swolchok Aug 13, 2025
d4f9a6f
Update
swolchok Aug 13, 2025
3ccf059
Update
swolchok Aug 13, 2025
c24a619
Update
swolchok Aug 13, 2025
69ed8e0
Update
swolchok Aug 13, 2025
850e288
Update
swolchok Aug 13, 2025
9dbb212
Update
swolchok Aug 13, 2025
91fb965
Update
swolchok Aug 13, 2025
800800c
Update
swolchok Aug 13, 2025
1ef7f54
Update
swolchok Aug 13, 2025
3f4950a
Update
swolchok Aug 13, 2025
9d94c80
Update
swolchok Aug 13, 2025
b5f879c
Update
swolchok Aug 13, 2025
a64229d
Update
swolchok Aug 13, 2025
152662a
Update
swolchok Aug 13, 2025
7f2ca6a
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
5f78cd5
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
6a89113
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
8ea58c0
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
f95f277
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
0db46b1
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
ea95ed2
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
80a974a
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
0bbfae4
rebase atop revert to unbreak tests
swolchok Aug 13, 2025
ce099c5
Update
swolchok Aug 13, 2025
0f13c9f
Update
swolchok Aug 13, 2025
04d167e
Update
swolchok Aug 13, 2025
222a087
Update
swolchok Aug 13, 2025
e9c78ed
Update
swolchok Aug 13, 2025
f959b51
Update
swolchok Aug 13, 2025
7d6c8c5
Update
swolchok Aug 13, 2025
276f39f
Update
swolchok Aug 13, 2025
97b2cdf
Update
swolchok Aug 13, 2025
689fdc3
Update
swolchok Aug 13, 2025
9fef931
rebase
swolchok Aug 14, 2025
878efc6
rebase
swolchok Aug 14, 2025
4473fb7
rebase
swolchok Aug 14, 2025
475ba13
rebase
swolchok Aug 14, 2025
b8ad6be
rebase
swolchok Aug 14, 2025
f6126e4
rebase
swolchok Aug 14, 2025
79bffad
rebase
swolchok Aug 14, 2025
e1db7c8
rebase
swolchok Aug 14, 2025
6278fa1
rebase
swolchok Aug 14, 2025
90bb993
rebase
swolchok Aug 14, 2025
a3b4074
rebase
swolchok Aug 15, 2025
dec04ee
rebase
swolchok Aug 15, 2025
fbfa1ac
rebase
swolchok Aug 15, 2025
74c24fe
rebase
swolchok Aug 15, 2025
a774eaa
rebase
swolchok Aug 15, 2025
8faeaca
rebase
swolchok Aug 15, 2025
863a443
rebase
swolchok Aug 15, 2025
854f3ca
rebase
swolchok Aug 15, 2025
5304064
rebase
swolchok Aug 15, 2025
c054311
rebase
swolchok Aug 15, 2025
49afd80
Update
swolchok Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,6 @@ if(EXECUTORCH_SRCS_FILE)
)
endif()
executorch_load_build_variables()
if(NOT EXECUTORCH_SRCS_FILE)
# A file wasn't provided. Run a script to extract the source lists from the
# buck2 build system and write them to a file we can include.
#
# NOTE: This will only happen once during cmake setup, so it will not re-run
# if the buck2 targets change.
message(STATUS "executorch: Generating source lists")
set(EXECUTORCH_SRCS_FILE "${CMAKE_CURRENT_BINARY_DIR}/executorch_srcs.cmake")
extract_sources(${EXECUTORCH_SRCS_FILE})
executorch_validate_build_variables()
endif()

# Detect if an iOS toolchain is set.
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
Expand Down
198 changes: 66 additions & 132 deletions tools/cmake/Codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -378,139 +378,73 @@ function(executorch_append_filelist name outputvar)
)
endfunction()

set(EXECUTORCH_BUILD_VARIABLES_FILELISTS
EXECUTORCH_SRCS
EXECUTORCH_CORE_SRCS
PORTABLE_KERNELS_SRCS
KERNELS_UTIL_ALL_DEPS_SRCS
OPTIMIZED_KERNELS_SRCS
QUANTIZED_KERNELS_SRCS
PROGRAM_SCHEMA_SRCS
OPTIMIZED_CPUBLAS_SRCS
OPTIMIZED_NATIVE_CPU_OPS_SRCS
TEST_BACKEND_COMPILER_LIB_SRCS
EXTENSION_DATA_LOADER_SRCS
EXTENSION_EVALUE_UTIL_SRCS
EXTENSION_FLAT_TENSOR_SRCS
EXTENSION_MODULE_SRCS
EXTENSION_RUNNER_UTIL_SRCS
EXTENSION_LLM_RUNNER_SRCS
EXTENSION_TENSOR_SRCS
EXTENSION_THREADPOOL_SRCS
EXTENSION_TRAINING_SRCS
TRAIN_XOR_SRCS
EXECUTOR_RUNNER_SRCS
SIZE_TEST_SRCS
MPS_EXECUTOR_RUNNER_SRCS
MPS_BACKEND_SRCS
MPS_SCHEMA_SRCS
XNN_EXECUTOR_RUNNER_SRCS
XNNPACK_BACKEND_SRCS
XNNPACK_SCHEMA_SRCS
VULKAN_SCHEMA_SRCS
CUSTOM_OPS_SRCS
LLAMA_RUNNER_SRCS
)
set(EXECUTORCH_BUILD_VARIABLES_VARNAMES
_executorch__srcs
_executorch_core__srcs
_portable_kernels__srcs
_kernels_util_all_deps__srcs
_optimized_kernels__srcs
_quantized_kernels__srcs
_program_schema__srcs
_optimized_cpublas__srcs
_optimized_native_cpu_ops__srcs
_test_backend_compiler_lib__srcs
_extension_data_loader__srcs
_extension_evalue_util__srcs
_extension_flat_tensor__srcs
_extension_module__srcs
_extension_runner_util__srcs
_extension_llm_runner__srcs
_extension_tensor__srcs
_extension_threadpool__srcs
_extension_training__srcs
_train_xor__srcs
_executor_runner__srcs
_size_test__srcs
_mps_executor_runner__srcs
_mps_backend__srcs
_mps_schema__srcs
_xnn_executor_runner__srcs
_xnnpack_backend__srcs
_xnnpack_schema__srcs
_vulkan_schema__srcs
_custom_ops__srcs
_llama_runner__srcs
)

# Fail the build if the src lists in build_variables.bzl do not match the src
# lists extracted from Buck and placed into EXECUTORCH_SRCS_FILE. This is
# intended to be a safety mechanism while we are in the process of removing Buck
# from the CMake build and replacing it with build_variables.bzl; if you are
# seeing failures after you have intentionally changed Buck srcs, then simply
# update build_variables.bzl. If you are seeing failures after changing
# something about the build system, make sure your changes will work both before
# and after we finish replacing Buck with build_variables.bzl, which should
# involve getting these lists to match!
function(executorch_validate_build_variables)
include(${EXECUTORCH_SRCS_FILE})
foreach(filelist_and_varname IN
ZIP_LISTS EXECUTORCH_BUILD_VARIABLES_FILELISTS
EXECUTORCH_BUILD_VARIABLES_VARNAMES
)
executorch_append_filelist(
${filelist_and_varname_0}
"${filelist_and_varname_1}_from_build_variables"
)
# The Buck and CMake mechanisms for getting the default PAL set up are
# different. Prevent the Buck choice from flowing into CMake and causing
# validation to fail, just like we do in our CMakeLists.txt.
if("${filelist_and_varname_1}" STREQUAL "_executorch_core__srcs")
list(FILTER ${filelist_and_varname_1} EXCLUDE REGEX
"runtime/platform/default/[^/]*.cpp$"
)
endif()
if(NOT ${filelist_and_varname_1} STREQUAL
${filelist_and_varname_1}_from_build_variables
)
set(generated_items_not_in_build_variables ${${filelist_and_varname_1}})
list(REMOVE_ITEM generated_items_not_in_build_variables
${${filelist_and_varname_1}_from_build_variables}
)

set(build_variables_items_not_in_generated
${${filelist_and_varname_1}_from_build_variables}
)
list(REMOVE_ITEM build_variables_items_not_in_generated
${${filelist_and_varname_1}}
)

list(JOIN generated_items_not_in_build_variables "\n"
pretty_generated_items_not_in_build_variables
)
list(JOIN build_variables_items_not_in_generated "\n"
pretty_build_variables_items_not_in_generated
)
if(NOT pretty_generated_items_not_in_build_variables)
set(pretty_generated_items_not_in_build_variables "<none>")
endif()
if(NOT pretty_build_variables_items_not_in_generated)
set(pretty_build_variables_items_not_in_generated "<none>")
endif()
message(
FATAL_ERROR
"Buck-generated ${filelist_and_varname_1} does not match hardcoded "
"${filelist_and_varname_0} in build_variables.bzl. Buck-generated items not in build_variables.bzl: "
"${pretty_generated_items_not_in_build_variables}\n "
"build_variables.bzl items not in buck-generated list: ${pretty_build_variables_items_not_in_generated}"
)
endif()
endforeach()
endfunction()

function(executorch_load_build_variables)
set(EXECUTORCH_BUILD_VARIABLES_FILELISTS
EXECUTORCH_SRCS
EXECUTORCH_CORE_SRCS
PORTABLE_KERNELS_SRCS
KERNELS_UTIL_ALL_DEPS_SRCS
OPTIMIZED_KERNELS_SRCS
QUANTIZED_KERNELS_SRCS
PROGRAM_SCHEMA_SRCS
OPTIMIZED_CPUBLAS_SRCS
OPTIMIZED_NATIVE_CPU_OPS_SRCS
TEST_BACKEND_COMPILER_LIB_SRCS
EXTENSION_DATA_LOADER_SRCS
EXTENSION_EVALUE_UTIL_SRCS
EXTENSION_FLAT_TENSOR_SRCS
EXTENSION_MODULE_SRCS
EXTENSION_RUNNER_UTIL_SRCS
EXTENSION_LLM_RUNNER_SRCS
EXTENSION_TENSOR_SRCS
EXTENSION_THREADPOOL_SRCS
EXTENSION_TRAINING_SRCS
TRAIN_XOR_SRCS
EXECUTOR_RUNNER_SRCS
SIZE_TEST_SRCS
MPS_EXECUTOR_RUNNER_SRCS
MPS_BACKEND_SRCS
MPS_SCHEMA_SRCS
XNN_EXECUTOR_RUNNER_SRCS
XNNPACK_BACKEND_SRCS
XNNPACK_SCHEMA_SRCS
VULKAN_SCHEMA_SRCS
CUSTOM_OPS_SRCS
LLAMA_RUNNER_SRCS
)
set(EXECUTORCH_BUILD_VARIABLES_VARNAMES
_executorch__srcs
_executorch_core__srcs
_portable_kernels__srcs
_kernels_util_all_deps__srcs
_optimized_kernels__srcs
_quantized_kernels__srcs
_program_schema__srcs
_optimized_cpublas__srcs
_optimized_native_cpu_ops__srcs
_test_backend_compiler_lib__srcs
_extension_data_loader__srcs
_extension_evalue_util__srcs
_extension_flat_tensor__srcs
_extension_module__srcs
_extension_runner_util__srcs
_extension_llm_runner__srcs
_extension_tensor__srcs
_extension_threadpool__srcs
_extension_training__srcs
_train_xor__srcs
_executor_runner__srcs
_size_test__srcs
_mps_executor_runner__srcs
_mps_backend__srcs
_mps_schema__srcs
_xnn_executor_runner__srcs
_xnnpack_backend__srcs
_xnnpack_schema__srcs
_vulkan_schema__srcs
_custom_ops__srcs
_llama_runner__srcs
)
foreach(filelist_and_varname IN
ZIP_LISTS EXECUTORCH_BUILD_VARIABLES_FILELISTS
EXECUTORCH_BUILD_VARIABLES_VARNAMES
Expand Down
Loading