-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Print all traceback for nested backwards in detect_anomaly #43626
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
💊 CI failures summary and remediationsAs of commit 46b57a1 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 21 times. |
albanD
left a comment
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.
Thanks for the PR.
The high level idea looks good.
I think we can simplify a bit the implementation though. Can you check the inline comments below and let me know what you think.
albanD
left a comment
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.
This looks quite good, a few more comments below.
albanD
left a comment
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.
the c++ looks good!
Just had a chance to take a quick look at the tests. They are good, just a small comment to make sure things are tested and we don't leak memory.
Then it should be good to go!
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
Can you just edit the comment mentioned above and this will be good to go!
facebook-github-bot
left a comment
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.
@albanD has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@albanD has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thanks for your help @albanD! |
Fixes #43405.
This pull request adds a feature of printing all tracebacks if a
detect_anomalymode detectsnanin nested backward operations.The way I did it is by assigning a node as a parent to all nodes it produces during its backward calculation. Then if one of the children produces
nan, it will print the traceback from the parent and grand parents (if any).The parent is assigned in
parent_node_member inNodeclass which is accessible in C++ by functionnode->parent()and in Python bynode.parent_function.A node has a parent iff:
An example of this feature:
with output:
cc & thanks to @albanD