Skip to content

Commit c9e0b30

Browse files
authored
Merge branch 'main' into portable-randn
2 parents 94e21b2 + 28cbc2b commit c9e0b30

File tree

220 files changed

+6845
-4990
lines changed

Some content is hidden

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

220 files changed

+6845
-4990
lines changed

.Package.swift/kernels_portable/dummy.swift

Whitespace-only changes.

.Package.swift/kernels_portable_debug/dummy.swift

Whitespace-only changes.

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
59d5cf083b4f860dea76fe8936076177f9367f10
1+
01f1cc44cbbfdf6307aa01b803a4ee22f9ade946

.ci/scripts/wheel/test_linux.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
test_base.ModelTest(
1515
model=Model.Mv3,
1616
backend=Backend.XnnpackQuantizationDelegation,
17-
)
17+
),
18+
test_base.ModelTest(
19+
model=Model.Mv3,
20+
backend=Backend.CoreMlExportOnly,
21+
),
1822
]
1923
)

.ci/scripts/wheel/test_macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
),
1818
test_base.ModelTest(
1919
model=Model.Mv3,
20-
backend=Backend.CoreMlTest,
20+
backend=Backend.CoreMlExportAndTest,
2121
),
2222
]
2323
)

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ jobs:
386386
echo "::endgroup::"
387387
388388
echo "::group::Build ExecuTorch iOS frameworks"
389-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
390-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
389+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
391390
echo "::endgroup::"
392391
393392
# NB: Although exported models can be copied to this directory and bundled together with the

.github/workflows/apple.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ jobs:
154154
"backend_xnnpack"
155155
"kernels_custom"
156156
"kernels_optimized"
157-
"kernels_portable"
158157
"kernels_quantized"
158+
"threadpool"
159159
)
160160
161161
.ci/scripts/setup-conda.sh
@@ -173,8 +173,7 @@ jobs:
173173
backends/apple/mps/install_requirements.sh
174174
175175
# Build iOS Frameworks
176-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
177-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
176+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
178177
179178
# Bundle iOS Frameworks
180179
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
@@ -314,8 +313,7 @@ jobs:
314313
echo "::endgroup::"
315314
316315
echo "::group::Build ExecuTorch iOS frameworks"
317-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
318-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
316+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
319317
echo "::endgroup::"
320318
321319
echo "::group::Build ExecuTorch benchmark app"

.github/workflows/build-presets.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
preset: [macos-arm64, pybind, llm]
23+
preset: [macos, ios, ios-simulator, pybind, llm]
2424
with:
2525
job-name: build
2626
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
preset: [pybind, llm]
42+
preset: [linux, pybind, llm]
4343
runner: [linux.2xlarge, linux.arm64.2xlarge]
4444
docker-image: [executorch-ubuntu-22.04-clang12, executorch-ubuntu-22.04-gcc11-aarch64]
4545
# Excluding specific runner + docker image combinations that don't make sense:
@@ -66,3 +66,30 @@ jobs:
6666
./install_requirements.sh > /dev/null
6767
cmake --preset ${{ matrix.preset }}
6868
cmake --build cmake-out -j$(( $(nproc) - 1 ))
69+
70+
windows:
71+
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
preset: [pybind]
76+
with:
77+
job-name: build
78+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
79+
submodules: recursive
80+
timeout: 90
81+
script: |
82+
set -eux
83+
conda init powershell
84+
powershell -Command "& {
85+
\$ErrorActionPreference = 'Stop'
86+
Set-PSDebug -Trace 1
87+
88+
conda create --yes --quiet -n et python=3.12
89+
conda activate et
90+
91+
python install_requirements.py
92+
cmake --preset ${{ matrix.preset }}
93+
\$numCores = [System.Environment]::GetEnvironmentVariable('NUMBER_OF_PROCESSORS') - 1
94+
cmake --build cmake-out -j \$numCores
95+
}"

.github/workflows/trunk.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -692,29 +692,3 @@ jobs:
692692
build-mode: Release
693693
build-tool: cmake
694694
docker-image: executorch-ubuntu-22.04-clang12
695-
696-
unittest-nxp-neutron:
697-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
698-
permissions:
699-
id-token: write
700-
contents: read
701-
with:
702-
runner: linux.2xlarge
703-
docker-image: executorch-ubuntu-22.04-clang12
704-
submodules: 'true'
705-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
706-
timeout: 90
707-
script: |
708-
set -eux
709-
710-
# The generic Linux job chooses to use base env, not the one setup by the image
711-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
712-
conda activate "${CONDA_ENV}"
713-
714-
# Build and install Executorch
715-
PYTHON_EXECUTABLE=python \
716-
CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \
717-
.ci/scripts/setup-linux.sh --build-tool "cmake"
718-
719-
# Run pytest
720-
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@
6767
[submodule "shim"]
6868
path = shim
6969
url = https://github.com/facebook/buck2-shims-meta
70+
[submodule "third-party/json"]
71+
path = third-party/json
72+
url = https://github.com/nlohmann/json.git

.lintrunner.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,20 +386,14 @@ exclude_patterns = [
386386
"third-party/**",
387387
# TODO: remove exceptions as we migrate
388388
# backends
389-
"backends/arm/quantizer/**",
390-
"backends/arm/test/ops/**",
391389
"backends/vulkan/quantizer/**",
392390
"backends/vulkan/test/**",
393-
"backends/cadence/aot/quantizer/**",
394-
"backends/qualcomm/quantizer/**",
395-
"examples/qualcomm/**",
396391
"backends/xnnpack/quantizer/**",
397392
"backends/xnnpack/test/**",
398393
"exir/tests/test_passes.py",
399394
"extension/llm/export/builder.py",
400395
"extension/llm/export/quantizer_lib.py",
401396
"exir/tests/test_memory_planning.py",
402-
"backends/transforms/duplicate_dynamic_quant_chain.py",
403397
"exir/backend/test/demos/test_xnnpack_qnnpack.py",
404398
]
405399

CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ else()
143143
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
144144
endif()
145145

146+
if(EXECUTORCH_BUILD_TESTS)
147+
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
148+
include(CTest)
149+
endif()
150+
146151
add_subdirectory(third-party)
147152

148153
if(EXECUTORCH_BUILD_EXTENSION_TRAINING)
@@ -254,11 +259,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
254259
)
255260
endif()
256261

257-
if(EXECUTORCH_BUILD_TESTS)
258-
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
259-
include(CTest)
260-
endif()
261-
262262
# TODO(dbort): Fix these warnings and remove this flag.
263263
set(_common_compile_options -Wno-deprecated-declarations -fPIC)
264264

@@ -472,11 +472,6 @@ install(
472472
)
473473
install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTorch)
474474

475-
# Add googletest if any test targets should be built
476-
if(BUILD_TESTING)
477-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/googletest)
478-
endif()
479-
480475
if(EXECUTORCH_BUILD_ARM_BAREMETAL)
481476
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/arm)
482477
endif()
@@ -565,8 +560,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
565560
endif()
566561

567562
if(EXECUTORCH_BUILD_PYBIND)
568-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11)
569-
570563
if(NOT EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
571564
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
572565
endif()
@@ -602,7 +595,7 @@ if(EXECUTORCH_BUILD_PYBIND)
602595
list(APPEND _dep_libs portable_ops_lib)
603596
endif()
604597

605-
if(EXECUTORCH_BUILD_COREML)
598+
if(EXECUTORCH_BUILD_COREML AND APPLE)
606599
list(APPEND _dep_libs coremldelegate)
607600
endif()
608601

@@ -701,7 +694,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
701694
list(APPEND _executor_runner_libs etdump flatccrt)
702695
endif()
703696

704-
if(EXECUTORCH_BUILD_COREML)
697+
if(EXECUTORCH_BUILD_COREML AND APPLE)
705698
list(APPEND _executor_runner_libs coremldelegate)
706699
endif()
707700

CMakePresets.json

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"binaryDir": "${sourceDir}/cmake-out"
88
},
99
{
10-
"name": "macos-arm64",
11-
"displayName": "Build everything buildable on macOS arm64",
10+
"name": "macos",
11+
"displayName": "Build everything buildable on macOS",
1212
"inherits": ["common"],
1313
"generator": "Xcode",
1414
"cacheVariables": {
1515
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake",
16-
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/macos-arm64.cmake",
16+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/macos.cmake",
1717
"PLATFORM": "MAC_ARM64",
1818
"DEPLOYMENT_TARGET": "10.15"
1919
},
@@ -23,6 +23,54 @@
2323
"rhs": "Darwin"
2424
}
2525
},
26+
{
27+
"name": "ios",
28+
"displayName": "Build everything buildable on iOS",
29+
"inherits": ["common"],
30+
"generator": "Xcode",
31+
"cacheVariables": {
32+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake",
33+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/ios.cmake",
34+
"PLATFORM": "OS64",
35+
"DEPLOYMENT_TARGET": "17.0"
36+
},
37+
"condition": {
38+
"lhs": "${hostSystemName}",
39+
"type": "equals",
40+
"rhs": "Darwin"
41+
}
42+
},
43+
{
44+
"name": "ios-simulator",
45+
"displayName": "Build everything buildable on iOS simulator",
46+
"inherits": ["common"],
47+
"generator": "Xcode",
48+
"cacheVariables": {
49+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake",
50+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/ios.cmake",
51+
"PLATFORM": "SIMULATORARM64",
52+
"DEPLOYMENT_TARGET": "17.0"
53+
},
54+
"condition": {
55+
"lhs": "${hostSystemName}",
56+
"type": "equals",
57+
"rhs": "Darwin"
58+
}
59+
},
60+
{
61+
"name": "linux",
62+
"displayName": "Build everything buildable on Linux",
63+
"inherits": ["common"],
64+
"cacheVariables": {
65+
"CMAKE_SYSTEM_NAME": "Linux",
66+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/linux.cmake"
67+
},
68+
"condition": {
69+
"lhs": "${hostSystemName}",
70+
"type": "equals",
71+
"rhs": "Linux"
72+
}
73+
},
2674
{
2775
"name": "pybind",
2876
"displayName": "Build pybindings exported in the wheel",

0 commit comments

Comments
 (0)