-
Notifications
You must be signed in to change notification settings - Fork 536
exclude mutated buffer #2876
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
exclude mutated buffer #2876
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2876
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6e049ff with merge base 86b326a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D55812844 |
@@ -515,6 +515,12 @@ def tag_constant_data(edge_program: ExportedProgram) -> None: | |||
or is_buffer(edge_program, node) | |||
or is_lifted_tensor_constant(edge_program, node) | |||
): | |||
for node_user in node.users: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we make this an option, rather than hard coded?
Concretely, shall we revise line 503 to
def tag_constant_data(edge_program: ExportedProgram, exclude_mutable_buffer: bool = False) -> None:
so it is still backward compatible, while giving us the flexibility to choose including / excluding mutable buffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This util function is to tag constant data, while mutable buffer isn't really considered as a constant. I think the backend will know more precisely what kind of mutate operator they can support, and the custom logic can live inside the partitioner.
8fd03e9
to
d3adb47
Compare
Summary: Pull Request resolved: pytorch#2876 Differential Revision: D55812844
This pull request was exported from Phabricator. Differential Revision: D55812844 |
Summary: Pull Request resolved: pytorch#2876 Differential Revision: D55812844
d3adb47
to
cd2af09
Compare
This pull request was exported from Phabricator. Differential Revision: D55812844 |
Summary: Pull Request resolved: pytorch#2876 Differential Revision: D55812844
cd2af09
to
6e049ff
Compare
This pull request was exported from Phabricator. Differential Revision: D55812844 |
This pull request has been merged in 599cfde. |
@pytorchbot cherry-pick --onto release/0.2 -c critical |
Summary: Pull Request resolved: #2876 Fixing the tag constant for mutable buffer. The buffer shouldn't be tagged if it's going to be mutated by the delegated. It's more common in hardware backends Will follow up and test having delegate consume mutation Reviewed By: mcr229, angelayi Differential Revision: D55812844 fbshipit-source-id: e0be4c2dc295141d673cccb1aeecee45894b1e70 (cherry picked from commit 599cfde)
Cherry picking #2876The cherry pick PR is at #2946 and it is recommended to link a critical cherry pick PR with an issue Details for Dev Infra teamRaised by workflow job |
Summary: Pull Request resolved: #2876 Fixing the tag constant for mutable buffer. The buffer shouldn't be tagged if it's going to be mutated by the delegated. It's more common in hardware backends Will follow up and test having delegate consume mutation Reviewed By: mcr229, angelayi Differential Revision: D55812844 fbshipit-source-id: e0be4c2dc295141d673cccb1aeecee45894b1e70 (cherry picked from commit 599cfde)
Differential Revision: D55812844