Skip to content

Commit 5ddbab2

Browse files
committed
Arm backend: Review documentation for 1.2
- Make sure API is up to date - Make sure paths are up to date - Rerun docgen - Typos Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: I3ad78fdfed3d60c76badc3ba794236372f3590da
1 parent 6db7f4c commit 5ddbab2

20 files changed

Lines changed: 101 additions & 337 deletions

backends/arm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ backends/arm/
5151
│ └── quantization_annotator.py # Defines how operators are annotated for quantization
5252
5353
├── runtime/ # Backends for running inference on target devices
54-
│ ├── ArmEthosUBackend.cpp
54+
│ ├── EthosUBackend.cpp
5555
│ └── VGFBackend.cpp
5656
5757
├── scripts/ # Auxiliary build, dependency installation and utility scripts

backends/arm/ethosu/partitioner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class EthosUPartitioner(TOSAPartitioner):
1717
"""Partitions subgraphs supported by the Arm Ethos-U backend.
1818
1919
Args:
20-
compile_spec: List of CompileSpec objects for Ethos-U backend.
20+
compile_spec: EthosUCompileSpec object for configuring the lowering.
2121
additional_checks: Optional sequence of additional operator support checks.
2222
2323
"""

backends/arm/scripts/docgen/ethos-u/backends-arm-ethos-u-overview.md.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ The target system must include an Ethos-U NPU.
2020

2121
```{tip}
2222
All requirements can be downloaded using `examples/arm/setup.sh --i-agree-to-the-contained-eula` and added to the path using
23-
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
2423
`source examples/arm/arm-scratch/setup_path.sh`. Note that this means accepting the End-User License Agreements (EULA:s) required for using the downloaded software.
2524
```
2625

backends/arm/scripts/docgen/ethos-u/backends-arm-ethos-u-quantization.md.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Currently, the symmetric `int8` config defined by `executorch.backends.arm.quant
99
The Arm Ethos-U delegate supports the following quantization schemes:
1010

1111
- 8-bit symmetric weights with 8-bit asymmetric activations (via the PT2E quantization flow).
12-
- Limited support for 16-bit quantization with 16-bit activations and 8-bit weights (a.k.a 16x8 quantization). This is under development.
13-
- Partial quantization is *not* supported on the Ethos-U backend. The entire model must be quantized.
12+
- Limited support for 16-bit quantization with 16-bit activations and 8-bit weights (a.k.a 16x8 quantization).
13+
- Limited support for 8-bit quantization with 8-bit activations and 4-bit weights (a.k.a. 8x4 quantization).
14+
- Partial quantization is supported by the quantizer, but non-quantized operators won't be delegated to the Ethos-U backend.
1415

1516
### Quantization API
1617

17-
$QUANTIZER
18+
$QUANTIZER

backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ And for building and running your application using the generic executor_runner:
3333
The [VGF Minimal Example](https://github.com/pytorch/executorch/blob/main/examples/arm/vgf_minimal_example.ipynb) demonstrates how to lower a module using the VGF backend.
3434

3535
The main configuration point for the lowering is the `VgfCompileSpec` consumed by the partitioner and quantizer.
36+
To extract the VGF file for integration into applications without the ExecuTorch runtime, use `VgfCompileSpec.dump_intermediate_artifacts_to()`.
3637
The full user-facing API is documented below.
3738

3839
$COMPILE_SPEC

backends/arm/scripts/docgen/vgf/vgf-getting-started-tutorial.md.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Make sure the executable is located where you expect, in the `examples/arm` tree
7373

7474
The ExecuTorch Ahead-of-Time (AOT) pipeline takes a PyTorch Model (a `torch.nn.Module`) and produces a `.pte` binary file, which is then typically consumed by the ExecuTorch Runtime. This [document](https://github.com/pytorch/executorch/blob/main/docs/source/getting-started-architecture.md) goes in much more depth about the ExecuTorch software stack for both AoT as well as Runtime.
7575

76-
The example below shows how to quantize a model consisting of a single addition, and export it it through the AOT flow using the VGF backend. For more details, se `examples/arm/vgf_minimal_example.ipynb`.
76+
The example below shows how to quantize a model consisting of a single addition, and export it through the AOT flow using the VGF backend. For more details, see `examples/arm/vgf_minimal_example.ipynb`.
7777

7878
$MINIMAL_EXAMPLE
7979

@@ -106,7 +106,7 @@ cmake \
106106
-DPYTHON_EXECUTABLE=python \
107107
-Bcmake-out .
108108

109-
cmake --build cmake-out --target executor_runner`
109+
cmake --build cmake-out --target executor_runner
110110
```
111111

112112

backends/arm/scripts/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ VERBS="Add|Fix|Update|Refactor|Improve|Remove|Change|Implement|Create|Modify|"\
3434
"Profile|Recalculate|Reconstruct|Redefine|Redesign|Reevaluate|Relocate|Remap|"\
3535
"Render|Reposition|Request|Revert|Sanitize|Specify|Strengthen|Stub|Substitute|"\
3636
"Tag|Tweak|Unify|Unlock|Unset|Use|Validate|Verify|Rename|Relax|Format|Don't|"\
37-
"Consolidate"
37+
"Consolidate|Review"
3838

3939
# Remote branch
4040
REMOTE=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)

backends/cortex_m/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
The Cortex-M backend is implemented as an operator dialect/library based on [CMSIS-NN](https://github.com/ARM-software/CMSIS-NN), together with the `CortexMQuantizer` which targets supported ops, and the `CortexMPassManager` which modifies the exported program to use Cortex-M operators where possible. It is intended for use with **channels-last input** since this is what the accelerated kernels are using.
99

10-
For a detailed example of the full lowering flow, see `examples/arm/cortex_m_minimal_example.ipynb`.
10+
For a detailed example of the full lowering flow, see `examples/arm/cortex_m_mv2_example.ipynb`.
1111

1212
## Testing
13-
Tests are available in `backends/cortex-m/test/` using the `backends/test` harness. The python implementations of the operators are tested in tests named `test_dialect_*`, while actual accelerated implementations are tested on simulated hardware in the tests named `test_implementation_*`.
13+
Tests are available in `backends/cortex_m/test/` using the `backends/test` harness. The python implementations of the operators are tested in tests named `test_dialect_*`, while actual accelerated implementations are tested on simulated hardware in the tests named `test_implementation_*`.
1414

1515
To run tests:
1616
```
1717
examples/arm/setup.sh --i-agree-to-the-contained-eula # Download needed toolchains and simulators
1818
examples/arm/arm-scratch/setup_path.sh # Add dependencies to path
19-
backends/cortex-m/test/build_test_runner.sh # Build executor-runner with cortex-m oplib + kernels registred
20-
pytest --config-file=backends/arm/test/pytest.ini backends/cortex-m/test # Run tests with correct configuration file
19+
backends/cortex_m/test/build_test_runner.sh # Build executor-runner with cortex-m oplib + kernels registred
20+
pytest --config-file=backends/arm/test/pytest.ini backends/cortex_m/test # Run tests with correct configuration file
2121
```
2222

2323
## Supported operators
24-
Refer to `backends/cortex-m/test/ops` for currently supported accelerated ops/dtypes. Additionally, the quantizer targets pure "data-movement ops" such as data copies, slicing and concatinations to use quantized dtypes using the portable-kernels operator lbrary.
24+
Refer to `backends/cortex_m/test/ops` for currently supported accelerated ops/dtypes. Additionally, the quantizer targets pure "data-movement ops" such as data copies, slicing and concatenations to use quantized dtypes using the portable-kernels operator library.
2525
In general however, operators not supported by Cortex-M are kept in `fp32` using non-accelerated portable-kernels. It is recommended to analyze the graph after lowering to understand how much of the graph has been accelerated.
2626

2727
## Notices

docs/source/backends/arm-ethos-u/arm-ethos-u-overview.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ The target system must include an Ethos-U NPU.
2020

2121
```{tip}
2222
All requirements can be downloaded using `examples/arm/setup.sh --i-agree-to-the-contained-eula` and added to the path using
23-
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
2423
`source examples/arm/arm-scratch/setup_path.sh`. Note that this means accepting the End-User License Agreements (EULA:s) required for using the downloaded software.
2524
```
2625

@@ -68,15 +67,17 @@ Args:
6867
```python
6968
def EthosUCompileSpec.dump_intermediate_artifacts_to(self, output_path: str | None):
7069
```
71-
Sets a path for dumping intermediate results during such as tosa and pte.
70+
Sets a path for dumping intermediate results during such as tosa and
71+
pte.
7272

7373
Args:
7474
- **output_path**: Path to dump intermediate results to.
7575

7676
```python
7777
def EthosUCompileSpec.get_intermediate_path(self) -> str | None:
7878
```
79-
Gets the path used for dumping intermediate results such as tosa and pte.
79+
Gets the path used for dumping intermediate results such as tosa and
80+
pte.
8081

8182
Returns:
8283
Path where intermediate results are saved.
@@ -94,7 +95,9 @@ Gets whether the output order workaround is being applied.
9495
```python
9596
def EthosUCompileSpec.get_pass_pipeline_config(self) -> executorch.backends.arm.common.pipeline_config.ArmPassPipelineConfig:
9697
```
97-
Returns configuration that controls how the Arm pass pipeline should behave.
98+
Returns configuration that controls how the Arm pass pipeline should
99+
behave.
100+
98101
Subclasses may override to tweak defaults for specific targets.
99102

100103
```python
@@ -108,8 +111,8 @@ Args:
108111
```python
109112
def EthosUCompileSpec.set_pass_pipeline_config(self, config: executorch.backends.arm.common.pipeline_config.ArmPassPipelineConfig) -> None:
110113
```
111-
Sets the configuration that controls how the Arm pass pipeline should behave.
112-
Subclasses may override to tweak defaults for specific targets.
114+
Sets the configuration that controls how the Arm pass pipeline should
115+
behave. Subclasses may override to tweak defaults for specific targets.
113116

114117
Args:
115118
- **config**: The custom ArmPassPipelineConfig to set.

docs/source/backends/arm-ethos-u/arm-ethos-u-partitioner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class EthosUPartitioner(compile_spec: executorch.backends.arm.ethosu.compile_spe
88
Partitions subgraphs supported by the Arm Ethos-U backend.
99

1010
Args:
11-
- **compile_spec**: List of CompileSpec objects for Ethos-U backend.
11+
- **compile_spec**: EthosUCompileSpec object for configuring the lowering.
1212
- **additional_checks**: Optional sequence of additional operator support checks.
1313

1414
```python

0 commit comments

Comments
 (0)