-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
to_torchscript method for LightningModule #3258
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3258 +/- ##
=======================================
- Coverage 86% 80% -6%
=======================================
Files 88 90 +2
Lines 8132 8995 +863
=======================================
+ Hits 6962 7185 +223
- Misses 1170 1810 +640 |
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.
Super exciting! Thanks for working on this @awaelchli
Hello @awaelchli! Thanks for updating this PR.
Comment last updated at 2020-09-03 16:36:13 UTC |
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.
I only have one question: Theoretically it is possible to also train ScriptModules. But this PR does not enable this, right? Because that way saving and loading may have to properly deal with the attributes.
Not sure, what happens if you derive your model from LightningModule
and ScriptModule
though
Co-authored-by: Justus Schock <[email protected]>
…nto feature/torchscript
my understanding is scripting removes all properties, methods etc. that do not appear in forward (I assert that in thet test actually). all the lightning stuff is gone. haven't tried, but if you were to train a script module, it would have to use forward, so pure pytorch training loop. we talked with @ananthsub of a way to load a script module into a LightningModule, that would essentially replace the forward and then could be trained. if we can formulate a concrete plan for how to integrate that, I'm happy to follow up on it. |
Co-authored-by: ananthsub <[email protected]>
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.
NICE!!
What does this PR do?
Fixes #3080
Tests:
NOTE:
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃