Skip to content

Conversation

@martinlsm
Copy link
Collaborator

@martinlsm martinlsm commented Oct 1, 2025

All passes in backends/arm/_passes have been set to inherit from ArmPass instead of ExportPass.

Furthermore, the attribute exported_program in ArmPass has been removed to instead let each subclasses set it. The reason is that it was type annotated as an Optional[ExportedProgram]] in ArmPass and Mypy complained about that when a subclass tried to access it without checking for None. By moving the attribute down to each subclass that needs it, the confusion around whether the value is None or not is elimininated.

Test plan

The persistent tests in the Arm backend should cover this change.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

@martinlsm martinlsm requested a review from digantdesai as a code owner October 1, 2025 11:42
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 1, 2025

🔗 Helpful Links

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

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

❌ 7 New Failures, 3 Unrelated Failures

As of commit ca3e577 with merge base 57a7903 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were 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 Oct 1, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label ciflow/trunk

@martinlsm
Copy link
Collaborator Author

@pytorchbot label "partner: arm"

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Oct 1, 2025
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

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.

@martinlsm martinlsm force-pushed the marlin-convert-passes branch from 4bb2df4 to ab01d4a Compare October 8, 2025 07:46
class ArmPass(ExportPass):
"""Base class for Arm passes"""

def __init__(self, exported_program: Optional[torch.export.ExportedProgram] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a step in the right direction.

Just a word of caution for the passes which do use exported_program mainly with an intention to add modes which ends up updating the graph signature i.e. using utils like, create_constant_placeholder is that if the graph inside the exported program and the graph the pass got are out of sync then all sorts of weird errors can happen. So it might be wise to assert something like id(exported_progra.graph_module) == if(pass_arg_graph_module)

All passes in backends/arm/_passes have been set to inherit from
`ArmPass` instead of `ExportPass`.

Furthermore, the attribute `exported_program` in `ArmPass` has been
removed to instead let each subclasses set it. The reason is that it was
type annotated as an `Optional[ExportedProgram]]` in `ArmPass` and Mypy
complained about that when a subclass tried to access it without
checking for `None`. By moving the attribute down to each subclass that
needs it, the confusion around whether the value is `None` or not is
elimininated.

Signed-off-by: Martin Lindström <[email protected]>
Change-Id: Ic73ecbeca255dfca74e23b4ce422dc06a094a058
@martinlsm martinlsm force-pushed the marlin-convert-passes branch from ab01d4a to ca3e577 Compare October 15, 2025 06:21
Copy link
Collaborator

@Sebastian-Larsson Sebastian-Larsson left a comment

Choose a reason for hiding this comment

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

Unrelated CI failures

@Sebastian-Larsson Sebastian-Larsson merged commit f8d67fc into pytorch:main Oct 15, 2025
280 of 290 checks passed
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.

3 participants