Skip to content

Commit 2f78245

Browse files
authored
Arm backend: Add automatic list of supported ops to actions. (pytorch#23181)
Added generation of automatic list of supported ops to github actions + added doc how it should be re-generated. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com>
1 parent 22b43b2 commit 2f78245

3 files changed

Lines changed: 109 additions & 0 deletions

File tree

‎.github/workflows/pull.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,24 @@ jobs:
871871
872872
.ci/scripts/setup-arm-baremetal-tools.sh --disable-ethos-u-deps
873873
874+
if [[ "${{ matrix.test_arm_backend }}" == "test_pytest_ops_no_target" ]]; then
875+
for backend in vgf u55 u85; do
876+
python backends/arm/scripts/docgen/generate_op_support.py \
877+
--backend "$backend" --check || exit 1
878+
879+
python backends/arm/scripts/docgen/generate_op_support.py \
880+
--backend "$backend" || exit 1
881+
done
882+
883+
git diff --exit-code -- \
884+
docs/source/backends/arm-vgf/VGF_op_support.md \
885+
docs/source/backends/arm-ethos-u/U55_op_support.md \
886+
docs/source/backends/arm-ethos-u/U85_op_support.md || {
887+
echo "::error::Operator support documentation is outdated. Regenerate it and commit the changes."
888+
exit 1
889+
}
890+
fi
891+
874892
ARM_TEST=${{ matrix.test_arm_backend }}
875893
876894
# Test test_arm_backend.sh with test

‎backends/arm/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,8 @@ EXECUTORCH_VGF_ENABLE_TIMESTAMP_QUERIES=1 \
487487

488488
If you have problems or questions, or have suggestions for ways to improve the Arm backend, please reach out
489489
to the Arm team developing this backend, or create an issue on [here](https://www.github.com/pytorch/executorch/issues) and add the "partner: arm" label.
490+
491+
## Further documentation
492+
493+
See [Generating operator support documentation](scripts/docgen/README.md)
494+
for generation commands, coverage checks, and CI troubleshooting.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Arm operator support documentation
2+
3+
`generate_op_support.py` generates operator support tables for VGF,
4+
Ethos-U55, and Ethos-U85 from backend test definitions. It also checks
5+
static test coverage against backend support registries.
6+
7+
Run the commands below from the ExecuTorch repository root, with the
8+
ExecuTorch and Arm development dependencies installed.
9+
10+
## Generate support tables
11+
12+
Generate the table for the backend you changed:
13+
14+
```bash
15+
python backends/arm/scripts/docgen/generate_op_support.py --backend vgf
16+
python backends/arm/scripts/docgen/generate_op_support.py --backend u55
17+
python backends/arm/scripts/docgen/generate_op_support.py --backend u85
18+
```
19+
20+
The generated files are:
21+
22+
- VGF: `docs/source/backends/arm-vgf/VGF_op_support.md`
23+
- Ethos-U55: `docs/source/backends/arm-ethos-u/U55_op_support.md`
24+
- Ethos-U85: `docs/source/backends/arm-ethos-u/U85_op_support.md`
25+
26+
Review and commit the generated changes alongside the source changes.
27+
Do not edit the generated tables manually.
28+
29+
## Check operator coverage
30+
31+
Use `--check` to validate that backend-supported operator/profile pairs
32+
have the expected static test evidence:
33+
34+
```bash
35+
python backends/arm/scripts/docgen/generate_op_support.py --backend vgf --check
36+
python backends/arm/scripts/docgen/generate_op_support.py --backend u55 --check
37+
python backends/arm/scripts/docgen/generate_op_support.py --backend u85 --check
38+
```
39+
40+
This checks test definitions; it does not execute the tests, regenerate
41+
the tables, or check whether committed tables are up to date.
42+
43+
If coverage is missing, inspect the reported operator and profile,
44+
then add or correct the relevant backend test. Run the coverage check
45+
again and regenerate the table.
46+
47+
## Generate a detailed report
48+
49+
Use `--debug` to include exported operators and associated tests.
50+
Add `--html` to produce an HTML version alongside the Markdown report:
51+
52+
```bash
53+
python backends/arm/scripts/docgen/generate_op_support.py \
54+
--backend u85 \
55+
--debug \
56+
--html \
57+
--output /tmp/U85_op_support_debug.md
58+
```
59+
60+
Replace `u85` with `vgf` or `u55` as needed. This example writes diagnostic
61+
reports to `/tmp` without replacing the committed support table.
62+
63+
## GitHub Actions checks
64+
65+
Pull request CI checks operator coverage and regenerates all three
66+
support tables to compare them with the committed versions.
67+
68+
If CI reports outdated documentation, regenerate the tables:
69+
70+
```bash
71+
for backend in vgf u55 u85; do
72+
python backends/arm/scripts/docgen/generate_op_support.py \
73+
--backend "$backend" || break
74+
done
75+
```
76+
77+
Review the changes:
78+
79+
```bash
80+
git diff -- \
81+
docs/source/backends/arm-vgf/VGF_op_support.md \
82+
docs/source/backends/arm-ethos-u/U55_op_support.md \
83+
docs/source/backends/arm-ethos-u/U85_op_support.md
84+
```
85+
86+
Include the updated tables in your commit and push the changes.

0 commit comments

Comments
 (0)