-
Notifications
You must be signed in to change notification settings - Fork 474
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
Parser rewrite #1296
Parser rewrite #1296
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1296 +/- ##
==========================================
+ Coverage 78.77% 78.83% +0.06%
==========================================
Files 551 555 +4
Lines 61836 62212 +376
==========================================
+ Hits 48712 49046 +334
- Misses 13124 13166 +42 ☔ View full report in Codecov by Sentry. |
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.
It's my first pass and I have minor comments. I dive in more to understand your changes better because there are a lot of it.
removed dead code
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. I am relying on tests to verify the correctness and @skewballfox's ability for large refactors. Let push it through.
@skewballfox , let me know if it's ready to be merged.
Pull Request Template
Checklist
run-checks all
script has been executed.Related Issues/PRs
If there are any others I should link, please let me know.
Changes
Rewrote the parser to handle everything but node removal in a single pass. Node inputs and arguments are updated on node construction, and$\Theta(N^2))$ , we should call the function in the event of a panic, testing the model validity only after something else failed.
node.passed
is used to keep track of whether an IO argument is used. This parser only works if the nodes are topologically sorted, so I think instead of checking (which isThere is still some housecleaning to be done, I need to either make it an actual builder which returns an
OnnxGraph
, or change the functions to take the necessary state as arguments. oh, and there is enough dead code here to fill a mortuary.There is still quite a bit that could be done to make this faster or use less memory, such as altering
BurnGraph
to useOnnxGraphIO
, but that's a PR for another time.Testing
I ran all Onnx Test to ensure that building the existing models still works the same.
If you would like me to add more test somewhere, let me know.
I noticed that certain situations with initializers isn't tested in the onnx-tests, but are captured by running the examples. For example there were a couple of problems that would arise when an node input was both in the initializers and graph inputs that only showed up on the
squeezenet1.onnx
example.It might be a good idea to either make building those examples part of the onnx test or create a few small models for testing that situation