Skip to content

Commit

Permalink
[ONNX] Switched to ONNX 1.16.0 (openvinotoolkit#24242)
Browse files Browse the repository at this point in the history
### Details:
 - Switched to ONNX 1.16.0
 - Removed WA for ONNX 1.15.0
 - ONNXRuntime for tests 1.18.1

### Tickets:
 - 136748, 138876

---------

Co-authored-by: Ilya Lavrenov <[email protected]>
  • Loading branch information
gkrivor and ilya-lavrenov authored Aug 5, 2024
1 parent 7eedf84 commit 12a5e5a
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 20 deletions.
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 @@ -7,7 +7,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.12.0]
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 @@ -22,4 +22,4 @@ paddlepaddle==2.6.0
tensorflow>=1.15.5,<2.18.0
six~=1.16.0
protobuf>=3.18.1,<4.0.0
onnx==1.15.0
onnx==1.16.0
8 changes: 7 additions & 1 deletion src/frontends/onnx/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,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")
2 changes: 1 addition & 1 deletion src/frontends/onnx/tests/ci_utils/onnxruntime/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a457c1df80f391ea6de0ab1d454297716976dbf3
rel-1.18.1
44 changes: 44 additions & 0 deletions src/frontends/onnx/tests/tests_python/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
xfail_issue_122776,
skip_misalignment,
skip_issue_124587,
xfail_issue_139934,
xfail_issue_139936,
xfail_issue_139937,
xfail_issue_139938,
)
from tests.tests_python.utils.onnx_backend import OpenVinoTestBackend

Expand Down Expand Up @@ -575,6 +579,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 @@ -650,6 +656,13 @@ def expect_fail(test_case_path, xfail): # type: (str) -> None
skip_misalignment,
"OnnxBackendNodeModelTest.test_gelu_default_2_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",
),
(
skip_issue_124587,
Expand All @@ -658,6 +671,37 @@ def expect_fail(test_case_path, xfail): # type: (str) -> None
"OnnxBackendNodeModelTest.test_split_variable_parts_default_axis_opset13_cpu",
"OnnxBackendNodeModelTest.test_split_variable_parts_default_axis_opset18_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",
),
]

if platform.system() == 'Darwin':
Expand Down
16 changes: 4 additions & 12 deletions thirdparty/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,13 @@ 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
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}")
endif()
# 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)

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 @@ -5,7 +5,7 @@
h5py>=3.1.0,<3.11.0
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,<8.4
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 @@ -140,4 +140,4 @@
]
}
}
}
}

0 comments on commit 12a5e5a

Please sign in to comment.