-
Notifications
You must be signed in to change notification settings - Fork 594
Cortex-M: Use q/dq ops in Arm Ethos Runner #10782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2c25378
Arm backend: Add quantize_per_tensor MVE impl
digantdesai 985a077
Arm backend: Add dquantize_per_tensor MVE version
digantdesai 5d92fc2
CMake: Add new Cortex_M top level build option
digantdesai 428d836
Arm backend: Build Cortex-M backend with ET
digantdesai cc7bfe3
Arm backend: Add cortex_m backend dep to the runner
digantdesai 7c0c99b
Arm backend: Use quant model for bundled PTE when available
digantdesai 376aab2
Arm backend: Use Cortex-M backend
digantdesai d75b89f
Arm backends: New quantized FVP tests for cortex-M
digantdesai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# 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. | ||
|
||
# Kernel library for Cortex-M operators. Please keep this file formatted by running: | ||
# ~~~ | ||
# cmake-format -i CMakeLists.txt | ||
# ~~~ | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
# Source root directory for executorch. | ||
if(NOT EXECUTORCH_ROOT) | ||
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) | ||
endif() | ||
|
||
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake) | ||
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake) | ||
|
||
if(NOT PYTHON_EXECUTABLE) | ||
resolve_python_executable() | ||
endif() | ||
|
||
# Cortex-M ops kernel sources | ||
set(_cortex_m_kernels__srcs | ||
${CMAKE_CURRENT_SOURCE_DIR}/ops/op_quantize_per_tensor.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/ops/op_dequantize_per_tensor.cpp | ||
) | ||
|
||
# Generate C++ bindings to register kernels into Executorch (for runtime). | ||
# Here select all ops in operators.yaml | ||
set(_yaml_file ${CMAKE_CURRENT_LIST_DIR}/ops/operators.yaml) | ||
gen_selected_ops(LIB_NAME "cortex_m_ops_lib" OPS_SCHEMA_YAML "${_yaml_file}") | ||
|
||
# Generate bindings for the kernels | ||
generate_bindings_for_kernels( | ||
LIB_NAME "cortex_m_ops_lib" CUSTOM_OPS_YAML "${_yaml_file}" | ||
) | ||
message("Generated files ${gen_command_sources}") | ||
|
||
# Build a library for _cortex_m_kernels_srcs | ||
add_library(cortex_m_kernels ${_cortex_m_kernels__srcs}) | ||
target_link_libraries(cortex_m_kernels PRIVATE executorch) | ||
target_compile_options(cortex_m_kernels PUBLIC ${_common_compile_options}) | ||
|
||
# cortex_m_ops_lib: Register Cortex-M ops kernels into Executorch runtime | ||
gen_operators_lib( | ||
LIB_NAME "cortex_m_ops_lib" KERNEL_LIBS cortex_m_kernels DEPS executorch | ||
) | ||
|
||
install( | ||
TARGETS cortex_m_kernels cortex_m_ops_lib | ||
DESTINATION lib | ||
PUBLIC_HEADER DESTINATION include/executorch/backends/cortex_m/ops/ | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.