Skip to content

Arm backend: Make passes preserve and update node metadata #9362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025

Conversation

oscarandersson8218
Copy link
Collaborator

@oscarandersson8218 oscarandersson8218 commented Mar 18, 2025

When creating or updating nodes in passes, the metadata is not preserved nor updated correctly. This patch adds an ArmPass base class which may update the node metadata if super().call_operator(update=True) is used. It also adds functionality to arm_pass_utils.create_node() to update the node metadata. It will only update the 'stack_trace' field. All the other fields will be preserved from the original node.

cc @digantdesai @freddan80 @per @zingo

Copy link

pytorch-bot bot commented Mar 18, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 713b82b with merge base feb3fcd (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-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 Mar 18, 2025
@oscarandersson8218 oscarandersson8218 added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk topic: not user facing and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Mar 18, 2025
@facebook-github-bot facebook-github-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 Mar 18, 2025
Comment on lines +29 to +30
for key in keys:
new_meta[key] = meta[key]
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember doing this manually, using
graph_module = super().call(graph_module).graph_module

When creating or updating nodes in passes, the metadata is not
preserved nor updated correctly. This patch adds an ArmPass base class
which may update the node metadata if
super().call_operator(update=True) is used. It also adds functionality
to arm_pass_utils.create_node() to update the node metadata. It will
only update the 'stack_trace' field. All the other fields will be
preserved from the original node.

Signed-off-by: Oscar Andersson <[email protected]>
Change-Id: I725dd057716ae5a1fac0f97b522df22196f00bdb
@oscarandersson8218 oscarandersson8218 merged commit 3e62f9e into pytorch:main Apr 1, 2025
166 checks passed
kirklandsign pushed a commit that referenced this pull request Apr 11, 2025
When creating or updating nodes in passes, the metadata is not preserved
nor updated correctly. This patch adds an ArmPass base class which may
update the node metadata if super().call_operator(update=True) is used.
It also adds functionality to arm_pass_utils.create_node() to update the
node metadata. It will only update the 'stack_trace' field. All the
other fields will be preserved from the original node.


Signed-off-by: Oscar Andersson <[email protected]>
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 topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants