Skip to content

Commit

Permalink
update onnx opset (#3050)
Browse files Browse the repository at this point in the history
* update onnx opset

Signed-off-by: Sunny Anand <sunnyanand.979@gmail.com>

* address feedback

Signed-off-by: Sunny Anand <sunnyanand.979@gmail.com>

* reformat for clang formatting

Signed-off-by: Sunny Anand <sunnyanand.979@gmail.com>

* reformat for black formattter

Signed-off-by: Sunny Anand <sunnyanand.979@gmail.com>

---------

Signed-off-by: Sunny Anand <sunnyanand.979@gmail.com>
  • Loading branch information
Sunny-Anand authored Jan 23, 2025
1 parent bd41f89 commit 6fb96c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/SupportedONNXOps-NNPA.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

# Supported ONNX Operation for Target *NNPA*.

Onnx-mlir currently supports ONNX operations targeting up to opset 21. Limitations are listed when applicable. This documentation highlights the minimum and maximum opset versions that are fully supported by onnx-mlir and not the version changes.
Onnx-mlir currently supports ONNX operations targeting up to opset 22. Limitations are listed when applicable. This documentation highlights the minimum and maximum opset versions that are fully supported by onnx-mlir and not the version changes.

* Operations are defined by the [ONNX Standard](https://github.com/onnx/onnx/blob/main/docs/Operators.md).
* **Supported Opsets** indicates the lowest and highest opset a model may have for onnx-mlir to support compiling a model with the operator.
* A * indicates onnx-mlir is compatible with the latest version of that operator available as of opset 21.
* A * indicates onnx-mlir is compatible with the latest version of that operator available as of opset 22.
* A ^ indicates onnx-mlir is compatible with the latest level of the NNPA Architecture which is z16.


Expand Down
4 changes: 2 additions & 2 deletions docs/SupportedONNXOps-cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

# Supported ONNX Operation for Target *cpu*.

Onnx-mlir currently supports ONNX operations targeting up to opset 21. Limitations are listed when applicable. This documentation highlights the minimum and maximum opset versions that are fully supported by onnx-mlir and not the version changes.
Onnx-mlir currently supports ONNX operations targeting up to opset 22. Limitations are listed when applicable. This documentation highlights the minimum and maximum opset versions that are fully supported by onnx-mlir and not the version changes.

* Operations are defined by the [ONNX Standard](https://github.com/onnx/onnx/blob/main/docs/Operators.md).
* **Supported Opsets** indicates the lowest and highest opset a model may have for onnx-mlir to support compiling a model with the operator.
* A * indicates onnx-mlir is compatible with the latest version of that operator available as of opset 21.
* A * indicates onnx-mlir is compatible with the latest version of that operator available as of opset 22.


| Op |Supported Opsets (inclusive) |Limitations |Notes |
Expand Down
4 changes: 3 additions & 1 deletion src/Dialect/ONNX/ONNXOps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

namespace mlir {
// OpSet level supported by onnx-mlir
static constexpr int CURRENT_ONNX_OPSET = 20;
// To update all occurrence of the current ONNX opset, please grep
// "CURRENT_ONNX_OPSET" and update all locations accordingly.
static constexpr int CURRENT_ONNX_OPSET = 22;
} // end namespace mlir

#define GET_OP_CLASSES
Expand Down
5 changes: 3 additions & 2 deletions utils/pre-onnx-mlir.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

# ==UPDATE_ONNX_VERSION_OPSET==
# Look for tag above and update all references when upgrading the ONNX support within ONNX-MLIR.
current_onnx_opset = 21
# To update all occurrence of the current ONNX opset, please grep "CURRENT_ONNX_OPSET" and update all locations accordingly.
current_onnx_opset = 22

converted_model = version_converter.convert_version(original_model, current_onnx_opset)

Expand All @@ -58,4 +59,4 @@
+ ".onnx"
)
onnx.save(converted_model, outFile)
print("The converted model is aved to " + outFile)
print("The converted model is saved to " + outFile)

0 comments on commit 6fb96c5

Please sign in to comment.