-
Notifications
You must be signed in to change notification settings - Fork 335
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
Bump Upsample to Opset 10 and change the opset versioning to allow to skip over opset versions if a newer, backwards compatible one exists. #3065
base: main
Are you sure you want to change the base?
Conversation
This is a non-functional change, the only difference is that Upsample was marked as deprecated with Opset 10 Signed-off-by: Rickert, Jonas <[email protected]>
@@ -210,7 +210,7 @@ op_dialect_version_map_["TreeEnsembleClassifier"] = {1}; | |||
op_dialect_version_map_["TreeEnsembleRegressor"] = {1}; | |||
op_dialect_version_map_["Unique"] = {11}; | |||
op_dialect_version_map_["Unsqueeze"] = {13, 11}; | |||
op_dialect_version_map_["Upsample"] = {9, 7}; | |||
op_dialect_version_map_["Upsample"] = {10, 7}; |
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 looks like we have to keep 9 in the set, e.g. {10, 9, 7}. And defining a simple rule in decompose.cpp
for UpsampleV9Op
.
…p_upsample Signed-off-by: Rickert, Jonas <[email protected]>
Supporting multiple different versions required to write simple decomposition/upgrade rule to rewrite the older opset version to a newer one.
This changes allows it to not have duplicates of ops that changed in a backwards-compatible way, instead only versions with breaking changes need to be supported by onnx-mlir |
…opset to use. Introduces a new built-time generated map that contains all versions of an operation as defined by onnx. To determine the opset version for a node/op: 1. Determine the latest valid opset version. This is the newest version in this opset-version-map that is older or equal to the current graph opset. 2. Select the newest version from the versions supported by onnx-mlir that is equal or newer to the latest valid opset version. This allows it to skip over opset versions, that have a newer backwards compatible version. Example: Versions in onnx and supported by onnx-mlir: [3, 5]. Graph opset version to node version: 3 -> 3, 4 -> 3, 5 -> 5 Versions in onnx: [7, 9, 10]. Version 10 is backwards compatible to version 9. Version supported by onnx-mlir: [7, 10]. Graph opset version to node version: 7 -> 7, 8 -> 7, 9 -> 10, 10 -> 10 Signed-off-by: Rickert, Jonas <[email protected]>
457d89d
to
4dd9c93
Compare
@tungld @AlexandreEichenberger I extend this PR to include a mechanism to determine the opset version to use based on the opsets supported by onnx-mlir and the opsets defined by onnx. It would be great if you could comment on it and if you prefer this approach or the one of using trivial decompose/upgrade rules in onnx-mlir to handle the "skiipping" of backwards compatible opset versions. |
Upsample was marked as deprecated with Opset 10