Skip to content

[executorch] Fix remove_clone_ops to prevent output aliasing#18143

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

[executorch] Fix remove_clone_ops to prevent output aliasing#18143
GregoryComer wants to merge 1 commit intogh/GregoryComer/174/basefrom
gh/GregoryComer/174/head

Conversation

@GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Mar 13, 2026

Stack from ghstack (oldest at bottom):

Add a _would_cause_output_aliasing check to RemoveCloneOpsTransform.
When preserve_input_output_copies is set, we now also preserve clones
where removing them would cause the same source node to appear multiple
times in the output tuple, which is invalid.

This shows up with HOPs and can cause lowering failures in some circumstances.

Differential Revision: D95876983

Add a `_would_cause_output_aliasing` check to `RemoveCloneOpsTransform`.
When `preserve_input_output_copies` is set, we now also preserve clones
where removing them would cause the same source node to appear multiple
times in the output tuple, which is invalid.

This shows up with HOPs and can cause lowering failures in some circumstances.

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

[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/18143

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

❌ 10 New Failures

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

NEW FAILURES - The following jobs have failed:

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.

@GregoryComer GregoryComer marked this pull request as draft March 13, 2026 00:17
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