Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .ci/scripts/wheel/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# Copyright 2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

Expand Down Expand Up @@ -57,6 +59,18 @@ fi

"${GITHUB_WORKSPACE}/${REPOSITORY}/install_requirements.sh" --example

# Enable VGF in pybind wheel builds when the platform-specific build input is
# available from pip.
if [[ "$UNAME_S" == "Linux" || "$UNAME_S" == "Darwin" ]]; then
if python3 -m pip install -r \
"${GITHUB_WORKSPACE}/${REPOSITORY}/backends/arm/requirements-arm-vgf-runtime.txt"; then
export EXECUTORCH_PYBIND_ENABLE_VGF=ON
echo "EXECUTORCH_PYBIND_ENABLE_VGF=ON" >> "${GITHUB_ENV}"
else
echo "VGF build dependency unavailable on this platform; building without VGF"
fi
fi

# Download Qualcomm QNN SDK on Linux x86_64 so the wheel build can include the
# QNN backend. The SDK is large, so we download it here (outside CMake) rather
# than during cmake configure.
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,10 @@ if(EXECUTORCH_BUILD_PYBIND)
list(APPEND _dep_libs coremldelegate)
endif()

if(EXECUTORCH_BUILD_VGF)
list(APPEND _dep_libs vgf_backend)
endif()

if(EXECUTORCH_BUILD_MPS)
list(APPEND _dep_libs mpsdelegate)
endif()
Expand Down
3 changes: 3 additions & 0 deletions backends/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ if(EXECUTORCH_BUILD_VGF)
set(_vgf_backend_sources backends/arm/runtime/VGFBackend.cpp
backends/arm/runtime/VGFSetup.cpp
)
if(NOT EXECUTORCH_BUILD_VULKAN)
list(APPEND _vgf_backend_sources backends/vulkan/third-party/volk/volk.c)
endif()

# vgf backend
list(TRANSFORM _vgf_backend_sources PREPEND "${EXECUTORCH_ROOT}/")
Expand Down
8 changes: 8 additions & 0 deletions backends/arm/requirements-arm-vgf-runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Runtime build dependencies for the Arm VGF backend.

ai_ml_sdk_vgf_library == 0.9.0
1 change: 0 additions & 1 deletion backends/arm/requirements-arm-vgf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

ai_ml_emulation_layer_for_vulkan == 0.9.0
ai_ml_sdk_model_converter == 0.9.0
ai_ml_sdk_vgf_library == 0.9.0
2 changes: 1 addition & 1 deletion backends/arm/scripts/setup-mlsdk-from-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ root_dir="${et_dir}/examples/arm/arm-scratch"
setup_path_script=""
mlsdk_manifest_dir="ml-sdk-for-vulkan-manifest"
mlsdk_manifest_url="${MLSDK_MANIFEST_URL:-https://github.com/arm/ai-ml-sdk-manifest.git}"
mlsdk_manifest_tag="${MLSDK_MANIFEST_TAG:-refs/tags/v2026.03.0}" # Keep this in sync with what is mentioned in requirements-arm-vgf.txt
mlsdk_manifest_tag="${MLSDK_MANIFEST_TAG:-refs/tags/v2026.03.0}" # Keep this in sync with backends/arm/requirements-arm-vgf.txt and backends/arm/requirements-arm-vgf-runtime.txt

enable_model_converter=0
enable_vgf_lib=0
Expand Down
12 changes: 9 additions & 3 deletions examples/arm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function check_options() {
;;
--setup-test-dependency)
log_step "deps" "Installing test dependency..."
source $et_dir/backends/arm/scripts/install_models_for_test.sh
source "$et_dir/backends/arm/scripts/install_models_for_test.sh"
exit 0
;;
--help)
Expand All @@ -208,12 +208,18 @@ function setup_root_dir() {

function setup_ethos_u_tools() {
log_step "ethos-u-tools" "Installing Ethos-U Python tooling"
CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 pip install --no-dependencies -r $et_dir/backends/arm/requirements-arm-ethos-u.txt
CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 pip install --no-dependencies -r "$et_dir/backends/arm/requirements-arm-ethos-u.txt"
}

function setup_mlsdk_dependencies() {
log_step "mlsdk" "Installing MLSDK dependencies"
pip install -r $et_dir/backends/arm/requirements-arm-vgf.txt
if [[ "${enable_model_converter}" -eq 1 || "${enable_emulation_layer}" -eq 1 ]]; then
pip install -r "$et_dir/backends/arm/requirements-arm-vgf.txt"
fi

if [[ "${enable_vgf_lib}" -eq 1 ]]; then
pip install -r "$et_dir/backends/arm/requirements-arm-vgf-runtime.txt"
fi
Comment thread
robell marked this conversation as resolved.
}

function validate_mlsdk_pip_compatibility() {
Expand Down
15 changes: 15 additions & 0 deletions tools/cmake/preset/pybind.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# Copyright 2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand All @@ -25,9 +26,22 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP ON)
set_overridable_option(EXECUTORCH_BUILD_WHEEL_DO_NOT_USE ON)

# Optional VGF enable for the default pybind/install flow. This is intentionally
# scoped to this preset rather than acting as a general environment-to-CMake
# override mechanism.
set(_executorch_pybind_enable_vgf OFF)
if(DEFINED ENV{EXECUTORCH_PYBIND_ENABLE_VGF})
if("$ENV{EXECUTORCH_PYBIND_ENABLE_VGF}" STREQUAL "ON")
set(_executorch_pybind_enable_vgf ON)
else()
set(_executorch_pybind_enable_vgf OFF)
endif()
endif()

# TODO(larryliu0820): Temporarily disable building llm_runner for Windows wheel
# due to the issue of tokenizer file path length limitation.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_overridable_option(EXECUTORCH_BUILD_VGF ${_executorch_pybind_enable_vgf})
set_overridable_option(EXECUTORCH_BUILD_COREML ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TRAINING ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON)
Expand All @@ -51,6 +65,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set_overridable_option(EXECUTORCH_BUILD_VGF ${_executorch_pybind_enable_vgf})
set_overridable_option(EXECUTORCH_BUILD_COREML ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TRAINING ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON)
Expand Down
Loading