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

[ONNX] Switched to ONNX 1.16.0 (#24242) #27476

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conan.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"opencl-icd-loader/2023.04.17#5f73dd9f0c023d416a7f162e320b9c77%1692732261.088",
"opencl-headers/2023.04.17#3d98f2d12a67c2400de6f11d5335b5a6%1683936272.16",
"opencl-clhpp-headers/2023.04.17#7c62fcc7ac2559d4839150d2ebaac5c8%1685450803.672",
"onnx/1.15.0#54b6d944e6995300bc7bcdd3a3206d74%1698840505.336",
"onnx/1.16.0#4d2d4f24d6f73b8a7551e001839631f0%1712404811.278",
"onetbb/2021.10.0#cbb2fc43088070b48f6e4339bc8fa0e1%1693812561.235",
"ittapi/3.24.0#9246125f13e7686dee2b0c992b71db94%1682969872.743",
"hwloc/2.9.2#1c63e2eccac57048ae226e6c946ebf0e%1688677682.002",
Expand Down
2 changes: 1 addition & 1 deletion conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ opencl-icd-loader/[>=2023.04.17]
rapidjson/[>=1.1.0]
xbyak/[>=6.62]
snappy/[>=1.1.7]
onnx/1.15.0
onnx/1.16.0
pybind11/[>=2.10.1]
flatbuffers/[>=22.9.24]

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ paddlepaddle==2.5.2
tensorflow>=1.15.5,<2.15.0
six~=1.16.0
protobuf>=3.18.1,<4.0.0
onnx==1.15.0
onnx==1.16.0
7 changes: 6 additions & 1 deletion src/frontends/onnx/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ def xfail_test(reason="Mark the test as expected to fail", strict=True):
"Not equal to tolerance")
xfail_issue_122775 = xfail_test(reason="test_resize_downsample_scales_linear_cpu - "
"Not equal to tolerance")
skip_misalignment = pytest.mark.skip(reason="Misalignment between onnx versions") # Need to enable after bumping to 1.15
skip_issue_127649 = pytest.mark.skip(reason="Not equal to tolerance rtol=0.001, atol=1e-07 - "
"Mismatched elements: 1 / 1000 (0.1%)")

# ONNX 1.16
skip_misalignment = pytest.mark.skip(reason="Misalignment between onnx versions") # Need to enable after bumping to 1.16
xfail_issue_139934 = xfail_test(reason = "Int4 isn't supported")
xfail_issue_139936 = xfail_test(reason = "MaxPool accuracy fails")
xfail_issue_139937 = xfail_test(reason = "GroupNorm, QLinearMatMul, DequantizeLinear translation failed")
xfail_issue_139938 = xfail_test(reason = "QLinearMatMul accuracy fails")
1 change: 1 addition & 0 deletions src/frontends/onnx/tests/ci_utils/onnxruntime/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rel-1.18.1
45 changes: 45 additions & 0 deletions src/frontends/onnx/tests/tests_python/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
xfail_issue_122775,
xfail_issue_122776,
skip_misalignment,
xfail_issue_139934,
xfail_issue_139936,
xfail_issue_139937,
xfail_issue_139938,
xfail_issue_139938,
)
from tests.tests_python.utils.onnx_backend import OpenVinoTestBackend

Expand Down Expand Up @@ -691,6 +696,8 @@ def expect_fail(test_case_path, xfail): # type: (str) -> None
"OnnxBackendNodeModelTest.test_ai_onnx_ml_label_encoder_string_int_no_default_cpu",
"OnnxBackendNodeModelTest.test_ai_onnx_ml_label_encoder_tensor_mapping_cpu",
"OnnxBackendNodeModelTest.test_ai_onnx_ml_label_encoder_tensor_value_only_mapping_cpu",
"OnnxBackendNodeModelTest.test_ai_onnx_ml_tree_ensemble_set_membership_cpu",
"OnnxBackendNodeModelTest.test_ai_onnx_ml_tree_ensemble_single_tree_cpu",
),
(
xfail_issue_119925,
Expand Down Expand Up @@ -783,6 +790,44 @@ def expect_fail(test_case_path, xfail): # type: (str) -> None
"OnnxBackendNodeModelTest.test_gelu_default_2_expanded_cpu",
"OnnxBackendNodeModelTest.test_reduce_log_sum_empty_set_expanded_cpu",
"OnnxBackendNodeModelTest.test_reduce_log_sum_exp_empty_set_expanded_cpu",
"OnnxBackendNodeModelTest.test_group_normalization_epsilon_cpu",
"OnnxBackendNodeModelTest.test_group_normalization_example_cpu",
"OnnxBackendNodeModelTest.test_qlinearmatmul_3D_int8_float16_cpu",
"OnnxBackendNodeModelTest.test_qlinearmatmul_3D_int8_float32_cpu",
"OnnxBackendNodeModelTest.test_qlinearmatmul_3D_uint8_float16_cpu",
"OnnxBackendNodeModelTest.test_quantizelinear_blocked_asymmetric_cpu",
"OnnxBackendNodeModelTest.test_quantizelinear_blocked_symmetric_cpu",
),
(
xfail_issue_139934,
"OnnxBackendNodeModelTest.test_cast_FLOAT16_to_INT4_cpu",
"OnnxBackendNodeModelTest.test_cast_FLOAT16_to_UINT4_cpu",
"OnnxBackendNodeModelTest.test_cast_FLOAT_to_INT4_cpu",
"OnnxBackendNodeModelTest.test_cast_FLOAT_to_UINT4_cpu",
"OnnxBackendNodeModelTest.test_cast_INT4_to_FLOAT16_cpu",
"OnnxBackendNodeModelTest.test_cast_INT4_to_FLOAT_cpu",
"OnnxBackendNodeModelTest.test_cast_INT4_to_INT8_cpu",
"OnnxBackendNodeModelTest.test_cast_UINT4_to_FLOAT16_cpu",
"OnnxBackendNodeModelTest.test_cast_UINT4_to_FLOAT_cpu",
"OnnxBackendNodeModelTest.test_cast_UINT4_to_UINT8_cpu",
"OnnxBackendNodeModelTest.test_dequantizelinear_int4_cpu",
"OnnxBackendNodeModelTest.test_dequantizelinear_uint4_cpu",
"OnnxBackendNodeModelTest.test_quantizelinear_int4_cpu",
"OnnxBackendNodeModelTest.test_quantizelinear_uint4_cpu",
),
(
xfail_issue_139936,
"OnnxBackendNodeModelTest.test_maxpool_2d_ceil_output_size_reduce_by_one_cpu",
),
(
xfail_issue_139937,
"OnnxBackendNodeModelTest.test_dequantizelinear_blocked_cpu",
"OnnxBackendNodeModelTest.test_qlinearmatmul_2D_int8_float16_cpu",
),
(
xfail_issue_139938,
"OnnxBackendNodeModelTest.test_qlinearmatmul_2D_int8_float32_cpu",
"OnnxBackendNodeModelTest.test_qlinearmatmul_2D_uint8_float16_cpu",
),
]

Expand Down
27 changes: 17 additions & 10 deletions thirdparty/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,27 @@ foreach(_onnx_target onnx onnx_proto)
$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>)
endforeach()

if(WIN32)
# from onnx==1.13.1 it requires C++17 when compiling on Windows
target_compile_features(onnx PRIVATE cxx_std_17)
if(MINGW)
# OPTIONAL is a reserved word for mingw at least
if(MINGW)
target_compile_definitions(onnx PRIVATE OPTIONAL=OPTIONAL_PLACEHOLDER)
endif()
target_compile_definitions(onnx PRIVATE OPTIONAL=OPTIONAL_PLACEHOLDER)
endif()

# WA to support old compiler version, removes unused header which may block build
# from onnx==1.13.1 it requires C++17 when compiling on Windows, and since onnx==1.16.0 on Linux
target_compile_features(onnx PRIVATE cxx_std_17)

# WA to allow build on Debian 9
if(CMAKE_COMPILER_IS_GNUCXX AND LINUX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
file(READ onnx/onnx/defs/parser.cc CONTENT)
string(REPLACE "#include <string_view>" "" CONTENT "${CONTENT}")
file(WRITE onnx/onnx/defs/parser.cc "${CONTENT}")
file(READ onnx/onnx/common/file_utils.h CONTENT)
string(REPLACE "#include <filesystem>" "" CONTENT "${CONTENT}")
string(REPLACE "std::filesystem::path proto_u8_path = std::filesystem::u8path(proto_path);" "" CONTENT "${CONTENT}")
string(REPLACE "proto_u8_path" "proto_path" CONTENT "${CONTENT}")
file(WRITE onnx/onnx/common/file_utils.h "${CONTENT}")

file(READ onnx/onnx/defs/traditionalml/utils.h CONTENT)
string(REPLACE "const auto& [type, length]" "const std::pair<int, int>& type_length" CONTENT "${CONTENT}")
string(REPLACE "type !=" "type_length.first !=" CONTENT "${CONTENT}")
string(REPLACE "length !=" "type_length.second !=" CONTENT "${CONTENT}")
file(WRITE onnx/onnx/defs/traditionalml/utils.h "${CONTENT}")
endif()

ov_disable_all_warnings(onnx onnx_proto)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/onnx/onnx
Submodule onnx updated 625 files
2 changes: 1 addition & 1 deletion tools/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# tensorflow, numpy
mxnet~=1.2.0; sys_platform == 'win32'
mxnet>=1.7.0.post2,<=1.9.1; sys_platform != 'win32'
onnx>=1.8.1,<=1.15.0
onnx>=1.8.1,<=1.16.0
networkx<=3.1.0
pytest>=5.0,<7.3
protobuf>=3.18.1,<4.0.0
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@
]
}
}
}
}
Loading