Skip to content
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

Add used opset into opset_imports argument to create an onnx model. #1855

Merged
merged 2 commits into from
Feb 18, 2022
Merged

Add used opset into opset_imports argument to create an onnx model. #1855

merged 2 commits into from
Feb 18, 2022

Conversation

fatcat-z
Copy link
Collaborator

In latest ONNX version, there is an enhancement that if the used domain of a node doesn't exist in the model.opset_import, it will result in an exception and stop processing.

To align with this enhancement, we add current used domain and opset version into model.opset_import property by appending them into "opset_imports" argument in make_model() method.

Signed-off-by: Jay Zhang jiz@microsoft.com

@lgtm-com
Copy link

lgtm-com bot commented Feb 17, 2022

This pull request introduces 1 alert when merging 20850a6 into 872a96b - view on LGTM.com

new alerts:

  • 1 for Unused import

Signed-off-by: Jay Zhang <jiz@microsoft.com>
@fatcat-z fatcat-z merged commit 22db2a9 into onnx:master Feb 18, 2022
@fatcat-z fatcat-z deleted the fix_onnx_rc_issue branch February 18, 2022 01:55
@guschmue
Copy link
Contributor

why add onnx.ml as domain if no op in the graph uses it ? It would be super rare for tf2onnx to use a onnx.ml op

@fatcat-z
Copy link
Collaborator Author

why add onnx.ml as domain if no op in the graph uses it ? It would be super rare for tf2onnx to use a onnx.ml op

The op LookupTableFindV2 needs this domain.

@guschmue
Copy link
Contributor

yes, only add the domain when we use onnx.ml. The idea behind the domains is that you tell the runtime what is needed to run the model (ie. one can load the support for domains on demand).

@fatcat-z
Copy link
Collaborator Author

yes, only add the domain when we use onnx.ml. The idea behind the domains is that you tell the runtime what is needed to run the model (ie. one can load the support for domains on demand).

Adding this built-in domain in model.opset_import field is to align with a latest check enhancement of onnx. It won't impact the way how runtime runs the model because the runtime will only consider the domain of each op node.
For the pair of domain and version in model.opset_import field, runtime will only check if they are supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants