Skip to content

Arm backend: Add manifest validation and add Backwards compabillety testing#18813

Open
Sebastian-Larsson wants to merge 5 commits into
pytorch:mainfrom
Sebastian-Larsson:validate_manifest
Open

Arm backend: Add manifest validation and add Backwards compabillety testing#18813
Sebastian-Larsson wants to merge 5 commits into
pytorch:mainfrom
Sebastian-Larsson:validate_manifest

Conversation

@Sebastian-Larsson

@Sebastian-Larsson Sebastian-Larsson commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

@Sebastian-Larsson Sebastian-Larsson added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Apr 10, 2026
@pytorch-bot

pytorch-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18813

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 8 New Failures, 2 Pending, 2 Unrelated Failures

As of commit 9bf4cad with merge base ef5c8a7 (image):

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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 10, 2026
@zingo

zingo commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

Hi @digantdesai we tried to handle the buck2 files with this, but you might want to take a peek anyway.

@zingo zingo changed the title Arm backend: Add manifest validation and add BC testing Arm backend: Add manifest validation and add Backwards Comp. testing Apr 13, 2026
@zingo zingo changed the title Arm backend: Add manifest validation and add Backwards Comp. testing Arm backend: Add manifest validation and add Backwards compabillety testing Apr 13, 2026
@zingo

zingo commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

@digantdesai this adds some files and update buck2 stuff so you might want to check this :)

@GregoryComer

Copy link
Copy Markdown
Member

Thanks. Buck CI is running internally now and I'll report back if there's anything issues.

@meta-codesync

meta-codesync Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this in D101685482.

#
# This file is generated by
# backends/arm/scripts/generate_public_api_manifest.py
# backends/arm/scripts/public_api_manifest/generate_public_api_manifest.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not the PR introducing this API checker, but two questions,
(1) why not rely on unit-tests to enforce the actual behavior, beyond API BC
(2) why not use Griffe or something similar to do this for you?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Adding the validation scripts lints the API surface for mismatches, leading to early feedback when something isn't adhering to the API. We can also control deprecation and experimental features easily. Also, with a testing only approach we'll miss when the API is updated and no tests are added for it. That would require a check of its own.
  2. Adding these scripts was relatively simple and let's us control the entire flow. Griffe may be able to replace parts of this, but not all, meaning we would still need custom code to handle our API.

@digantdesai digantdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok with this PR, but left a couple of question for the original motivation (sorry I was out for a few months)

@GregoryComer

Copy link
Copy Markdown
Member

The internal buck build is complaining about the following: error: fail: src files must be named test_.py, _test.py, or conftest.py: public_api_bc/ethosu_flow.py. Seems like an odd constraint, but would it be possible to rename this file? CC @digantdesai

@github-actions github-actions Bot added the module: arm Issues related to arm backend label May 5, 2026

@zingo zingo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge :)

@digantdesai

Copy link
Copy Markdown
Contributor

Rebase please, I think the test file rename should work but I can pull it internal once more before merging to avoid a silly-issue revert. Thanks.

@digantdesai

Copy link
Copy Markdown
Contributor

There were some tooling issues, imported now

@digantdesai

Copy link
Copy Markdown
Contributor

perhaps needs some buck fixes
"""
executorch/backends/arm/test/public_api_bc/test_ethosu_flow.py:11: in
from executorch.backends.arm import (
E ImportError: cannot import name 'EthosUBackend' from 'executorch.backends.arm'
"""

@Sebastian-Larsson

Copy link
Copy Markdown
Collaborator Author

perhaps needs some buck fixes """ executorch/backends/arm/test/public_api_bc/test_ethosu_flow.py:11: in from executorch.backends.arm import ( E ImportError: cannot import name 'EthosUBackend' from 'executorch.backends.arm' """

@digantdesai I've done a best effort attempt to implement the BUCK2 fixes. Please import to check if they are sufficient. Thanks!

@linux-foundation-easycla

linux-foundation-easycla Bot commented May 25, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@digantdesai

Copy link
Copy Markdown
Contributor

Can you please rebase?

@digantdesai

digantdesai commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

From internal CI

executorch/backends/arm/test/public_api_bc/test_vgf_fp_flow.py:13: in <module>
    from executorch.extension.export_util.utils import save_pte_program
E   ModuleNotFoundError: No module named 'executorch.extension.export_util'

@Sebastian-Larsson

Copy link
Copy Markdown
Collaborator Author

I keep getting merge conflicts and having to rebase. Let me know if you need me to rebase again so that you can check internally.

@Sebastian-Larsson Sebastian-Larsson added the help wanted Extra attention is needed label Jun 8, 2026
Add a validator script that compares one public API manifest against the
current backends/arm API using exact symbol, kind, and signature
matching.

Add regression tests for manifest drift, and run the validator from the
Arm pre-push hook on every push.

Change-Id: I4765510b8a2f8c5aa09717fc8287d976c770897d
Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
Introduce BC tests and add those as well as the validation of the public
API manifest to CI in the pull job.

Change-Id: I1815223a13109e225f2b9e0f9914b504799db2ae
Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
Flatten nested TOML tables when reading Python public API
manifest entries so validation also checks nested symbols.

Add regression coverage that shows nested entries are parsed
and that missing nested symbols are reported by validation.

Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
Change-Id: Ic04883d07647b3b6f4ed9b86c68d969dcbd90ade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. help wanted Extra attention is needed module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants