-
Notifications
You must be signed in to change notification settings - Fork 64
[IR] Reconcile graph in Node #2183
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
onnxscript/ir/passes/common/constant_manipulation.py:54
- [nitpick] The type assertion for node.graph was removed, which may allow unintended types if the invariant is not otherwise enforced. Consider documenting or validating that node.graph is always a Graph as it is set in _core.py.
assert isinstance(node.graph, ir.Graph)
❌ 18 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
self.doc_string = doc_string | ||
|
||
# Add the node as a use of the inputs | ||
for i, input_value in enumerate(self._inputs): | ||
if input_value is not None: | ||
input_value._add_usage(self, i) # pylint: disable=protected-access | ||
|
||
# Add the node to the graph if graph is specified | ||
if self._graph is not None: | ||
self._graph.append(self) |
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 don't understand how moving these up make any difference?
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 moved it closer to were graph is created so it is more readable.
Implement model.graphs() as a way to retrieve the main graph and all subgraphs of it in the model. Given (1) how useful the method is (2) I couldn't find an appropriate name for it in `traversal.py` (3) Users familiar with onnxruntime optimization tools expect this method. In PyTorch a similar `modules()` method exists. I created this method as a core method instead of an iterator in `traversal.py`. Depends on #2183
Always assign a
Graph
object to the node's graph.Fix #2181