Skip to content

Commit 32b21f9

Browse files
authored
Merge branch 'main' into migrate-xnnpack-vulkan
2 parents 37b2564 + 52d7778 commit 32b21f9

37 files changed

+505
-886
lines changed

.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"

.github/workflows/build-presets.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
preset: [macos-arm64, pybind]
23+
preset: [macos-arm64, pybind, llm]
2424
with:
2525
job-name: build
2626
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2727
runner: macos-latest-xlarge
2828
python-version: 3.12
2929
submodules: recursive
30-
timeout: 90
30+
timeout: 900
3131
script: |
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 -j16
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: [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:

CMakePresets.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@
3636
"string": "${hostSystemName}",
3737
"list": ["Darwin", "Linux", "Windows"]
3838
}
39+
},
40+
{
41+
"name": "llm",
42+
"displayName": "Build LLM libraries",
43+
"inherits": [
44+
"common"
45+
],
46+
"cacheVariables": {
47+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/llm.cmake",
48+
"CMAKE_OSX_DEPLOYMENT_TARGET": "10.15"
49+
},
50+
"condition": {
51+
"type": "inList",
52+
"string": "${hostSystemName}",
53+
"list": [
54+
"Darwin",
55+
"Linux",
56+
"Windows"
57+
]
58+
}
3959
}
4060
]
4161
}

backends/qualcomm/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ target_link_libraries(qnn_executorch_logging PRIVATE qnn_schema)
153153
target_link_libraries(qnn_profiler PRIVATE qnn_executorch_logging)
154154
target_link_libraries(qnn_logger PRIVATE qnn_implementation ${android_log})
155155
target_link_libraries(qnn_backend PRIVATE qnn_implementation qnn_logger)
156-
target_link_libraries(qnn_custom_protocol PRIVATE qcir_utils)
156+
target_link_libraries(qnn_custom_protocol PRIVATE qnn_logger)
157157
target_link_libraries(
158158
qnn_device PRIVATE qnn_executorch_logging qnn_implementation qnn_logger
159159
)
160160
target_link_libraries(
161-
qnn_backend_cache PRIVATE qnn_sys_implementation qcir_utils
161+
qnn_backend_cache PRIVATE qnn_sys_implementation
162162
)
163163
target_link_libraries(
164164
qnn_context PRIVATE qnn_implementation qnn_logger qnn_backend qnn_device
@@ -184,7 +184,7 @@ target_link_libraries(
184184
)
185185
target_link_libraries(
186186
qnn_executorch_backend PRIVATE qnn_executorch_header qnn_schema qnn_manager
187-
executorch_core qcir_utils extension_tensor
187+
executorch_core extension_tensor
188188
)
189189
set_target_properties(
190190
qnn_executorch_backend PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"
@@ -243,7 +243,6 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
243243
qnn_manager
244244
qnn_executorch_header
245245
executorch
246-
qcir_utils
247246
extension_tensor
248247
)
249248
target_link_libraries(

backends/qualcomm/aot/python/PyQnnManagerAdaptor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ PYBIND11_MODULE(PyQnnManagerAdaptor, m) {
3030
py::class_<PyQnnManager, std::shared_ptr<PyQnnManager>>(m, "QnnManager")
3131
.def(py::init<const py::bytes&>())
3232
.def(py::init<const py::bytes&, const py::bytes&>())
33-
.def(py::init<const py::bytes&, const py::list&>())
3433
.def("Init", &PyQnnManager::Init)
3534
.def("IsNodeSupportedByBackend", &PyQnnManager::IsNodeSupportedByBackend)
36-
.def("Compile", py::overload_cast<>(&PyQnnManager::Compile))
3735
.def(
3836
"Compile",
3937
py::overload_cast<
40-
const std::string&,
41-
std::vector<std::shared_ptr<OpWrapper>>&>(&PyQnnManager::Compile))
38+
const std::vector<std::string>&,
39+
std::vector<std::vector<std::shared_ptr<OpWrapper>>>&>(
40+
&PyQnnManager::Compile))
4241
.def("Destroy", &PyQnnManager::Destroy)
4342
.def("IsAvailable", &PyQnnManager::IsAvailable)
4443
.def("IsTensorDump", &PyQnnManager::IsTensorDump)

0 commit comments

Comments
 (0)