[Relay][Frontend][Onnx] Loop Support#6700
Merged
Merged
Conversation
Contributor
Author
|
@masahi @mbrookhart @csullivan @soiferj Can you guys help review this PR? |
masahi
approved these changes
Oct 20, 2020
Member
|
Thanks @jwfromm |
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Oct 29, 2020
* Onnx loop almost working, checkpointing for safety. * Very close to working. * Last piece is fixing scan initialization. * snapshotting for debug. * Fix Josh's issue * Use subgraph proto class. * Loop with scan. * Simple loop test now working. * Scan outputs now working. * Added second loop test. * Removed unneeded helper functions. * Remove bad merge artifact. * Cleaned up scan output creation. * Cleaned up some style mistakes. * Add pylint skip for unused-argument. * Remove onnx dependency. * Remove now obsolete checks for 0 shaped tensors. Co-authored-by: Jared Roesch <jroesch@octoml.ai>
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 2, 2020
* Onnx loop almost working, checkpointing for safety. * Very close to working. * Last piece is fixing scan initialization. * snapshotting for debug. * Fix Josh's issue * Use subgraph proto class. * Loop with scan. * Simple loop test now working. * Scan outputs now working. * Added second loop test. * Removed unneeded helper functions. * Remove bad merge artifact. * Cleaned up scan output creation. * Cleaned up some style mistakes. * Add pylint skip for unused-argument. * Remove onnx dependency. * Remove now obsolete checks for 0 shaped tensors. Co-authored-by: Jared Roesch <jroesch@octoml.ai>
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 4, 2020
* Onnx loop almost working, checkpointing for safety. * Very close to working. * Last piece is fixing scan initialization. * snapshotting for debug. * Fix Josh's issue * Use subgraph proto class. * Loop with scan. * Simple loop test now working. * Scan outputs now working. * Added second loop test. * Removed unneeded helper functions. * Remove bad merge artifact. * Cleaned up scan output creation. * Cleaned up some style mistakes. * Add pylint skip for unused-argument. * Remove onnx dependency. * Remove now obsolete checks for 0 shaped tensors. Co-authored-by: Jared Roesch <jroesch@octoml.ai>
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Dec 4, 2020
* Onnx loop almost working, checkpointing for safety. * Very close to working. * Last piece is fixing scan initialization. * snapshotting for debug. * Fix Josh's issue * Use subgraph proto class. * Loop with scan. * Simple loop test now working. * Scan outputs now working. * Added second loop test. * Removed unneeded helper functions. * Remove bad merge artifact. * Cleaned up scan output creation. * Cleaned up some style mistakes. * Add pylint skip for unused-argument. * Remove onnx dependency. * Remove now obsolete checks for 0 shaped tensors. Co-authored-by: Jared Roesch <jroesch@octoml.ai>
kevinLu1114
reviewed
Jun 6, 2021
| loop_var_names = [v.name_hint for v in loop_vars] | ||
|
|
||
| num_scan_outputs = len(body.output) - (1 + num_deps) | ||
| # TODO (jwfromm) Test with strided slice once type unifier for this case is fixed. |
Contributor
There was a problem hiding this comment.
Hi @jwfromm
Did you make this?
I got some error.
I'm not sure if it is because of this.
Can you help me please
The model is mobilenetv1-SSD like this:
https://github.com/onnx/models/blob/master/vision/object_detection_segmentation/ssd-mobilenetv1/model/ssd_mobilenet_v1_10.onnx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a converter for Loop operators in Onnx. Loops in onnx are represented as entire onnx graphs embedded within the op. To support this structure, there are few changes to the GraphProto class to allow access to the parent graph from a called subgraph using scope. It's worth noting that I encountered some issues with type unification when strided slices were part of the subgraph. For now, I've added a warning that indicates errors might occur in this case, but will add corresponding tests once the issue is resolved.