Enable Arm VGF delegate in pybind builds#19223
Conversation
- Enable VGF in pybind build if directed by env var. - Use VGF pybind in the wheel builds, based on package availability. This tidies up vgf with runtime installation further to the following: 1. developer flows ./examples/arm/setup.sh --enable-mlsdk-deps export EXECUTORCH_PYBIND_ENABLE_VGF=ON ./install_executorch.sh --editable --optional-dependency vgf 2. wheel builds: # will invoke .ci/scripts/wheel/pre_build_script.sh # suitable platforms have EXECUTORCH_PYBIND_ENABLE_VGF=ON set 3. end users: pip install executorch[vgf] # published wheels contain runtime delegate on supported platforms I'd still like to remove emulation_layer from the requirements as a platform setup item (vulkan and emulated vs real is a property of the platform we land on, not our problem to solve). Change-Id: I63caf3a3691022c83468a9c45f30884222779d33 Signed-off-by: Rob Elliott <Robert.Elliott@arm.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19223
Note: Links to docs will display an error until the docs builds have been completed. ❌ 258 New Failures, 17 Unrelated FailuresAs of commit f96ed0e with merge base d6f1625 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Adds an opt-in mechanism to build and ship the Arm VGF delegate in Python (pybind) builds, including CI wheel builds that can gracefully fall back when VGF inputs aren’t available.
Changes:
- Gate
EXECUTORCH_BUILD_VGF(and currently also Vulkan) in the pybind preset viaEXECUTORCH_PYBIND_ENABLE_VGF. - Split Arm VGF pip requirements into AoT vs runtime (
requirements-arm-vgf.txtvs newrequirements-arm-vgf-runtime.txt) and update Arm setup flow accordingly. - Update wheel pre-build script to enable VGF when the runtime pip package can be installed.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/cmake/preset/pybind.cmake | Adds env-var-driven enablement for VGF (and Vulkan) in pybind preset on Linux/macOS. |
| examples/arm/setup.sh | Installs Arm VGF AoT vs runtime pip dependencies based on selected flags. |
| backends/arm/scripts/setup-mlsdk-from-source.sh | Updates “keep in sync” comment to include the new runtime requirements file. |
| backends/arm/requirements-arm-vgf.txt | Removes ai_ml_sdk_vgf_library from the AoT requirements list. |
| backends/arm/requirements-arm-vgf-runtime.txt | New runtime requirements file for VGF library pip dependency. |
| CMakeLists.txt | Links vgf_backend into pybind _dep_libs when VGF is enabled. |
| .ci/scripts/wheel/pre_build_script.sh | Attempts to install VGF runtime pip package and sets env var to enable VGF in wheel builds if available. |
Comments suppressed due to low confidence (1)
backends/arm/requirements-arm-vgf.txt:10
- After removing
ai_ml_sdk_vgf_libraryfrom this requirements file, it no longer represents the full set of deps implied by thevgfextra inpyproject.toml(which also includesml_dtypesandtosa-tools). Since this file is referenced as something that should be kept in sync with packaging metadata, consider either (a) updatingpyproject.toml/extras to reflect the split between AoT vs runtime deps, or (b) clarifying in this file (and its header comment) that it is only the AoT subset and is not expected to matchpyproject.tomlexactly.
ai_ml_emulation_layer_for_vulkan == 0.9.0
ai_ml_sdk_model_converter == 0.9.0
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set(_executorch_pybind_enable_vgf OFF) | ||
| if(DEFINED ENV{EXECUTORCH_PYBIND_ENABLE_VGF}) | ||
| set(_executorch_pybind_enable_vgf "$ENV{EXECUTORCH_PYBIND_ENABLE_VGF}") | ||
| endif() |
There was a problem hiding this comment.
If EXECUTORCH_PYBIND_ENABLE_VGF is defined but empty, _executorch_pybind_enable_vgf becomes an empty string and later set_overridable_option(... ${_executorch_pybind_enable_vgf}) will expand to a missing argument, causing a CMake configure error. Consider normalizing the env var (treat empty as OFF) and/or quoting the variable when passing it to set_overridable_option so an empty value is still a valid argument.
Signed-off-by: Rob Elliott <Robert.Elliott@arm.com> Change-Id: I5680de25e7a004ac6883bd4f855baee1bf6b4874
Change-Id: I63caf3a3691022c83468a9c45f30884222779d33
Summary
This adds VGF runtime delegate to end pip installs, and gives the option for ./install_executorch.sh to include it for developer side.
It'll need some testing of the wheel building to check that works reliably, but it's designed to fall back to the "normal" wheel builds if the dependencies aren't available.
This tidies up vgf with runtime installation further to the following:
developer flows ./examples/arm/setup.sh --enable-mlsdk-deps export EXECUTORCH_PYBIND_ENABLE_VGF=ON ./install_executorch.sh --editable --optional-dependency vgf
wheel builds: # will invoke .ci/scripts/wheel/pre_build_script.sh # suitable platforms have EXECUTORCH_PYBIND_ENABLE_VGF=ON set
end users: pip install executorch[vgf] # published wheels contain runtime delegate on supported platforms
I'd still like to remove emulation_layer from the requirements as a platform setup item (vulkan and emulated vs real is a property of the platform we land on, not our problem to solve).
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson