-
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
Make first order gradient graphs more efficient #5959
Conversation
This pull request is only about the second commit, the first is #5946 . |
@@ -27,6 +29,20 @@ | |||
import tvm.relay.op as op | |||
|
|||
|
|||
def count_ops(expr): |
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 you move this to some common file? this look like something useful to other places as well.
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.
I'll move it to python/tvm/relay/testing/__init__.py
when rebasing post #5946 .
We was thinking of using ANF then AD. But this also work. |
@t-vi please rebase. |
Previously, nodes are visited as often as they are used and each time a derivative is computed. Only at the leaves were the contributions of everything added. This patch changes this to add at any node that is used several times.
@MarisaKirisame Thank you! I rebased and now the CI is all happy again. |
Thanks @t-vi @MarisaKirisame |
Previously, nodes are visited as often as they are used and each time a derivative is computed. Only at the leaves were the contributions of everything added. This patch changes this to add at any node that is used several times.
Previously, nodes are visited as often as they are used and each time a derivative is computed. Only at the leaves were the contributions of everything added. This patch changes this to add at any node that is used several times.
Previously, nodes are visited as often as they are used and each time a
derivative is computed. Only at the leaves were the contributions of
everything added. This patch changes this to add at any node that is
used several times.