pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.39k stars 228 forks source link

Fix memory.view insertion except for output nodes #3602

Closed dulinriley closed 1 month ago

dulinriley commented 1 month ago

Summary: The previous implementation of ignoring view_copy on outputs was incorrect in that it only checked node.next instead of all users of the node. node.next just selects the next node in topological order, which may or may not be the output if there is more than one output. In the case of more than one output, the next node may not be related at all!

Check if any of the users of the node are an output instead.

Reviewed By: metascroy, mcremon-meta

Differential Revision: D57299853

pytorch-bot[bot] commented 1 month ago

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3602

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

:white_check_mark: No Failures

As of commit 81ab3fb87f642852a07fbabfea8c2633891669dd with merge base c69861ddcee5705d37e7d47e2cccdeac741c71e8 (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

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

facebook-github-bot commented 1 month ago

This pull request was exported from Phabricator. Differential Revision: D57299853

facebook-github-bot commented 1 month ago

This pull request was exported from Phabricator. Differential Revision: D57299853

facebook-github-bot commented 1 month ago

This pull request was exported from Phabricator. Differential Revision: D57299853

facebook-github-bot commented 1 month ago

This pull request has been merged in pytorch/executorch@b64182d6413429851a4e1b444e3721f6d3764ee0.