-
Notifications
You must be signed in to change notification settings - Fork 72
Add stacktrace in metadata_props for rewriter created nodes #2423
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Justin Chu <[email protected]>
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
@@ -32,9 +39,18 @@ def _make_node(self, op_type: str, inputs: Sequence[ir.Value], kwargs: dict[str, | |||
assert isinstance(outputs, int) | |||
num_outputs = outputs | |||
|
|||
metadata_props = { | |||
"pkg.onnxscript.rewriter.stacktrace": _get_stacktrace(), |
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.
Should this always be added? Or, would it be better to do it only if the user sets some config/environment variable?
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 think it's ok as a default? For example torch.export will add metadata as well. If user wants no stack traces they can run a pass, or if there's demand we can add an option to turn it off?
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.
But who's using this? What happens when multiple rewrites happen? Trying to understand what exactly the use-case is and what the users want.
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.
When we look at the graph from pytorch, all nodes can be traced back from source code in the torch model, but it is unclear which rule created the nodes that are added by the rewriter. So I was trying to add this information. A node can only be created once so multiple rewrites should not affect this field
No description provided.