-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Get list of unsupported ONNX operators #2995
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.
traversing graph while reporting missing operator lists is good for users.
suggest checking op_name in identity_list or op_name in convert_map or op_name = 'Constant' instead of creating another supported_op set.
python/tvm/relay/frontend/onnx.py
Outdated
@@ -879,6 +879,79 @@ def _get_convert_map(opset): | |||
'Shape': Shape.get_converter(opset), | |||
} | |||
|
|||
supported_ops = 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.
I am thinking defining the supported_ops set is redundant.
checking op_name in identity_list or op_name in convert_map or op_name = 'Constant' should be enough
python/tvm/relay/frontend/onnx.py
Outdated
unsupported_ops = [] | ||
for node in graph.node: | ||
op_name = node.op_type | ||
if op_name not in supported_ops: |
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.
checking op_name in identity_list or op_name in convert_map or op_name = 'Constant' should be enough
nnvm/python/nnvm/frontend/onnx.py
Outdated
@@ -775,6 +775,80 @@ def _get_convert_map(opset): | |||
} | |||
|
|||
|
|||
supported_ops = 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.
I am thinking defining the supported_ops set is redundant.
checking op_name in identity_list or op_name in convert_map or op_name = 'Constant' should be enough
nnvm/python/nnvm/frontend/onnx.py
Outdated
unsupported_ops = [] | ||
for node in graph.node: | ||
op_name = node.op_type | ||
if op_name not in supported_ops: |
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.
checking op_name in identity_list or op_name in convert_map or op_name = 'Constant' should be enough
@KoinFlyp please act on @JennyChou5 's comment |
5c6a913
to
3d5f193
Compare
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.
even though currently _identity_list is empty but it would be good to make logic complete.
nnvm/python/nnvm/frontend/onnx.py
Outdated
unsupported_ops = set() | ||
for node in graph.node: | ||
op_name = node.op_type | ||
if op_name not in convert_map and op_name != 'Constant': |
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 check the _identity_list? even though currently it is empty but it would be good to make logic complete.
python/tvm/relay/frontend/onnx.py
Outdated
unsupported_ops = set() | ||
for node in graph.node: | ||
op_name = node.op_type | ||
if op_name not in convert_map and op_name != 'Constant': |
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 check the _identity_list? even though currently it is empty but it would be good to make logic complete.
8b4be42
to
6761072
Compare
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.
logical good and correct.
nnvm/python/nnvm/frontend/onnx.py
Outdated
unsupported_ops.add(op_name) | ||
if unsupported_ops: | ||
msg = ['The following operators are not supported for frontend ONNX: '] | ||
for i, op_name in enumerate(unsupported_ops): |
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 ops = ', '.join(str(op) for op in unsupported_ops)
?
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.
We’d still have to concatenate the ‘The following ops...’ string and I generally avoid concatenating strings with +. Your way is neater, though, so I’ll change it.
6761072
to
8a3f87d
Compare
Thanks, @yongwww @JennyChou5 @KoinFlyp this is now merged |
Improve user experience by reporting the entire list of ops that are not supported in ONNX. @JennyChou5 @yidawang @zhreshold @srkreddy1238 @kazum