CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Constant folding for lifted graph #135060
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
đź”— Helpful Linksđź§Ş See artifacts and rendered test results at hud.pytorch.org/pr/135060
Note: Links to docs will display an error until the docs builds have been completed. âś… No FailuresAs of commit 8031cf0 with merge base a57e418 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D62144791 |
This pull request was exported from Phabricator. Differential Revision: D62144791 |
1f21b64
to
31a0b5a
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
31a0b5a
to
3befe26
Compare
Summary: Pull Request resolved: #135060 Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Differential Revision: D62144791
clarification: I'm not the author of this diff, but I clicked the "Export" button on Phabricator. |
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.
many test failures - also cc @muchulee8 who added this part
3befe26
to
3503e90
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
3503e90
to
f2821c0
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D62144791 |
3fa1a5a
to
90ef37a
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
Summary: Pull Request resolved: pytorch#135060 Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Differential Revision: D62144791
This pull request was exported from Phabricator. Differential Revision: D62144791 |
90ef37a
to
e40648e
Compare
Summary: Pull Request resolved: pytorch#135060 Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Differential Revision: D62144791
Summary: Pull Request resolved: pytorch#135060 Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Reviewed By: SherlockNoMad Differential Revision: D62144791
c563c8f
to
21ede58
Compare
Summary: Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Reviewed By: muchulee8, SherlockNoMad Differential Revision: D62144791
This pull request was exported from Phabricator. Differential Revision: D62144791 |
21ede58
to
6e4728b
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
6e4728b
to
c75e850
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
c75e850
to
2e86015
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
Summary: Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values. However, we don't have constant values for lifted graph during model compilation on MTIA. I think it makes the pass more general by allowing it to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation in Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names. Test Plan: ``` buck run mode/opt caffe2/test:test_export -- -r split_const_gm ``` Reviewed By: muchulee8, SherlockNoMad Differential Revision: D62144791
2e86015
to
8031cf0
Compare
This pull request was exported from Phabricator. Differential Revision: D62144791 |
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 0 checks: Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: Bug fix for #135060 Simple review: https://github.com/pytorch/pytorch/pull/135060/files#diff-f23386709ff7e1235b15e18f835a48e5124e0ddd596aeb33c201daad1abbedd7R357 We mistakenly typed get_attr into getattr. This causes constants never get untagged, and forces all constants get cloned twice which greatly increases the memory consumption. Test Plan: python test/inductor/test_aot_inductor.py -k test_empty_constant_folding Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Bug fix for #135060 Simple review: https://github.com/pytorch/pytorch/pull/135060/files#diff-f23386709ff7e1235b15e18f835a48e5124e0ddd596aeb33c201daad1abbedd7R357 We mistakenly typed get_attr into getattr. This causes constants never get untagged, and forces all constants get cloned twice which greatly increases the memory consumption. Test Plan: python test/inductor/test_aot_inductor.py -k test_empty_constant_folding Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 4ee4b54 Pull Request resolved: #152273
Summary: Bug fix for #135060 Simple review: https://github.com/pytorch/pytorch/pull/135060/files#diff-f23386709ff7e1235b15e18f835a48e5124e0ddd596aeb33c201daad1abbedd7R357 We mistakenly typed get_attr into getattr. This causes constants never get untagged, and forces all constants get cloned twice which greatly increases the memory consumption. Test Plan: python test/inductor/test_aot_inductor.py -k test_empty_constant_folding Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: #152273 Approved by: https://github.com/trieuat, https://github.com/zhxchen17
Summary:
Current implementation for lifted graph takes a dict of [constant name: constant value]. And the constant value is used to run_node and excute the constant graph to get the folded values and then create new getattr nodes for folded values.
We don't have constant values for lifted graph during model compilation on MTIA. I think it is more general to allow the constant folding pass to just take the constant names only to produce the constant graph and represent the folded nodes as placeholders to make it consistent with lifted graph. Additionally, this mimic the real situation on Sigmoid, where Sigmoid executes the constant graph, get the folded values and set the folded values to the main graph. This diff is to update the pass to work with a list of constant names.
Test Plan:
Differential Revision: D62144791
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov