Skip to content

Commit e2e5d59

Browse files
committed
Update base for Update on "Introduce hydra framework with backwards compatibility"
Differential Revision: [D75263989](https://our.internmc.facebook.com/intern/diff/D75263989) [ghstack-poisoned]
2 parents cd51b0f + c2aa614 commit e2e5d59

File tree

260 files changed

+8436
-2547
lines changed

Some content is hidden

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

260 files changed

+8436
-2547
lines changed

.ci/scripts/build-qnn-sdk.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ set_up_aot() {
3232
-DQNN_SDK_ROOT=${QNN_SDK_ROOT} \
3333
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
3434
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
35+
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
36+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3537
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3638
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
3739
-DPYTHON_EXECUTABLE=python3

.ci/scripts/build_llama_android.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ build_llama_runner() {
4242
popd
4343
ANDROID_ABI=arm64-v8a
4444
cmake -DBUCK2="${BUCK2}" \
45+
-DBUILD_TESTING=OFF \
4546
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK"/build/cmake/android.toolchain.cmake \
4647
-DANDROID_ABI="${ANDROID_ABI}" \
4748
-DCMAKE_INSTALL_PREFIX=cmake-android-out \

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ cmake_build_llama_runner() {
169169
popd
170170
dir="examples/models/llama"
171171
retry cmake \
172+
-DBUILD_TESTING=OFF \
172173
-DCMAKE_INSTALL_PREFIX=cmake-out \
173174
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
174175
-Bcmake-out/${dir} \

.ci/scripts/test_llama_torchao_lowbit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cmake -DPYTHON_EXECUTABLE=python \
3030
-DCMAKE_BUILD_TYPE=Release \
3131
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3232
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
33+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3334
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3435
-DEXECUTORCH_BUILD_XNNPACK=OFF \
3536
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
@@ -40,6 +41,7 @@ cmake --build cmake-out -j16 --target install --config Release
4041

4142
# Install llama runner with torchao
4243
cmake -DPYTHON_EXECUTABLE=python \
44+
-DBUILD_TESTING=OFF \
4345
-DCMAKE_BUILD_TYPE=Release \
4446
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
4547
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \

.ci/scripts/test_llava.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
3737
-DEXECUTORCH_ENABLE_LOGGING=ON \
3838
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3939
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
40+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
4041
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
4142
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
4243
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
@@ -64,9 +65,10 @@ cmake_install_executorch_libraries_for_android() {
6465

6566

6667
LLAVA_COMMON_CMAKE_ARGS=" \
68+
-DBUILD_TESTING=OFF \
6769
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
6870
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
69-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
71+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
7072
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
7173
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
7274
-DEXECUTORCH_BUILD_XNNPACK=ON"

.ci/scripts/test_phi_3_mini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ cmake_install_executorch_libraries() {
2727
-DEXECUTORCH_ENABLE_LOGGING=1 \
2828
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
2929
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
30+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3031
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3132
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3233
-DEXECUTORCH_BUILD_XNNPACK=ON \

.github/workflows/pull.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ jobs:
371371
size=${arr[4]}
372372
# threshold=48120 on devserver with gcc11.4
373373
# todo(lfq): update once binary size is below 50kb.
374-
threshold="55504"
374+
threshold="55584"
375375
if [[ "$size" -le "$threshold" ]]; then
376376
echo "Success $size <= $threshold"
377377
else
@@ -406,7 +406,7 @@ jobs:
406406
output=$(ls -la cmake-out/test/size_test)
407407
arr=($output)
408408
size=${arr[4]}
409-
threshold="51656"
409+
threshold="51728"
410410
if [[ "$size" -le "$threshold" ]]; then
411411
echo "Success $size <= $threshold"
412412
else

.github/workflows/trunk.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ jobs:
262262
output=$(ls -la ${elf})
263263
arr=($output)
264264
size=${arr[4]}
265-
threshold="102400" # 100KiB
265+
threshold="103068" # ~100KiB
266266
echo "size: $size, threshold: $threshold"
267267
if [[ "$size" -le "$threshold" ]]; then
268268
echo "Success $size <= $threshold"
@@ -552,6 +552,7 @@ jobs:
552552
-DEXECUTORCH_ENABLE_LOGGING=1 \
553553
-DCMAKE_BUILD_TYPE=Release \
554554
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
555+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
555556
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
556557
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
557558
-DEXECUTORCH_BUILD_XNNPACK=ON \
@@ -686,3 +687,32 @@ jobs:
686687
build-mode: Release
687688
build-tool: cmake
688689
docker-image: executorch-ubuntu-22.04-clang12
690+
691+
unittest-nxp-neutron:
692+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
693+
permissions:
694+
id-token: write
695+
contents: read
696+
with:
697+
runner: linux.2xlarge
698+
docker-image: executorch-ubuntu-22.04-clang12
699+
submodules: 'recursive'
700+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
701+
timeout: 90
702+
script: |
703+
set -eux
704+
705+
# The generic Linux job chooses to use base env, not the one setup by the image
706+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
707+
conda activate "${CONDA_ENV}"
708+
709+
# Build and install Executorch
710+
PYTHON_EXECUTABLE=python \
711+
CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \
712+
.ci/scripts/setup-linux.sh --build-tool "cmake"
713+
714+
# Install test requirements
715+
pip install -r backends/nxp/requirements-tests.txt
716+
717+
# Run pytest
718+
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh

.lintrunner.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,9 @@ exclude_patterns = [
386386
"third-party/**",
387387
# TODO: remove exceptions as we migrate
388388
# backends
389-
"backends/vulkan/quantizer/**",
390-
"backends/vulkan/test/**",
391-
"backends/xnnpack/quantizer/**",
392-
"backends/xnnpack/test/**",
393-
"exir/tests/test_passes.py",
394-
"extension/llm/export/builder.py",
395-
"extension/llm/export/quantizer_lib.py",
396389
"exir/tests/test_memory_planning.py",
397390
"exir/backend/test/demos/test_xnnpack_qnnpack.py",
391+
"backends/xnnpack/test/test_xnnpack_utils.py",
398392
]
399393

400394
command = [

CMakeLists.txt

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ if(NOT PYTHON_EXECUTABLE)
7575
endif()
7676
announce_configured_options(PYTHON_EXECUTABLE)
7777

78+
if(NOT BUCK2)
79+
resolve_buck2()
80+
endif()
81+
announce_configured_options(BUCK2)
82+
7883
announce_configured_options(CMAKE_CXX_COMPILER_ID)
7984
announce_configured_options(CMAKE_TOOLCHAIN_FILE)
80-
announce_configured_options(BUCK2)
8185

8286
load_build_preset()
8387
include(${PROJECT_SOURCE_DIR}/tools/cmake/preset/default.cmake)
@@ -148,37 +152,11 @@ else()
148152
endif()
149153

150154
if(EXECUTORCH_BUILD_TESTS)
151-
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
152155
include(CTest)
153156
endif()
154157

155158
add_subdirectory(third-party)
156159

157-
if(EXECUTORCH_BUILD_EXTENSION_TRAINING)
158-
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
159-
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
160-
set(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
161-
set(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
162-
endif()
163-
164-
if(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
165-
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
166-
endif()
167-
168-
if(EXECUTORCH_BUILD_EXTENSION_MODULE)
169-
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
170-
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
171-
endif()
172-
173-
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
174-
set(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
175-
set(EXECUTORCH_BUILD_KERNELS_CUSTOM ON)
176-
endif()
177-
178-
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
179-
set(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
180-
endif()
181-
182160
if(NOT DEFINED FXDIV_SOURCE_DIR)
183161
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG
184162
${CMAKE_POSITION_INDEPENDENT_CODE}
@@ -290,9 +268,6 @@ set(_common_include_directories
290268
#
291269

292270
if(NOT EXECUTORCH_SRCS_FILE)
293-
# Find or download buck2 binary.
294-
resolve_buck2()
295-
296271
# A file wasn't provided. Run a script to extract the source lists from the
297272
# buck2 build system and write them to a file we can include.
298273
#
@@ -335,7 +310,7 @@ if(EXECUTORCH_USE_CPP_CODE_COVERAGE)
335310
" -fprofile-instr-generate -fcoverage-mapping"
336311
)
337312
else()
338-
message(ERROR
313+
message(FATAL_ERROR
339314
"Code coverage for compiler ${CMAKE_CXX_COMPILER_ID} is unsupported"
340315
)
341316
endif()

0 commit comments

Comments
 (0)