-
Notifications
You must be signed in to change notification settings - Fork 685
[backend_api] Delete partitioner tags after lowering #9435
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
Conversation
There was a slight bug i found when lowering with: XnnpackDynamicallyQuantizedPartitioner --> XnnpackPartitioner. The issue arrises because the second time we partition, delegation tags from the previous partitioner still exist. Specifically they exist on the getitem node because the metadata was propagated. See: https://github.com/pytorch/pytorch/blob/main/torch/fx/passes/utils/fuser_utils.py#L235 Since the getitem nodes created in by the XnnpackDynamicallyQuantizedPartitioner still have the delegation tags, they sneak into partitions from XnnpackPartitioner. This shouldn't happen because delegation tags from previous Partitioner should not exist after the previous lowering. We update the code in to_backend here to erase all the "delegation_tags" from node.meta after we've performed all `_partition_and_lower` Differential Revision: [D71518362](https://our.internmc.facebook.com/intern/diff/D71518362/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9435
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit f372d4d with merge base 1300cda ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D71518362 |
exir/backend/backend_api.py
Outdated
if "delegation_tag" in node.meta: | ||
del node.meta["delegation_tag"] |
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.
if "delegation_tag" in node.meta: | |
del node.meta["delegation_tag"] | |
node.meta.pop("delegation_tag", None) |
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.
Thanks, just a minor comment
There was a slight bug i found when lowering with: XnnpackDynamicallyQuantizedPartitioner --> XnnpackPartitioner. The issue arrises because the second time we partition, delegation tags from the previous partitioner still exist. Specifically they exist on the getitem node because the metadata was propagated. See: https://github.com/pytorch/pytorch/blob/main/torch/fx/passes/utils/fuser_utils.py#L235 Since the getitem nodes created in by the XnnpackDynamicallyQuantizedPartitioner still have the delegation tags, they sneak into partitions from XnnpackPartitioner. This shouldn't happen because delegation tags from previous Partitioner should not exist after the previous lowering. We update the code in to_backend here to erase all the "delegation_tags" from node.meta after we've performed all `_partition_and_lower` Differential Revision: [D71518362](https://our.internmc.facebook.com/intern/diff/D71518362/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D71518362 |
6f675f3
into
gh/mcr229/15/base
Stack from ghstack (oldest at bottom):
There was a slight bug i found when lowering with:
XnnpackDynamicallyQuantizedPartitioner --> XnnpackPartitioner. The issue arrises because the second time we partition, delegation tags from the previous partitioner still exist. Specifically they exist on the getitem node because the metadata was propagated.
See:
https://github.com/pytorch/pytorch/blob/main/torch/fx/passes/utils/fuser_utils.py#L235
Since the getitem nodes created in by the XnnpackDynamicallyQuantizedPartitioner still have the delegation tags, they sneak into partitions from XnnpackPartitioner. This shouldn't happen because delegation tags from previous Partitioner should not exist after the previous lowering.
We update the code in to_backend here to erase all the "delegation_tags" from node.meta after we've performed all
_partition_and_lower
Differential Revision: D71518362