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] Add __prepare_scriptable__
duck typing to allow replacing nn.modules with scriptable preparations (#45645)
#49242
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 [ghstack-poisoned]
SplitInfinity
pushed a commit
that referenced
this pull request
Dec 11, 2020
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: 8cf5a7723a1fbde418800d55389ac2f588bb05bd Pull Request resolved: #49242
facebook-github-bot
added
cla signed
oncall: jit
Add this issue/PR to JIT oncall triage queue
labels
Dec 11, 2020
…placing nn.modules with scriptable preparations (#45645)" Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 Differential Revision: [D25500303](https://our.internmc.facebook.com/intern/diff/D25500303) [ghstack-poisoned]
SplitInfinity
pushed a commit
that referenced
this pull request
Dec 16, 2020
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: 05392dbb3b8af5810715f10c6255e220241fa306 Pull Request resolved: #49242
…placing nn.modules with scriptable preparations (#45645)" Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 Differential Revision: [D25500303](https://our.internmc.facebook.com/intern/diff/D25500303) [ghstack-poisoned]
SplitInfinity
pushed a commit
that referenced
this pull request
Dec 16, 2020
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: 47a2a2c4e5f0a453ee9dd6aaa9637b6855985649 Pull Request resolved: #49242
…placing nn.modules with scriptable preparations (#45645)" Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 Differential Revision: [D25500303](https://our.internmc.facebook.com/intern/diff/D25500303) [ghstack-poisoned]
SplitInfinity
pushed a commit
that referenced
this pull request
Dec 16, 2020
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: aaea5df1c826975075aa86fbd756ffe23aa161a9 Pull Request resolved: #49242
…placing nn.modules with scriptable preparations (#45645)" Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 Differential Revision: [D25500303](https://our.internmc.facebook.com/intern/diff/D25500303) [ghstack-poisoned]
SplitInfinity
pushed a commit
that referenced
this pull request
Jan 4, 2021
…modules with scriptable preparations (#45645) Summary: Fixes #45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: 29f695f1731ffea0032364515c8f11fd2f0dc368 Pull Request resolved: #49242
Codecov Report
@@ Coverage Diff @@
## gh/splitinfinity/82/base #49242 +/- ##
=============================================================
+ Coverage 70.47% 80.69% +10.21%
=============================================================
Files 1899 1899
Lines 205922 205947 +25
=============================================================
+ Hits 145123 166179 +21056
+ Misses 60799 39768 -21031 |
dongreenberg
approved these changes
Jan 5, 2021
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.
LGTM! Thank you for your help with this!
@ppwwyyxx FYI |
This pull request has been merged in abe1fa4. |
facebook-github-bot
pushed a commit
to facebookresearch/detectron2
that referenced
this pull request
Jan 8, 2021
Summary: Require pytorch/pytorch#49242 Reviewed By: theschnitz Differential Revision: D25791139 fbshipit-source-id: 709c58782d52356c3da8e021bab59b929cc65198
hwangdeyu
pushed a commit
to hwangdeyu/pytorch
that referenced
this pull request
Jan 14, 2021
…modules with scriptable preparations (pytorch#45645) (pytorch#49242) Summary: Pull Request resolved: pytorch#49242 Fixes pytorch#45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: pytorch#42244 Test Plan: Imported from OSS Reviewed By: dongreenberg Differential Revision: D25500303 fbshipit-source-id: d3ec9005de27d8882fc29d02f0d08acd2a5c6b2c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
__prepare_scriptable__
duck typing to allow replacing nn.modules with scriptable preparations (#45645) #49242 [JIT] Add__prepare_scriptable__
duck typing to allow replacing nn.modules with scriptable preparations ([JIT] Add__prepare_scriptable__
duck typing to allow replacing nn.modules with scriptable preparations #45645)Summary:
Fixes #45072
As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a
__prepare_scriptable__
method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users.Prior art by jamesr66a: #42244
cc: zhangguanheng66
Reviewed By: dongreenberg, ngimel
Pulled By: zhangguanheng66
fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65
Differential Revision: D25500303