Skip to content

Arm backend: Add real implementation for TOSA dialect ops (re-land)#20537

Open
Erik-Lundell wants to merge 2 commits into
pytorch:mainfrom
Erik-Lundell:real-tosa-impl-2
Open

Arm backend: Add real implementation for TOSA dialect ops (re-land)#20537
Erik-Lundell wants to merge 2 commits into
pytorch:mainfrom
Erik-Lundell:real-tosa-impl-2

Conversation

@Erik-Lundell

Copy link
Copy Markdown
Collaborator

In a first commit,

Arm backend: Add infra for real implementations of Tosa ops

Tested by applying the infra to the avg_pool2d Tosa dialect op.
The rewrite_avg_pool2d tests can now be ran to verify that
the produced Tosa is correct. To make it completely correct,
two additional passes need to be added to the test.

Then,

Arm backend: Add real impls to all TOSA dialect ops

Additionally,

  • Remove special case in ComputeOpsAOT pass for such ops,
    since they can now be executed.
  • Start running the model in tests were this was previously
    impossible due to ops not having a real impl.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

TosaRealOpConfig configures how the real implementation is done.
Main point of configuration is which node visitor is used.
Currently, this needs to be done with a factory function with
lazy import, due to direct imports causing a circular import.

Tested by applying the infra to the avg_pool2d Tosa dialect op.
The rewrite_avg_pool2d tests can now be ran to verify that
the produced Tosa is correct. To make it completely correct,
two additional passes need to be added to the test.

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: I7b573583fe241b63927864684e5ccdd1e4aa2cff
Additionally,
- Start pre-computing TOSA ops with real impl in ComputeOpsAOT.
- Start running the model in tests were this was previously
impossible due to ops not having a real impl.
- Some modifications are needed in real_impl to run operators
with kwargs.

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: I94ed6aa08842d8cd57e9f0fb331edc5261b8d044
@pytorch-bot

pytorch-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 6 New Failures, 4 Unrelated Failures, 2 Unclassified Failures

As of commit 96c234b with merge base a8cfb75 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Jun 26, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jun 26, 2026
@Erik-Lundell Erik-Lundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm and removed module: arm Issues related to arm backend labels Jun 26, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant