From f3c39d4c56688bc798257202c0fa977d5ee2873a Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 16:25:36 -0700 Subject: [PATCH 01/11] Add .ptd support to portable executor runner --- CMakeLists.txt | 3 ++ .../executor_runner/executor_runner.cpp | 36 ++++++++++++++++++- examples/portable/executor_runner/targets.bzl | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7012ec641bf..636cf37f672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1021,6 +1021,9 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER) extension_runner_util gflags executorch_backends ) + # Add all extensions + list(APPEND _executor_runner_libs executorch_extensions) + if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib) elseif(EXECUTORCH_BUILD_CADENCE) diff --git a/examples/portable/executor_runner/executor_runner.cpp b/examples/portable/executor_runner/executor_runner.cpp index 5ce872eec8e..94a0992df02 100644 --- a/examples/portable/executor_runner/executor_runner.cpp +++ b/examples/portable/executor_runner/executor_runner.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,7 @@ DEFINE_string( model_path, "model.pte", "Model serialized in flatbuffer format."); +DEFINE_string(data_path, "", "Path to data file."); DEFINE_string(inputs, "", "Comma-separated list of input files"); DEFINE_string( output_file, @@ -72,6 +74,7 @@ DEFINE_int32( using executorch::aten::ScalarType; using executorch::aten::Tensor; using executorch::extension::FileDataLoader; +using executorch::extension::FlatTensorDataMap; using executorch::runtime::Error; using executorch::runtime::EValue; using executorch::runtime::EventTracer; @@ -171,6 +174,34 @@ int main(int argc, char** argv) { "FileDataLoader::from() failed: 0x%" PRIx32, (uint32_t)loader.error()); + // Load .ptd file if provided + std::unique_ptr ptd_loader; + std::unique_ptr ptd_data_map; + if (!FLAGS_data_path.empty()) { + const char* data_path = FLAGS_data_path.c_str(); + Result ptd_loader_result = FileDataLoader::from(data_path); + ET_CHECK_MSG( + ptd_loader_result.ok(), + "FileDataLoader::from() failed for PTD file: 0x%" PRIx32, + (uint32_t)ptd_loader_result.error()); + ptd_loader = + std::make_unique(std::move(ptd_loader_result.get())); + ET_LOG(Info, "PTD file %s is loaded.", ptd_path); + + Result ptd_data_map_result = + FlatTensorDataMap::load(ptd_loader.get()); + ET_CHECK_MSG( + ptd_data_map_result.ok(), + "FlatTensorDataMap::load() failed for PTD file: 0x%" PRIx32, + (uint32_t)ptd_data_map_result.error()); + ptd_data_map = std::make_unique( + std::move(ptd_data_map_result.get())); + ET_LOG( + Info, + "PTD data map created with %zu keys.", + ptd_data_map->get_num_keys().get()); + } + std::vector inputs_storage; std::vector> input_buffers; @@ -294,7 +325,10 @@ int main(int argc, char** argv) { // EventTraceManager tracer; Result method = program->load_method( - method_name, &memory_manager, tracer.get_event_tracer()); + method_name, + &memory_manager, + tracer.get_event_tracer(), + ptd_data_map.get()); ET_CHECK_MSG( method.ok(), "Loading of method %s failed with status 0x%" PRIx32, diff --git a/examples/portable/executor_runner/targets.bzl b/examples/portable/executor_runner/targets.bzl index 0af45d85075..d1304a84bcb 100644 --- a/examples/portable/executor_runner/targets.bzl +++ b/examples/portable/executor_runner/targets.bzl @@ -19,6 +19,7 @@ def define_common_targets(): "//executorch/devtools/etdump:etdump_flatcc", "//executorch/extension/data_loader:file_data_loader", "//executorch/extension/evalue_util:print_evalue", + "//executorch/extension/flat_tensor:flat_tensor_data_map", "//executorch/extension/runner_util:inputs", ], external_deps = [ @@ -38,6 +39,7 @@ def define_common_targets(): "//executorch/runtime/executor:program", "//executorch/extension/data_loader:file_data_loader", "//executorch/extension/evalue_util:print_evalue", + "//executorch/extension/flat_tensor:flat_tensor_data_map", "//executorch/extension/runner_util:inputs", "//executorch/extension/threadpool:cpuinfo_utils", "//executorch/extension/threadpool:threadpool", From 2b176a5ecb3ce032f8acae59a4c343fd9f96d9cc Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 16:47:52 -0700 Subject: [PATCH 02/11] Rename argument --- examples/portable/executor_runner/executor_runner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/portable/executor_runner/executor_runner.cpp b/examples/portable/executor_runner/executor_runner.cpp index 94a0992df02..c2d0b8e9e52 100644 --- a/examples/portable/executor_runner/executor_runner.cpp +++ b/examples/portable/executor_runner/executor_runner.cpp @@ -186,7 +186,7 @@ int main(int argc, char** argv) { (uint32_t)ptd_loader_result.error()); ptd_loader = std::make_unique(std::move(ptd_loader_result.get())); - ET_LOG(Info, "PTD file %s is loaded.", ptd_path); + ET_LOG(Info, "PTD file %s is loaded.", data_path); Result ptd_data_map_result = FlatTensorDataMap::load(ptd_loader.get()); From 7e65c6e4ca2cec983c0e18d1f836c8268963d109 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 17:00:05 -0700 Subject: [PATCH 03/11] Fix test_model.sh --- .ci/scripts/test_model.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index de28597b1d5..7e773caf6c7 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -48,22 +48,27 @@ prepare_artifacts_upload() { fi } + build_cmake_executor_runner() { local backend_string_select="${1:-}" echo "Building executor_runner" rm -rf ${CMAKE_OUTPUT_DIR} mkdir ${CMAKE_OUTPUT_DIR} + # Common options: + COMMON="-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ + -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ + -DPYTHON_EXECUTABLE=\"$PYTHON_EXECUTABLE\"" if [[ "$backend_string_select" == "XNNPACK" ]]; then echo "Backend $backend_string_select selected" (cd ${CMAKE_OUTPUT_DIR} \ && cmake -DCMAKE_BUILD_TYPE=Release \ -DEXECUTORCH_BUILD_XNNPACK=ON \ - -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..) + ${COMMON} ..) cmake --build ${CMAKE_OUTPUT_DIR} -j4 else cmake -DCMAKE_BUILD_TYPE=Debug \ -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \ - -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \ + ${COMMON} \ -B${CMAKE_OUTPUT_DIR} . cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug fi From e2dbd62f5ed1763d4c0b56b86f81dacf5ec065b8 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 17:18:04 -0700 Subject: [PATCH 04/11] Fix CI --- .ci/scripts/utils.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index f6f6ece786b..b8af864a6aa 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -125,14 +125,17 @@ build_executorch_runner_cmake() { clean_executorch_install_folders mkdir "${CMAKE_OUTPUT_DIR}" - pushd "${CMAKE_OUTPUT_DIR}" || return if [[ $1 == "Debug" ]]; then CXXFLAGS="-fsanitize=address,undefined" else CXXFLAGS="" fi - CXXFLAGS="$CXXFLAGS" retry cmake -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" -DCMAKE_BUILD_TYPE="${1:-Release}" .. - popd || return + CXXFLAGS="$CXXFLAGS" retry cmake \ + -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \ + -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ + -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ + -DCMAKE_BUILD_TYPE="${1:-Release}" \ + -B${CMAKE_OUTPUT_DIR} . if [ "$(uname)" == "Darwin" ]; then CMAKE_JOBS=$(( $(sysctl -n hw.ncpu) - 1 )) From 197ace0699ee86b0f47564bd8b88db3c0bef8e32 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 22:25:24 -0700 Subject: [PATCH 05/11] Fix tests --- .ci/scripts/test_model.sh | 10 ++++------ examples/portable/custom_ops/test_custom_ops.sh | 2 ++ examples/selective_build/advanced/CMakeLists.txt | 9 +++++++-- examples/selective_build/basic/CMakeLists.txt | 9 +++++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index 7e773caf6c7..8449809ffe3 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -55,15 +55,13 @@ build_cmake_executor_runner() { rm -rf ${CMAKE_OUTPUT_DIR} mkdir ${CMAKE_OUTPUT_DIR} # Common options: - COMMON="-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ - -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ - -DPYTHON_EXECUTABLE=\"$PYTHON_EXECUTABLE\"" + COMMON="-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE" if [[ "$backend_string_select" == "XNNPACK" ]]; then echo "Backend $backend_string_select selected" - (cd ${CMAKE_OUTPUT_DIR} \ - && cmake -DCMAKE_BUILD_TYPE=Release \ + cmake -DCMAKE_BUILD_TYPE=Release \ -DEXECUTORCH_BUILD_XNNPACK=ON \ - ${COMMON} ..) + ${COMMON} \ + -B${CMAKE_OUTPUT_DIR} . cmake --build ${CMAKE_OUTPUT_DIR} -j4 else cmake -DCMAKE_BUILD_TYPE=Debug \ diff --git a/examples/portable/custom_ops/test_custom_ops.sh b/examples/portable/custom_ops/test_custom_ops.sh index 58a7de3a5f2..33ebfe26bd7 100644 --- a/examples/portable/custom_ops/test_custom_ops.sh +++ b/examples/portable/custom_ops/test_custom_ops.sh @@ -61,6 +61,8 @@ test_cmake_custom_op_2() { retry cmake \ -DREGISTER_EXAMPLE_CUSTOM_OP=2 \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \ + -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ + -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \ -B${build_dir} \ ${example_dir} diff --git a/examples/selective_build/advanced/CMakeLists.txt b/examples/selective_build/advanced/CMakeLists.txt index 65ebb50bcac..fdef5e6555d 100644 --- a/examples/selective_build/advanced/CMakeLists.txt +++ b/examples/selective_build/advanced/CMakeLists.txt @@ -139,7 +139,12 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") endif() target_link_libraries( selective_build_test - PRIVATE executorch_core extension_evalue_util extension_runner_util - gflags::gflags ${selected_kernel_target} + PRIVATE executorch_core + extension_evalue_util + extension_runner_util + gflags::gflags + extension_flat_tensor + extension_data_loader + ${selected_kernel_target} ) target_compile_options(selective_build_test PUBLIC ${_common_compile_options}) diff --git a/examples/selective_build/basic/CMakeLists.txt b/examples/selective_build/basic/CMakeLists.txt index 3cc68ad53b6..d74f94d7b3a 100644 --- a/examples/selective_build/basic/CMakeLists.txt +++ b/examples/selective_build/basic/CMakeLists.txt @@ -71,7 +71,12 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") endif() target_link_libraries( selective_build_test - PRIVATE executorch_core extension_evalue_util extension_runner_util - gflags::gflags executorch_kernels + PRIVATE executorch_core + extension_evalue_util + extension_runner_util + gflags::gflags + executorch_kernels + extension_data_loader + extension_flat_tensor ) target_compile_options(selective_build_test PUBLIC ${_common_compile_options}) From a62d9663e593a0ab433c1f74b6784818d8274350 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 22:59:08 -0700 Subject: [PATCH 06/11] Fix CI retry --- .ci/scripts/utils.sh | 2 -- CMakeLists.txt | 2 +- examples/portable/custom_ops/CMakeLists.txt | 2 +- examples/portable/custom_ops/test_custom_ops.sh | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index b8af864a6aa..f896d3f1d40 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -132,8 +132,6 @@ build_executorch_runner_cmake() { fi CXXFLAGS="$CXXFLAGS" retry cmake \ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \ - -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ - -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ -DCMAKE_BUILD_TYPE="${1:-Release}" \ -B${CMAKE_OUTPUT_DIR} . diff --git a/CMakeLists.txt b/CMakeLists.txt index 636cf37f672..afba866cd9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1022,7 +1022,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER) ) # Add all extensions - list(APPEND _executor_runner_libs executorch_extensions) + list(APPEND _executor_runner_libs ${_executorch_extensions}) if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index 4188554af79..97fd621c421 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -118,7 +118,7 @@ list(TRANSFORM _executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/") add_executable(custom_ops_executor_runner ${_executor_runner__srcs}) target_link_libraries( custom_ops_executor_runner custom_ops_lib executorch extension_evalue_util - extension_runner_util gflags + extension_runner_util gflags extension_data_loader extension_flat_tensor ) target_compile_options( custom_ops_executor_runner PUBLIC ${_common_compile_options} diff --git a/examples/portable/custom_ops/test_custom_ops.sh b/examples/portable/custom_ops/test_custom_ops.sh index 33ebfe26bd7..58a7de3a5f2 100644 --- a/examples/portable/custom_ops/test_custom_ops.sh +++ b/examples/portable/custom_ops/test_custom_ops.sh @@ -61,8 +61,6 @@ test_cmake_custom_op_2() { retry cmake \ -DREGISTER_EXAMPLE_CUSTOM_OP=2 \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \ - -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ - -DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \ -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \ -B${build_dir} \ ${example_dir} From 23576658f3a3eb2117c8513b2a8f8c470d07b6fc Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 23:05:56 -0700 Subject: [PATCH 07/11] lintrunner --- CMakeLists.txt | 5 +++-- examples/portable/custom_ops/CMakeLists.txt | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afba866cd9e..6a36d7e563a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1021,8 +1021,9 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER) extension_runner_util gflags executorch_backends ) - # Add all extensions - list(APPEND _executor_runner_libs ${_executorch_extensions}) + if(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR) + list(APPEND _executor_runner_libs extension_flat_tensor) + endif() if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED) list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index 97fd621c421..8e679697b47 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -117,8 +117,14 @@ list(TRANSFORM _executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/") add_executable(custom_ops_executor_runner ${_executor_runner__srcs}) target_link_libraries( - custom_ops_executor_runner custom_ops_lib executorch extension_evalue_util - extension_runner_util gflags extension_data_loader extension_flat_tensor + custom_ops_executor_runner + custom_ops_lib + executorch + extension_evalue_util + extension_runner_util + gflags + extension_data_loader + extension_flat_tensor ) target_compile_options( custom_ops_executor_runner PUBLIC ${_common_compile_options} From bd8635225effe35c2b9fc45c1628b82b95a9b8f0 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 6 Oct 2025 23:33:03 -0700 Subject: [PATCH 08/11] Turn on flat tensor and data loader by default --- tools/cmake/preset/default.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/preset/default.cmake b/tools/cmake/preset/default.cmake index fb0dc0a4ade..0039ab551fb 100644 --- a/tools/cmake/preset/default.cmake +++ b/tools/cmake/preset/default.cmake @@ -67,11 +67,11 @@ define_overridable_option( ) define_overridable_option( EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "Build the Data Loader extension" BOOL - OFF + ON # Required by executor_runner ) define_overridable_option( EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR "Build the Flat Tensor extension" BOOL - OFF + ON # Required by executor_runner ) define_overridable_option( EXECUTORCH_BUILD_EXTENSION_LLM "Build the LLM extension" BOOL OFF From 46d924fbff19a0287b57ae344e030a4255e06940 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Tue, 7 Oct 2025 00:06:47 -0700 Subject: [PATCH 09/11] Fix arm --- extension/flat_tensor/flat_tensor_data_map.cpp | 2 +- tools/cmake/preset/arm_baremetal.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/flat_tensor/flat_tensor_data_map.cpp b/extension/flat_tensor/flat_tensor_data_map.cpp index 478ce9d63cf..515bfe93c28 100644 --- a/extension/flat_tensor/flat_tensor_data_map.cpp +++ b/extension/flat_tensor/flat_tensor_data_map.cpp @@ -55,7 +55,7 @@ Result get_named_data( if (named_data == nullptr) { return Error::NotFound; } - for (int i = 0; i < named_data->size(); i++) { + for (flatbuffers::uoffset_t i = 0; i < named_data->size(); ++i) { if (key.size() == named_data->Get(i)->key()->size() && std::strncmp( named_data->Get(i)->key()->c_str(), diff --git a/tools/cmake/preset/arm_baremetal.cmake b/tools/cmake/preset/arm_baremetal.cmake index 33a12969484..882780ade1d 100644 --- a/tools/cmake/preset/arm_baremetal.cmake +++ b/tools/cmake/preset/arm_baremetal.cmake @@ -5,6 +5,8 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}") set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER OFF) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR OFF) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER OFF) set_overridable_option(EXECUTORCH_BUILD_ARM_BAREMETAL ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON) @@ -18,7 +20,6 @@ define_overridable_option( if("${EXECUTORCH_BUILD_ARM_ETDUMP}") set(EXECUTORCH_BUILD_DEVTOOLS ON) set(EXECUTORCH_ENABLE_EVENT_TRACER ON) - set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER OFF) set(FLATCC_ALLOW_WERROR OFF) else() set(EXECUTORCH_ENABLE_EVENT_TRACER OFF) From 9a47ce1084b86171be806800e8792a121bff1801 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Tue, 7 Oct 2025 00:12:41 -0700 Subject: [PATCH 10/11] Portability --- examples/portable/executor_runner/executor_runner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/portable/executor_runner/executor_runner.cpp b/examples/portable/executor_runner/executor_runner.cpp index c2d0b8e9e52..6c16f9cc631 100644 --- a/examples/portable/executor_runner/executor_runner.cpp +++ b/examples/portable/executor_runner/executor_runner.cpp @@ -198,7 +198,7 @@ int main(int argc, char** argv) { std::move(ptd_data_map_result.get())); ET_LOG( Info, - "PTD data map created with %zu keys.", + "PTD data map created with %" PRIu64 " keys.", ptd_data_map->get_num_keys().get()); } From d0176560ca8ea114ea6040f3881961217868ea88 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Tue, 7 Oct 2025 00:29:31 -0700 Subject: [PATCH 11/11] Guard by clang defined --- examples/portable/executor_runner/executor_runner.cpp | 2 +- extension/flat_tensor/serialize/flat_tensor_header.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/portable/executor_runner/executor_runner.cpp b/examples/portable/executor_runner/executor_runner.cpp index 6c16f9cc631..0974e751203 100644 --- a/examples/portable/executor_runner/executor_runner.cpp +++ b/examples/portable/executor_runner/executor_runner.cpp @@ -199,7 +199,7 @@ int main(int argc, char** argv) { ET_LOG( Info, "PTD data map created with %" PRIu64 " keys.", - ptd_data_map->get_num_keys().get()); + static_cast(ptd_data_map->get_num_keys().get())); } std::vector inputs_storage; diff --git a/extension/flat_tensor/serialize/flat_tensor_header.cpp b/extension/flat_tensor/serialize/flat_tensor_header.cpp index b329015e4ce..b055d222465 100644 --- a/extension/flat_tensor/serialize/flat_tensor_header.cpp +++ b/extension/flat_tensor/serialize/flat_tensor_header.cpp @@ -14,7 +14,9 @@ #include #include +#if defined(__clang__) #pragma clang diagnostic ignored "-Wdeprecated" +#endif namespace executorch { using runtime::Error;