-
Notifications
You must be signed in to change notification settings - Fork 3
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
Ports the graph tracing to torch.fx #28
base: main
Are you sure you want to change the base?
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.
this is great work, almost ready!
appear with the qualified name ``foo.bar.baz`` here. | ||
""" | ||
# Tests that the module is in the list of custom leaves | ||
if self.custom_leaf_modules and isinstance(m, self.custom_leaf_modules): |
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.
Do we need to check for torch.nn.Sequential
here?
nodes = {} | ||
edges = [] | ||
ignored_nodes = set() | ||
skipped_nodes = set() |
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.
Does skipped_nodes
means nodes we still need to process?
continue | ||
elif node.op == "output": | ||
nodes[str(node.name)] = nir.Output(np.array([1])) | ||
elif node.op == "call_function": |
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 we add a check for other non-allowed functions (multiplies or divisions) and add an exception?
assert len(_filter_edges(graph, nir.Affine, nir.Output)) == 1 | ||
|
||
|
||
def test_trace_addition(): |
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.
how about substraction? does that work?
This PR ports the graph tracing to torch.fx instead of using the homebrewed graph tracer.
TBC...