-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Lower trivial differentiable subgraphs #11110
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 problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test somehow?
torch/csrc/jit/graph_executor.cpp
Outdated
@@ -53,6 +54,7 @@ struct ExecutionPlan { | |||
, graph(std::move(graph)) {} | |||
|
|||
void run(Stack& stack) const { | |||
std::cout << *graph << std::endl; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
We create differentiable subgraphs in the JIT so that we can apply optimizations which would normally make it impossible to run the code with autograd. However, in many cases we are too eager about this, and the graphs we slice and up being trivial, and not optimizations are actually applied. In this case, it's better to inline them back and make use of specialized autograd functions, instead of our generic graph implementations.
cb5f4d5
to
229bae2
Compare
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.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff 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.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: zdevito Pull Request resolved: pytorch#11110 Differential Revision: D9616408 Pulled By: apaszke fbshipit-source-id: f1ae77d698bf0ada32f2c1c3f587e46a4f57a867
@zdevito