From 792dee2402dece64a8d2e99b3572e6eb129c0ad3 Mon Sep 17 00:00:00 2001 From: Saoirse Stewart Date: Wed, 27 Aug 2025 10:28:42 +0100 Subject: [PATCH 1/2] Arm backend: Add VGF minimal example to out-of-box testing - Minor fixes to VGF minimal example --- .github/workflows/trunk.yml | 2 +- backends/arm/test/test_arm_ootb.sh | 9 ++++++ examples/arm/vgf_minimal_example.ipynb | 38 +++++++++++++++++++------- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index f03f3736588..05a23a4ef9a 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -422,7 +422,7 @@ jobs: source .ci/scripts/utils.sh install_executorch "--use-pt-pinned-commit" - .ci/scripts/setup-arm-baremetal-tools.sh + .ci/scripts/setup-arm-baremetal-tools.sh --enable-mlsdk-deps source examples/arm/ethos-u-scratch/setup_path.sh # Install requirements for converting notebooks diff --git a/backends/arm/test/test_arm_ootb.sh b/backends/arm/test/test_arm_ootb.sh index 186092e21f9..2776132473a 100755 --- a/backends/arm/test/test_arm_ootb.sh +++ b/backends/arm/test/test_arm_ootb.sh @@ -15,4 +15,13 @@ run_ootb_tests_ethos_u() { echo "${FUNCNAME}: PASS" } +run_ootb_tests_vgf() { + echo "$FUNCNAME: Running out-of-the-box tests for Arm VGF" + jupyter nbconvert \ + --to notebook \ + --execute examples/arm/vgf_minimal_example.ipynb + echo "${FUNCNAME}: PASS" +} + run_ootb_tests_ethos_u +run_ootb_tests_vgf diff --git a/examples/arm/vgf_minimal_example.ipynb b/examples/arm/vgf_minimal_example.ipynb index b16ca930a33..747c49ed04a 100644 --- a/examples/arm/vgf_minimal_example.ipynb +++ b/examples/arm/vgf_minimal_example.ipynb @@ -23,13 +23,11 @@ "\n", "Before you begin:\n", "1. (In a clean virtual environment with a compatible Python version) Install executorch using `./install_executorch.sh`\n", - "2. Install MLSDK and Tosa using `examples/arm/setup.sh --disable-ethos-u-deps --enable-mlsdk-deps (For further guidance, refer to https://docs.pytorch.org/executorch/main/tutorial-arm.html)\n", + "2. Install MLSDK and Tosa using `examples/arm/setup.sh --disable-ethos-u-deps --enable-mlsdk-deps` (For further guidance, refer to https://docs.pytorch.org/executorch/main/tutorial-arm.html)\n", "3. Export vulkan environment variables and add MLSDK components to PATH and LD_LIBRARY_PATH using `examples/arm/ethos-u-scratch/setup_path.sh`\n", "\n", "With all commands executed from the base `executorch` folder.\n", "\n", - "\n", - "\n", "*Some scripts in this notebook produce long output logs: Configuring the 'Customizing Notebook Layout' settings to enable 'Output:scrolling' and setting 'Output:Text Line Limit' makes this more manageable*" ] }, @@ -165,6 +163,17 @@ "All of this happens behind the scenes in `to_edge_transform_and_lower`. Printing the graph module shows that what is left in the graph is two quantization nodes for `x` and `y` going into an `executorch_call_delegate` node, followed by a dequantization node." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%bash\n", + "# Ensure the vulkan environment variables and MLSDK components are available on $PATH\n", + "source ethos-u-scratch/setup_path.sh" + ] + }, { "cell_type": "code", "execution_count": null, @@ -220,10 +229,21 @@ "\n", "\n", "After the AOT compilation flow is done, we need to build the executor_runner target. For this example the generic version will be used.\n", - "To do this, please ensure the following commands are executed before moving onto the next step.\n", + "To do this, please ensure the following commands are executed before moving onto the next step." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%bash\n", + "# Ensure the vulkan environment variables and MLSDK components are available on $PATH\n", + "source ethos-u-scratch/setup_path.sh\n", "\n", - "Clean and configure the CMake build system. Compiled programs will appear in the executorch/cmake-out directory we create here.\n", - "```\n", + "# Compiled programs will appear in the executorch/cmake-out directory we create here.\n", + "# Build example executor runner application to examples/arm/vgf_minimal_example\n", "cmake \\\n", " -DCMAKE_INSTALL_PREFIX=cmake-out \\\n", " -DCMAKE_BUILD_TYPE=Debug \\\n", @@ -237,11 +257,9 @@ " -DEXECUTORCH_BUILD_VGF=ON \\\n", " -DEXECUTORCH_ENABLE_LOGGING=ON \\\n", " -DPYTHON_EXECUTABLE=python \\\n", - " -Bcmake-out .\n", - "```\n", + " -B../../cmake-out ../..\n", "\n", - "Build the executor_runner target\n", - "`cmake --build cmake-out --target executor_runner`\n" + "cmake --build ../../cmake-out --target executor_runner" ] }, { From 626e3c2c92ccfb9362e0d35f66009d181ee446c7 Mon Sep 17 00:00:00 2001 From: Github Executorch Date: Fri, 5 Sep 2025 10:56:25 +0100 Subject: [PATCH 2/2] Arm backend: Minor fixes to VGF notebook - remove from .ci testing for now --- .github/workflows/trunk.yml | 2 +- backends/arm/test/test_arm_ootb.sh | 9 --------- examples/arm/vgf_minimal_example.ipynb | 4 ++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 05a23a4ef9a..f03f3736588 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -422,7 +422,7 @@ jobs: source .ci/scripts/utils.sh install_executorch "--use-pt-pinned-commit" - .ci/scripts/setup-arm-baremetal-tools.sh --enable-mlsdk-deps + .ci/scripts/setup-arm-baremetal-tools.sh source examples/arm/ethos-u-scratch/setup_path.sh # Install requirements for converting notebooks diff --git a/backends/arm/test/test_arm_ootb.sh b/backends/arm/test/test_arm_ootb.sh index 2776132473a..186092e21f9 100755 --- a/backends/arm/test/test_arm_ootb.sh +++ b/backends/arm/test/test_arm_ootb.sh @@ -15,13 +15,4 @@ run_ootb_tests_ethos_u() { echo "${FUNCNAME}: PASS" } -run_ootb_tests_vgf() { - echo "$FUNCNAME: Running out-of-the-box tests for Arm VGF" - jupyter nbconvert \ - --to notebook \ - --execute examples/arm/vgf_minimal_example.ipynb - echo "${FUNCNAME}: PASS" -} - run_ootb_tests_ethos_u -run_ootb_tests_vgf diff --git a/examples/arm/vgf_minimal_example.ipynb b/examples/arm/vgf_minimal_example.ipynb index 747c49ed04a..bac75b8b73a 100644 --- a/examples/arm/vgf_minimal_example.ipynb +++ b/examples/arm/vgf_minimal_example.ipynb @@ -257,9 +257,9 @@ " -DEXECUTORCH_BUILD_VGF=ON \\\n", " -DEXECUTORCH_ENABLE_LOGGING=ON \\\n", " -DPYTHON_EXECUTABLE=python \\\n", - " -B../../cmake-out ../..\n", + " -B../../cmake-out-vkml ../..\n", "\n", - "cmake --build ../../cmake-out --target executor_runner" + "cmake --build ../../cmake-out-vkml --target executor_runner" ] }, {