-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[jit] Module clone work with shared ClassType #31970
Conversation
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CircleCI build failures summary and remediationsAs of commit 7fdad94:
Detailed failure analysisOne may explore the probable reasons each build failed interactively on the Dr. CI website. 🕵️ 1 new failure recognized by patternsThe following build failures do not appear to be due to upstream breakage: pytorch_macos_10_13_py3_test (1/1)Step: "Test" (full log | pattern match details)
|
We probably need two versions of |
What is clone without cloning type? are you talking about clone_instance or just don't clone? |
I think insert_quant_dequant should work without cloning at all, the reason we clone is to invalidate the executor cache, since after insert_observer we'll run the model and the executor is cached. |
We would still need to do that, right? If we don't create a new type at that moment, an old graph (with observers rather than with q-dq nodes) will be executed otherwise. |
Yeah, that's what we do right now, we'll clone in both insert_observers and insert_quant_dequant |
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
We also discovered that the original clone does not work anymore after the shared ClassType change.
they will have different type in the module but same type in the forward function:
|
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.
Looks good, please find a couple of comments inline!
"Temporarily skip the test since we don't have" | ||
"support for different quantization configurations for shared" | ||
"ClassType right now, sub1.fc and fc3 shares the ClassType but for" | ||
" sub1.fc qconfig is None, and fc3 is quantized with default_qconfig") |
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.
Was this test working correctly before? If not, it's better to split this change into a separate commit.
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.
yeah, this is working before since we clone will create new type for all types so we don't have type sharing after clone previously.
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Reviewers: mvz Subscribers: Tasks: Tags: [ghstack-poisoned]
This pull request has been merged in 4314620. |
Summary: Pull Request resolved: pytorch#31970 Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Imported from OSS Differential Revision: D19406251 fbshipit-source-id: 2881c695f6e718e5432040a3817cf187a62017bf
Summary: Pull Request resolved: pytorch#31970 Now that the ClassType can be shared among different module instances, we'll preserve the sharing in clone as well, that is if the original module has a ClassType that is shared, we'll clone this ClassType once and share it between different module instances as well. Test Plan: build/test/test_jit Imported from OSS Differential Revision: D19406251 fbshipit-source-id: 2881c695f6e718e5432040a3817cf187a62017bf
Stack from ghstack:
insert_quant_dequant
pass support shared class types #31408 [quant][graphmode]insert_quant_dequant
pass support shared class typesSummary:
Now that the ClassType can be shared among different module instances, we'll
preserve the sharing in clone as well, that is if the original module has
a ClassType that is shared, we'll clone this ClassType once and share it between
different module instances as well.
Test Plan:
build/test/test_jit
Reviewers:
mvz
Subscribers:
Tasks:
Tags:
Differential Revision: D19406251