Skip to content

[executorch] Rewrite remove_unused_parameters_pass for HOP support#18145

Draft
GregoryComer wants to merge 1 commit intogh/GregoryComer/176/basefrom
gh/GregoryComer/176/head
Draft

[executorch] Rewrite remove_unused_parameters_pass for HOP support#18145
GregoryComer wants to merge 1 commit intogh/GregoryComer/176/basefrom
gh/GregoryComer/176/head

Conversation

@GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Mar 13, 2026

Stack from ghstack (oldest at bottom):

Update remove_unused_parameters_pass to handle HOP submodules. Use metadata from the propagate_input_spec pass to map placeholder nodes inside control flow branches (cond, map, scan, while_loop) to top-level inputs and remove unused ones, while making sure submodule signatures match HOP call nodes.

The pass works via two sub-passes:

  • First, recursively find the set of all used parameters.
  • Second, recursively update HOP nodes and submodules to remove unused parameters.

Differential Revision: D95876981

Update `remove_unused_parameters_pass` to handle HOP submodules. Use metadata from the `propagate_input_spec` pass to map placeholder nodes inside control flow branches (cond, map, scan, while_loop) to top-level inputs and remove unused ones, while making sure submodule signatures match HOP call nodes.

The pass works via two sub-passes:
* First, recursively find the set of all used parameters.
* Second, recursively update HOP nodes and submodules to remove unused parameters.

Differential Revision: [D95876981](https://our.internmc.facebook.com/intern/diff/D95876981/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 13, 2026

🔗 Helpful Links

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

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

❌ 23 New Failures, 1 Unrelated Failure

As of commit fdbe8cf with merge base 48bd687 (image):

NEW FAILURES - The following jobs have failed:

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

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

@github-actions
Copy link

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

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant