Skip to content

Conversation

MartinPavella
Copy link
Collaborator

@MartinPavella MartinPavella commented Sep 4, 2025

Summary

Sometimes nodes will always produce the same data at runtime, regardless of the model inputs. This PR adds a pre-processing aten dialect pass which identifies these cases and replaces the nodes with their static data. This allows for more advanced graph optimizations down the line.

Test plan

Unit tests provided.

cc @robert-kalmar @roman-janik-nxp @StrycekSimon @jirioc

Copy link

pytorch-bot bot commented Sep 4, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 07833fc with merge base 53b4cb9 (image):

NEW FAILURE - The following job has failed:

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 Sep 4, 2025
@MartinPavella
Copy link
Collaborator Author

@pytorchbot label "module: nxp" "release notes: nxp"

@pytorch-bot pytorch-bot bot added module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate labels Sep 4, 2025
@MartinPavella MartinPavella force-pushed the upstream/main-nxp/EIEX-489-upstream-preprocessing-pass-for-replacing-nodes-with-known-outputs branch 2 times, most recently from cb3cec1 to 7181577 Compare September 4, 2025 13:22
…uts with their data.

Sometimes nodes will always produce the same data at runtime. The added pass can identify some of these cases, remove the nodes, and insert new parameter nodes in their place, which contain the static data. This results in simpler and less fragmented models with fewer non-delegated nodes.
@robert-kalmar robert-kalmar force-pushed the upstream/main-nxp/EIEX-489-upstream-preprocessing-pass-for-replacing-nodes-with-known-outputs branch from 7181577 to 07833fc Compare September 9, 2025 06:42
@robert-kalmar
Copy link
Collaborator

The failing trunk / test-llama-runner-mac (fp32, coreml) / macos-job (gh) job seems unrelated to the change.

@robert-kalmar robert-kalmar merged commit 396d722 into pytorch:main Sep 9, 2025
274 of 275 checks passed
@robert-kalmar robert-kalmar deleted the upstream/main-nxp/EIEX-489-upstream-preprocessing-pass-for-replacing-nodes-with-known-outputs branch September 9, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants