Skip to content

Commit 54f1a5a

Browse files
committed
Update on "Dtype selective build: disable when not in xplat and add fail msg"
^ Differential Revision: [D75256223](https://our.internmc.facebook.com/intern/diff/D75256223/) [ghstack-poisoned]
2 parents 70aa580 + 4cf120e commit 54f1a5a

File tree

287 files changed

+10251
-6794
lines changed

Some content is hidden

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

287 files changed

+10251
-6794
lines changed

.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/build_llama_android.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ install_executorch_and_backend_lib() {
2222
ANDROID_NDK=/opt/ndk
2323
BUCK2=buck2
2424
ANDROID_ABI=arm64-v8a
25-
cmake -DBUCK2="${BUCK2}" \
25+
cmake --preset llm \
26+
-DBUCK2="${BUCK2}" \
2627
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
2728
-DANDROID_ABI="${ANDROID_ABI}" \
2829
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
2930
-DCMAKE_BUILD_TYPE=Release \
30-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
31-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
32-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
33-
-DEXECUTORCH_BUILD_XNNPACK=ON \
34-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
35-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
36-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
3731
-DXNNPACK_ENABLE_ARM_BF16=OFF \
3832
-Bcmake-android-out .
3933

@@ -51,11 +45,7 @@ build_llama_runner() {
5145
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK"/build/cmake/android.toolchain.cmake \
5246
-DANDROID_ABI="${ANDROID_ABI}" \
5347
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
54-
-DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=python \
55-
-DEXECUTORCH_BUILD_XNNPACK=ON \
56-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
57-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
58-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
48+
-DCMAKE_BUILD_TYPE=Release \
5949
-Bcmake-android-out/examples/models/llama examples/models/llama
6050

6151
cmake --build cmake-android-out/examples/models/llama -j4 --config Release

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,11 @@ which "${PYTHON_EXECUTABLE}"
152152
cmake_install_executorch_libraries() {
153153
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
154154
rm -rf cmake-out
155-
retry cmake \
155+
retry cmake --preset llm \
156156
-DCMAKE_INSTALL_PREFIX=cmake-out \
157157
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
158-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
159-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
160-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
161-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
162-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
163-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
164-
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
165-
-DEXECUTORCH_BUILD_MPS="$MPS" \
166-
-DEXECUTORCH_BUILD_COREML="$COREML" \
167158
-DEXECUTORCH_BUILD_QNN="$QNN" \
168159
-DQNN_SDK_ROOT="$QNN_SDK_ROOT" \
169-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
170160
-Bcmake-out .
171161
cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE"
172162
}
@@ -181,10 +171,6 @@ cmake_build_llama_runner() {
181171
retry cmake \
182172
-DCMAKE_INSTALL_PREFIX=cmake-out \
183173
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
184-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
185-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
186-
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
187-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
188174
-Bcmake-out/${dir} \
189175
${dir}
190176
cmake --build cmake-out/${dir} -j9 --config "$CMAKE_BUILD_TYPE"

.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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
"kernels_optimized"
157157
"kernels_portable"
158158
"kernels_quantized"
159+
"threadpool"
159160
)
160161
161162
.ci/scripts/setup-conda.sh
@@ -173,8 +174,7 @@ jobs:
173174
backends/apple/mps/install_requirements.sh
174175
175176
# 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
177+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
178178
179179
# Bundle iOS Frameworks
180180
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
@@ -314,8 +314,7 @@ jobs:
314314
echo "::endgroup::"
315315
316316
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
317+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
319318
echo "::endgroup::"
320319
321320
echo "::group::Build ExecuTorch benchmark app"

.github/workflows/build-presets.yml

Lines changed: 31 additions & 4 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]
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 }}
@@ -32,14 +32,14 @@ jobs:
3232
set -eux
3333
${CONDA_RUN} ./install_requirements.sh > /dev/null
3434
${CONDA_RUN} cmake --preset ${{ matrix.preset }}
35-
${CONDA_RUN} cmake --build cmake-out --parallel
35+
${CONDA_RUN} cmake --build cmake-out -j$(( $(sysctl -n hw.ncpu) - 1 ))
3636
3737
linux:
3838
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
preset: [pybind]
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:
@@ -65,4 +65,31 @@ jobs:
6565
6666
./install_requirements.sh > /dev/null
6767
cmake --preset ${{ matrix.preset }}
68-
cmake --build cmake-out --parallel
68+
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+
}"

.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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
565565
endif()
566566

567567
if(EXECUTORCH_BUILD_PYBIND)
568-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11)
569-
570568
if(NOT EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
571569
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
572570
endif()
@@ -602,7 +600,7 @@ if(EXECUTORCH_BUILD_PYBIND)
602600
list(APPEND _dep_libs portable_ops_lib)
603601
endif()
604602

605-
if(EXECUTORCH_BUILD_COREML)
603+
if(EXECUTORCH_BUILD_COREML AND APPLE)
606604
list(APPEND _dep_libs coremldelegate)
607605
endif()
608606

@@ -701,7 +699,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
701699
list(APPEND _executor_runner_libs etdump flatccrt)
702700
endif()
703701

704-
if(EXECUTORCH_BUILD_COREML)
702+
if(EXECUTORCH_BUILD_COREML AND APPLE)
705703
list(APPEND _executor_runner_libs coremldelegate)
706704
endif()
707705

CMakePresets.json

Lines changed: 71 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",
@@ -36,6 +84,26 @@
3684
"string": "${hostSystemName}",
3785
"list": ["Darwin", "Linux", "Windows"]
3886
}
87+
},
88+
{
89+
"name": "llm",
90+
"displayName": "Build LLM libraries",
91+
"inherits": [
92+
"common"
93+
],
94+
"cacheVariables": {
95+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/llm.cmake",
96+
"CMAKE_OSX_DEPLOYMENT_TARGET": "10.15"
97+
},
98+
"condition": {
99+
"type": "inList",
100+
"string": "${hostSystemName}",
101+
"list": [
102+
"Darwin",
103+
"Linux",
104+
"Windows"
105+
]
106+
}
39107
}
40108
]
41109
}

0 commit comments

Comments
 (0)