Skip to content

Commit 83fe44f

Browse files
Merge branch 'main' into add-native-group-norm
2 parents d69c2ec + dcd25eb commit 83fe44f

File tree

66 files changed

+1540
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1540
-595
lines changed

.github/scripts/label_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

2323
LABEL_ERR_MSG_TITLE = "This PR needs a `release notes:` label"
2424
LABEL_ERR_MSG = f"""# {LABEL_ERR_MSG_TITLE}
25-
If your changes are user facing and intended to be a part of release notes, please use a label starting with `release notes:`.
25+
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with `release notes:`.
2626
27-
If not, please add the `topic: not user facing` label.
27+
If not, please add the `release notes: none` label.
2828
2929
To add a label, you can comment to pytorchbot, for example
30-
`@pytorchbot label "topic: not user facing"`
30+
`@pytorchbot label "release notes: none"`
3131
3232
For more information, see
3333
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.
@@ -115,7 +115,7 @@ def has_required_labels(pr: "GitHubPR") -> bool:
115115
pr_labels = pr.get_labels()
116116
# Check if PR is not user facing
117117
is_not_user_facing_pr = any(
118-
label.strip() == "topic: not user facing" for label in pr_labels
118+
label.strip() == "release notes: none" for label in pr_labels
119119
)
120120
return is_not_user_facing_pr or any(
121121
label.strip() in get_release_notes_labels(pr.org, pr.project)

CMakeLists.txt

Lines changed: 8 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -91,68 +91,22 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
9191
# Instead please use `find_package(executorch REQUIRED)` in the example
9292
# directory and add a new executable in the example `CMakeLists.txt`.
9393

94-
# _default_release_disabled_options: default value for options that should be
95-
# disabled in Release mode by default. Users can still manually enable them,
96-
# though.
97-
if(CMAKE_BUILD_TYPE STREQUAL "Release")
98-
set(_default_release_disabled_options OFF)
99-
else()
100-
set(_default_release_disabled_options ON)
101-
endif()
102-
103-
# Let users override which PAL defaults to use.
104-
#
105-
# TODO(dbort): Add another option that lets users point to a specific source
106-
# file; if set, would override the default option.
107-
set(EXECUTORCH_PAL_DEFAULT
108-
"posix"
109-
CACHE STRING
110-
"Which PAL default implementation to use: one of {posix, minimal}"
111-
)
112-
11394
if(NOT EXECUTORCH_ENABLE_LOGGING)
11495
# Avoid pulling in the logging strings, which can be large. Note that this
11596
# will set the compiler flag for all targets in this directory, and for all
11697
# subdirectories included after this point.
11798
add_definitions(-DET_LOG_ENABLED=0)
11899
endif()
119100

120-
# Configure log level. Must be one of debug, info, error, fatal.
121-
set(EXECUTORCH_LOG_LEVEL
122-
"Info"
123-
CACHE STRING "Build with the given ET_MIN_LOG_LEVEL value"
124-
)
125-
string(TOLOWER "${EXECUTORCH_LOG_LEVEL}" LOG_LEVEL_LOWER)
126-
if(LOG_LEVEL_LOWER STREQUAL "debug")
127-
add_definitions(-DET_MIN_LOG_LEVEL=Debug)
128-
elseif(LOG_LEVEL_LOWER STREQUAL "info")
129-
add_definitions(-DET_MIN_LOG_LEVEL=Info)
130-
elseif(LOG_LEVEL_LOWER STREQUAL "error")
131-
add_definitions(-DET_MIN_LOG_LEVEL=Error)
132-
elseif(LOG_LEVEL_LOWER STREQUAL "fatal")
133-
add_definitions(-DET_MIN_LOG_LEVEL=Fatal)
134-
else()
135-
message(
136-
SEND_ERROR
137-
"Unknown log level \"${EXECUTORCH_LOG_LEVEL}\". Expected one of Debug, "
138-
+ "Info, Error, or Fatal."
139-
)
140-
endif()
101+
add_definitions(-DET_MIN_LOG_LEVEL=${ET_MIN_LOG_LEVEL})
141102

142-
option(EXECUTORCH_ENABLE_PROGRAM_VERIFICATION
143-
"Build with ET_ENABLE_PROGRAM_VERIFICATION"
144-
${_default_release_disabled_options}
145-
)
146103
if(NOT EXECUTORCH_ENABLE_PROGRAM_VERIFICATION)
147104
# Avoid pulling in the flatbuffer data verification logic, which can add about
148105
# 20kB. Note that this will set the compiler flag for all targets in this
149106
# directory, and for all subdirectories included after this point.
150107
add_definitions(-DET_ENABLE_PROGRAM_VERIFICATION=0)
151108
endif()
152109

153-
option(EXECUTORCH_ENABLE_EVENT_TRACER "Build with ET_EVENT_TRACER_ENABLED=ON"
154-
OFF
155-
)
156110
if(EXECUTORCH_ENABLE_EVENT_TRACER)
157111
add_definitions(-DET_EVENT_TRACER_ENABLED)
158112
endif()
@@ -166,85 +120,14 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
166120
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
167121
endif()
168122

169-
option(OPTIMIZE_SIZE "Build executorch runtime optimizing for binary size" OFF)
170-
if(OPTIMIZE_SIZE)
123+
if(EXECUTORCH_OPTIMIZE_SIZE)
171124
# -Os: Optimize for size.
172125
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
173126
else()
174127
# -O2: Moderate opt.
175128
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
176129
endif()
177130

178-
option(EXECUTORCH_BUILD_ANDROID_JNI "Build Android JNI" OFF)
179-
180-
option(EXECUTORCH_BUILD_ARM_BAREMETAL
181-
"Build the Arm Baremetal flow for Cortex-M and Ethos-U" OFF
182-
)
183-
184-
option(EXECUTORCH_BUILD_KERNELS_CUSTOM "Build the custom kernels" OFF)
185-
186-
option(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT "Build the custom ops lib for AOT"
187-
OFF
188-
)
189-
190-
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "Build the Data Loader extension"
191-
OFF
192-
)
193-
194-
option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR "Build the Flat Tensor extension"
195-
OFF
196-
)
197-
198-
option(EXECUTORCH_BUILD_EXTENSION_LLM "Build the LLM extension"
199-
OFF
200-
)
201-
202-
option(EXECUTORCH_BUILD_EXTENSION_MODULE "Build the Module extension" OFF)
203-
204-
option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL "Build the Runner Util extension"
205-
OFF
206-
)
207-
208-
option(EXECUTORCH_BUILD_EXTENSION_TENSOR "Build the Tensor extension" OFF)
209-
210-
option(EXECUTORCH_BUILD_EXTENSION_TRAINING "Build the training extension" OFF)
211-
212-
option(EXECUTORCH_BUILD_MPS "Build the MPS backend" OFF)
213-
214-
option(EXECUTORCH_BUILD_NEURON "Build the backends/mediatek directory" OFF)
215-
216-
option(EXECUTORCH_BUILD_OPENVINO "Build the Openvino backend" OFF)
217-
218-
option(EXECUTORCH_BUILD_PYBIND "Build the Python Bindings" OFF)
219-
220-
option(EXECUTORCH_BUILD_QNN "Build the Qualcomm backend" OFF)
221-
222-
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "Build the optimized kernels" OFF)
223-
224-
option(EXECUTORCH_BUILD_KERNELS_QUANTIZED "Build the quantized kernels" OFF)
225-
226-
option(EXECUTORCH_BUILD_DEVTOOLS "Build the ExecuTorch Developer Tools")
227-
228-
option(EXECUTORCH_BUILD_TESTS "Build CMake-based unit tests" OFF)
229-
230-
option(EXECUTORCH_NNLIB_OPT "Build Cadence backend Hifi nnlib kernel" OFF)
231-
232-
option(EXECUTORCH_CADENCE_CPU_RUNNER "Build Cadence backend CPU runner" OFF)
233-
234-
option(EXECUTORCH_BUILD_SIZE_TEST "Build the size test" OFF)
235-
236-
option(EXECUTORCH_BUILD_XNNPACK "Build the XNNPACK backend" OFF)
237-
238-
option(EXECUTORCH_BUILD_VULKAN "Build the Vulkan backend" OFF)
239-
240-
option(BUILD_EXECUTORCH_PORTABLE_OPS "Build portable_ops library" ON)
241-
242-
option(EXECUTORCH_USE_DL "Use libdl library" ON)
243-
244-
option(EXECUTORCH_BUILD_CADENCE "Build the Cadence DSP backend" OFF)
245-
246-
option(EXECUTORCH_BUILD_CORTEX_M "Build the Cortex-M backend" OFF)
247-
248131
#
249132
# pthreadpool: build pthreadpool library. Disable on unsupported platforms
250133
#
@@ -477,17 +360,7 @@ list(FILTER _executorch_core__srcs EXCLUDE REGEX
477360
)
478361

479362
# Add the source file that maps to the requested default PAL implementation.
480-
if(EXECUTORCH_PAL_DEFAULT MATCHES "^(posix|minimal)$")
481-
message(STATUS "executorch: Using PAL default '${EXECUTORCH_PAL_DEFAULT}'")
482-
list(APPEND _executorch_core__srcs
483-
"runtime/platform/default/${EXECUTORCH_PAL_DEFAULT}.cpp"
484-
)
485-
else()
486-
message(
487-
FATAL_ERROR "Unknown EXECUTORCH_PAL_DEFAULT \"${EXECUTORCH_PAL_DEFAULT}\". "
488-
"Expected one of {posix, minimal}."
489-
)
490-
endif()
363+
list(APPEND _executorch_core__srcs ${EXECUTORCH_PAL_DEFAULT_FILE_PATH})
491364

492365
add_library(executorch_core ${_executorch_core__srcs})
493366

@@ -566,7 +439,9 @@ if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
566439
find_package_torch_headers()
567440
endif()
568441

569-
if(BUILD_EXECUTORCH_PORTABLE_OPS)
442+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/portable/cpu/util)
443+
444+
if(EXECUTORCH_BUILD_PORTABLE_OPS)
570445
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/portable)
571446
endif()
572447

@@ -579,7 +454,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/configurations)
579454
#
580455
# gflags: Commandline flag host library.
581456
#
582-
option(EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON)
457+
583458
if(EXECUTORCH_BUILD_GFLAGS)
584459
add_subdirectory(third-party/gflags)
585460
endif()
@@ -839,11 +714,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
839714
endif()
840715

841716
if(EXECUTORCH_ENABLE_EVENT_TRACER)
842-
if(EXECUTORCH_BUILD_DEVTOOLS)
843-
list(APPEND _executor_runner_libs etdump flatccrt)
844-
else()
845-
message(SEND_ERROR "Use of 'EXECUTORCH_ENABLE_EVENT_TRACER' requires 'EXECUTORCH_BUILD_DEVTOOLS' to be enabled.")
846-
endif()
717+
list(APPEND _executor_runner_libs etdump flatccrt)
847718
endif()
848719

849720
if(EXECUTORCH_BUILD_COREML)

backends/arm/test/passes/test_cast_int64_pass.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,38 @@
66
from typing import Tuple
77

88
import torch
9-
from executorch.backends.arm._passes.cast_int64_pass import CastInt64BuffersToInt32Pass
9+
from executorch.backends.arm._passes import CastInt64BuffersToInt32Pass
1010

11+
from executorch.backends.arm.test import common
1112
from executorch.backends.arm.test.tester.test_pipeline import PassPipeline
1213

1314
input_t = Tuple[torch.Tensor] # Input x
1415

1516

1617
class Int64Model(torch.nn.Module):
18+
test_data = {
19+
"rand": (torch.rand(4),),
20+
}
1721

1822
def forward(self, x: torch.Tensor):
1923
return x + 3
2024

21-
def get_inputs(self) -> input_t:
22-
return (torch.rand(4),)
23-
2425

25-
def test_int64_model_tosa_BI():
26+
@common.parametrize("test_data", Int64Model.test_data)
27+
def test_int64_model(test_data: input_t):
2628
module = Int64Model()
2729
op_checks = {
2830
"executorch_exir_dialects_edge__ops_dim_order_ops__to_dim_order_copy_default": 1,
2931
"executorch_exir_dialects_edge__ops_aten_add_Tensor": 1,
3032
}
3133
pipeline = PassPipeline[input_t](
3234
module,
33-
module.get_inputs(),
34-
tosa_version="TOSA-0.80+BI",
35+
test_data,
36+
quantize=False,
3537
ops_before_pass=op_checks,
3638
ops_after_pass=op_checks,
3739
passes_with_exported_program=[CastInt64BuffersToInt32Pass],
3840
)
39-
pipeline.pop_stage("quantize")
4041
pipeline.run()
4142

4243
exported_program = pipeline.tester.get_artifact("RunPasses").exported_program()

backends/arm/test/passes/test_convert_expand_copy_to_repeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_expand_to_repeat_tosa_BI():
3535
pipeline = PassPipeline[input_t](
3636
module,
3737
module.get_inputs(),
38-
tosa_version="TOSA-0.80+BI",
38+
quantize=True,
3939
ops_before_pass={
4040
"executorch_exir_dialects_edge__ops_aten_expand_copy_default": 1,
4141
},

backends/arm/test/passes/test_convert_split_to_slice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_split_to_slice_tosa_BI(module):
4949
pipeline = PassPipeline[input_t](
5050
module,
5151
module.get_inputs(),
52-
tosa_version="TOSA-0.80+BI",
52+
quantize=True,
5353
ops_before_pass={
5454
"executorch_exir_dialects_edge__ops_aten_split_with_sizes_copy_default": 1,
5555
},

0 commit comments

Comments
 (0)