Skip to content

Commit 93f0042

Browse files
Arm backend: Clarify which scripts are not part of public API (pytorch#20784)
Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
1 parent 9ed0238 commit 93f0042

13 files changed

Lines changed: 71 additions & 7 deletions

backends/arm/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ In addition, the following deployment paths are supported by this backend:
2323

2424
More information on TOSA can be found here: https://www.mlplatform.org/tosa/tosa_spec.html.
2525

26+
## Public API Boundary
27+
28+
The Arm backend public Python API is the set of symbols tracked in
29+
`backends/arm/public_api_manifests/api_manifest_running.toml`. Other modules,
30+
helpers, scripts, and directory layouts in this subtree are implementation
31+
details and may change without deprecation.
32+
33+
In particular, `backends/arm/tosa` contains shared lowering implementation for
34+
Arm backends. It is not a stable public package except for symbols explicitly
35+
listed in the public API manifest. Prefer the target-specific public APIs in
36+
`executorch.backends.arm.ethosu` and `executorch.backends.arm.vgf` for
37+
application code.
38+
2639
## Directory Layout
2740

2841
Below is an overview of the key folder and files in this directory:

backends/arm/scripts/TOSA_minimal_example.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"\n",
2121
"This guide walks through the complete process of running a module on Arm TOSA using ExecuTorch, with a focus on TOSA lowering exploration. \n",
2222
"This workflow is intended for validating and experimenting with model lowering to TOSA, and is aimed at contributors and developers, rather than production deployment.\n",
23+
"This notebook uses code that is not part of the stable public API. If the TOSA flow changes, this notebook should be checked and updated too.\n",
2324
"It’s important to note that the compilation flow and passes applied can vary based on the target, so this flow does not necessarily produce TOSA flatbuffers and PTE files which are optimal (or even compatible) with any one target.\n",
2425
"If something is not working for you, please raise a GitHub issue and tag Arm.\n",
2526
"\n",

backends/arm/scripts/build_direct_drive_fvp.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
6+
#
7+
# Developer build helper. This command-line interface is not a public API and
8+
# may change without deprecation.
69

710
apply_patch_if_needed () {
811
local patch="$1"

backends/arm/scripts/build_executor_runner.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
6+
#
7+
# Developer build helper. This command-line interface is not a public API and
8+
# may change without deprecation.
69

710
set -eu
811

@@ -36,6 +39,7 @@ build_with_etdump_flags=" -DEXECUTORCH_ENABLE_EVENT_TRACER=OFF "
3639

3740
help() {
3841
echo "Usage: $(basename $0) [options]"
42+
echo "Note: this developer build script is not a stable public API."
3943
echo "Options:"
4044
echo " --pte=<PTE_FILE>|<ADDR>|semihosting Set to a pte file (generated by the aot_arm_compier) to include the model in the elf."
4145
echo " Or a hex address in the format of 0x00000000 if placed in memory you need to place it on this ADDR on your target, with your flash tool or other means."

backends/arm/scripts/build_executor_runner_vkml.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/usr/bin/env bash
2-
# Copyright 2025 Arm Limited and/or its affiliates.
2+
# Copyright 2025-2026 Arm Limited and/or its affiliates.
33
#
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
6+
#
7+
# Developer build helper. This command-line interface is not a public API and
8+
# may change without deprecation.
69

710
set -eu
811

@@ -23,11 +26,12 @@ source "${script_dir}/utils.sh"
2326

2427
help() {
2528
echo "Usage: $(basename $0) [options]"
29+
echo "Note: this developer build script is not a stable public API."
2630
echo "Options:"
2731
echo " --build_type=<TYPE> Build with Release, Debug or RelWithDebInfo, default is ${build_type}"
2832
echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
2933
echo " --extra_build_flags=<FLAGS> Extra flags to pass to cmake. Default: none "
30-
echo " --output=<FOLDER> Output folder Default: $(output_folder)"
34+
echo " --output=<FOLDER> Output folder Default: ${output_folder}"
3135
echo " --bundleio Support BundleIO using Devtools with Input/RefOutput included"
3236
exit 0
3337
}

backends/arm/scripts/build_executorch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
6+
#
7+
# Developer build helper. This command-line interface is not a public API and
8+
# may change without deprecation.
69

710
# Optional parameter:
811
# --build_type= "Release" | "Debug" | "RelWithDebInfo" | "UndefinedSanitizer" | "AddressSanitizer"
@@ -30,6 +33,7 @@ target_cpu=""
3033

3134
help() {
3235
echo "Usage: $(basename $0) [options]"
36+
echo "Note: this developer build script is not a stable public API."
3337
echo "Options:"
3438
echo " --et_build_root=<FOLDER> Build output root folder to use, defaults to ${et_build_root}"
3539
echo " --build_type=<TYPE> Build with Release, Debug, RelWithDebInfo, UndefinedSanitizer or AddressSanitizer, default is ${build_type}"

backends/arm/tosa/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# Copyright 2025 Arm Limited and/or its affiliates.
1+
# Copyright 2025-2026 Arm Limited and/or its affiliates.
22
#
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55
#
6+
"""Shared TOSA lowering implementation for the Arm backend.
7+
8+
Only symbols listed in the Arm public API manifest are public API. Other
9+
modules under ``executorch.backends.arm.tosa`` are implementation details and
10+
may change without notice.
11+
12+
"""
613

714
from .specification import TosaSpecification
815

examples/arm/export_standalone_tosa_graph.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
""" This example demonstrates how to export a standalone TOSA graph with multiple outputs, where the outputs of the delegate
7-
are reordered during partitioning. The example uses a simple convolutional network with three outputs of different shapes,
8-
applies quantization, partitions for TOSA, and then checks the output shapes in the exported graph match the expected output
9-
shapes from the original FX graph. """
6+
"""Demonstrate standalone TOSA graph export with reordered delegate outputs.
7+
8+
This file is an example for contributors and lowering experiments. It uses
9+
TOSA implementation modules that are not public API unless the symbol is listed
10+
in the Arm public API manifest. Prefer target-specific public APIs for
11+
application code.
12+
13+
The example uses a simple convolutional network with three outputs of different
14+
shapes, applies quantization, partitions for TOSA, and then checks the output
15+
shapes in the exported graph match the expected output shapes from the original
16+
FX graph.
17+
18+
"""
1019

1120
import operator
1221

examples/arm/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#
77
# This source code is licensed under the BSD-style license found in the
88
# LICENSE file in the root directory of this source tree.
9+
#
10+
# Developer build-and-run helper. This command-line interface is not a public
11+
# API and may change without deprecation.
912

1013
set -eu
1114

@@ -58,6 +61,7 @@ parallel_jobs=1
5861

5962
function help() {
6063
echo "Usage: $(basename $0) [options]"
64+
echo "Note: this developer workflow script is not a stable public API."
6165
echo "Options:"
6266
echo " --model_name=<MODEL> Model file .py/.pth/.pt, builtin model or a model from examples/models. Passed to aot_arm_compiler"
6367
echo " --model_input=<INPUT> Provide model input .pt file to override the input in the model file. Passed to aot_arm_compiler"

examples/arm/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#
77
# This source code is licensed under the BSD-style license found in the
88
# LICENSE file in the root directory of this source tree.
9+
#
10+
# Developer setup helper. This command-line interface is not a public API and
11+
# may change without deprecation.
912

1013
set -u
1114

@@ -67,6 +70,7 @@ OPTION_LIST=(
6770

6871
function print_usage() {
6972
echo "Usage: $(basename "$0") [OPTIONS]"
73+
echo "Note: this developer setup script is not a stable public API."
7074
echo
7175
echo "Available options:"
7276
for entry in "${OPTION_LIST[@]}"; do

0 commit comments

Comments
 (0)