Skip to content

Commit b158d81

Browse files
committed
Cleanup to include error handling and debug code removal
1 parent 994aedb commit b158d81

File tree

4 files changed

+11
-27
lines changed

4 files changed

+11
-27
lines changed

codegen/tools/gen_selected_op_variants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070

7171

7272
def write_selected_op_variants(yaml_file_path: str, output_dir: str) -> None:
73-
print("REMOVE_ME: yaml_file_path is: " + str(yaml_file_path))
7473
with open(yaml_file_path, "r") as selected_operators_file:
7574
# Collect et_kernel_metadata from selected_operators.yaml and extract dtypes
7675
# Example format: v1/6;0,1|6;0,1|6;0,1|6;0,1 # Float, 0, 1
@@ -127,7 +126,6 @@ def main(argv: List[Any]) -> None:
127126
)
128127

129128
options = parser.parse_args(argv)
130-
print("REMOVE_ME: output dir was set to" + str(options.output_dir))
131129
write_selected_op_variants(options.yaml_file_path, options.output_dir)
132130

133131

selected_op_variants_add_mul.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/build_size_test.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ EXTRA_BUILD_ARGS="${@:-}"
1515
# TODO(#8357): Remove -Wno-int-in-bool-context
1616
# TODO: Replace -ET_HAVE_PREAD=0 with a CMake option.
1717
# FileDataLoader used in the size_test breaks baremetal builds with pread when missing.
18-
COMMON_CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Wno-int-in-bool-context -DET_HAVE_PREAD=0"
18+
COMMON_CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0"
1919

2020
cmake_install_executorch_lib() {
2121
echo "Installing libexecutorch.a"
2222
clean_executorch_install_folders
2323
update_tokenizers_git_submodule
2424
local EXTRA_BUILD_ARGS="${@}"
2525

26-
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake \
26+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
2727
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
2828
-DCMAKE_INSTALL_PREFIX=cmake-out \
2929
-DCMAKE_BUILD_TYPE=Release \
@@ -44,9 +44,11 @@ test_cmake_size_test() {
4444
echo "Build size test"
4545
cmake --build cmake-out/test -j9 --config Release
4646

47-
#cmake-out/test/size_test
48-
#cmake-out/test/size_test_all_ops
49-
ls -lah cmake-out/test/
47+
echo 'ExecuTorch with no ops binary size, unstripped:'
48+
ls -al cmake-out/test/size_test
49+
50+
echo 'ExecuTorch with portable ops binary size, unstripped:'
51+
ls -al cmake-out/test/size_test_all_ops
5052
}
5153

5254
if [[ -z $PYTHON_EXECUTABLE ]]; then

tools/cmake/Codegen.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ function(gen_selected_ops)
2222
message(STATUS " INCLUDE_ALL_OPS: ${GEN_INCLUDE_ALL_OPS}")
2323
message(STATUS " OPS_FROM_MODEL: ${GEN_OPS_FROM_MODEL}")
2424
message(STATUS " DTYPE_SELECTIVE_BUILD: ${GEN_DTYPE_SELECTIVE_BUILD}")
25-
if(GEN_DTYPE_SELECTIVE_BUILD)
26-
message(STATUS " DTYPE_SELECTIVE_BUILD is still WIP and may not be fully functional")
25+
26+
if(GEN_DTYPE_SELECTIVE_BUILD AND NOT GEN_OPS_FROM_MODEL)
27+
message(FATAL_ERROR " DTYPE_SELECTIVE_BUILD is only support with model API, please pass in a model")
2728
endif()
2829

2930
set(_oplist_yaml
@@ -71,7 +72,6 @@ function(gen_selected_ops)
7172
--output-dir=${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME}/
7273
)
7374
message("Command - ${_gen_opvariant_command}")
74-
message("OUTPUT - ${_opvariant_h}")
7575
add_custom_command(
7676
COMMENT "Generating ${_opvariant_h} for ${GEN_LIB_NAME}"
7777
OUTPUT ${_opvariant_h}
@@ -274,10 +274,8 @@ function(gen_operators_lib)
274274
target_link_libraries(${GEN_LIB_NAME} PUBLIC selected_portable_kernels)
275275
endif()
276276

277-
# portable_kernel is no longer in GEN_KERNEL_LIBS, but there may be others
278277
if(GEN_KERNEL_LIBS)
279-
280-
target_link_libraries(${GEN_LIB_NAME} PUBLIC ${GEN_KERNEL_LIBS})
278+
message(FATAL_ERROR "Currently dtype selective build is only supported for portable_kernels but {${GEN_KERNEL_LIBS}} were provided!")
281279
endif()
282280
endif()
283281

0 commit comments

Comments
 (0)