From 0044be62590a2a9f52148c115a4f3905d3cb12bc Mon Sep 17 00:00:00 2001 From: Ashwini Khade Date: Thu, 15 Aug 2019 17:10:32 -0700 Subject: [PATCH] update onnx to latest commit (#1622) * update onnx to latest commit * Disable and/or fix failing tests * disable not yet implemented tests for opset 11 * disable tests * fix bug in mkldnn fp16 graph check --- cgmanifest.json | 2 +- cmake/external/onnx | 2 +- .../mkldnn/mkldnn_execution_provider.cc | 2 +- .../test/framework/allocation_planner_test.cc | 2 +- .../test/framework/execution_frame_test.cc | 2 +- onnxruntime/test/onnx/main.cc | 33 ++++++++++++++++++- .../test/optimizer/graph_transform_test.cc | 5 ++- .../test/python/onnx_backend_test_series.py | 14 +++++++- .../linux/docker/scripts/install_onnx.sh | 2 +- 9 files changed, 55 insertions(+), 9 deletions(-) diff --git a/cgmanifest.json b/cgmanifest.json index 2fd8a43254e26..410f8210e1c27 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -49,7 +49,7 @@ "component":{ "type":"git", "git": { - "commitHash": "65b8e0f9979fbade16e3becbdfa69c0764946f72", + "commitHash": "7d90796473295ca3cdf976ed772215c5980ad3e0", "repositoryUrl": "https://github.com/onnx/onnx.git" } } diff --git a/cmake/external/onnx b/cmake/external/onnx index 65b8e0f9979fb..7d90796473295 160000 --- a/cmake/external/onnx +++ b/cmake/external/onnx @@ -1 +1 @@ -Subproject commit 65b8e0f9979fbade16e3becbdfa69c0764946f72 +Subproject commit 7d90796473295ca3cdf976ed772215c5980ad3e0 diff --git a/onnxruntime/core/providers/mkldnn/mkldnn_execution_provider.cc b/onnxruntime/core/providers/mkldnn/mkldnn_execution_provider.cc index 93cb36116f964..c568e22f9a308 100644 --- a/onnxruntime/core/providers/mkldnn/mkldnn_execution_provider.cc +++ b/onnxruntime/core/providers/mkldnn/mkldnn_execution_provider.cc @@ -101,7 +101,7 @@ bool MKLDNNExecutionProvider::UseSubgraph(const onnxruntime::GraphViewer& graph_ index++; node = graph_viewer.GetNode(index); } - if (node->InputDefs()[0]->Type() != nullptr) + if (!node->InputDefs().empty() && node->InputDefs()[0]->Type() != nullptr) FP16_graph = node->InputDefs()[0]->Type()->find("16") != std::string::npos; } diff --git a/onnxruntime/test/framework/allocation_planner_test.cc b/onnxruntime/test/framework/allocation_planner_test.cc index c555c9ba21900..4a4b6072a0dcc 100644 --- a/onnxruntime/test/framework/allocation_planner_test.cc +++ b/onnxruntime/test/framework/allocation_planner_test.cc @@ -162,7 +162,7 @@ class PlannerTest : public ::testing::Test { public: PlannerTest() : model_("test"), graph_{model_.MainGraph()}, state_{execution_providers_, false} { std_kernel_ = KernelDefBuilder().SetName("Transpose").Build(); - in_place_kernel_ = KernelDefBuilder().SetName("Clip").MayInplace(0, 0).Build(); + in_place_kernel_ = KernelDefBuilder().SetName("Relu").MayInplace(0, 0).Build(); CPUExecutionProviderInfo epi; auto execution_provider = std::make_unique(epi); execution_providers_.Add("CPUExecutionProvider", std::move(execution_provider)); diff --git a/onnxruntime/test/framework/execution_frame_test.cc b/onnxruntime/test/framework/execution_frame_test.cc index 48e2ce8c3b0e6..95a5b34f035ff 100644 --- a/onnxruntime/test/framework/execution_frame_test.cc +++ b/onnxruntime/test/framework/execution_frame_test.cc @@ -43,7 +43,7 @@ TEST(ExecutionFrameTest, TensorAllocationTest) { tensor_float.mutable_tensor_type()->set_elem_type(TensorProto_DataType_FLOAT); onnxruntime::NodeArg input_def("X", &tensor_float), output_def("Y", &tensor_float); - graph.AddNode("node1", "Clip", "Clip operator", ArgMap{&input_def}, ArgMap{&output_def}); + graph.AddNode("node1", "Relu", "Relu operator", ArgMap{&input_def}, ArgMap{&output_def}); onnxruntime::Node* node = graph.GetNode(graph.NumberOfNodes() - 1); Status status = graph.Resolve(); diff --git a/onnxruntime/test/onnx/main.cc b/onnxruntime/test/onnx/main.cc index 2f9595df6cd1f..59c5ba209445b 100644 --- a/onnxruntime/test/onnx/main.cc +++ b/onnxruntime/test/onnx/main.cc @@ -377,7 +377,38 @@ int real_main(int argc, char* argv[], Ort::Env& env) { {"shrink", "test case is wrong", {"onnx141"}}, {"maxpool_with_argmax_2d_precomputed_strides", "ShapeInferenceError"}, {"tf_inception_v2", "result mismatch"}, - {"mxnet_arcface", "result mismatch"} + {"mxnet_arcface", "result mismatch"}, + {"dynamicquantizelinear", "not implemented yet"}, + {"dynamicquantizelinear_expanded", "not implemented yet"}, + {"dynamicquantizelinear_max_adjusted", "not implemented yet"}, + {"dynamicquantizelinear_max_adjusted_expanded", "not implemented yet"}, + {"dynamicquantizelinear_min_adjusted", "not implemented yet"}, + {"dynamicquantizelinear_min_adjusted_expanded", "not implemented yet"}, + {"top_k", "not implemented yet for opset 11", {"onnxtip"}}, + {"top_k_smallest", "not implemented yet for opset 11", {"onnxtip"}}, + {"unique_not_sorted_without_axis", "not implemented yet"}, + {"unique_sorted_with_axis", "not implemented yet"}, + {"unique_sorted_with_axis_3d", "not implemented yet"}, + {"unique_sorted_without_axis", "not implemented yet"}, + {"scatter_elements_with_axis", "not implemented yet"}, + {"scatter_elements_without_axis", "not implemented yet"}, + {"round", "not implemented yet"}, + {"gather_elements_1", "not implemented yet"}, + {"gather_elements_0", "not implemented yet"}, + {"depthtospace_crd_mode_example", "not implemented yet"}, + {"depthtospace_crd_mode", "not implemented yet"}, + {"cumsum_2d_axis_1", "not implemented yet"}, + {"cumsum_2d_axis_0", "not implemented yet"}, + {"cumsum_1d_reverse_exclusive", "not implemented yet"}, + {"cumsum_1d_reverse", "not implemented yet"}, + {"cumsum_1d_exclusive", "not implemented yet"}, + {"cumsum_1d", "not implemented yet"}, + {"clip_splitbounds", "not implemented yet for opset 11"}, + {"clip_outbounds", "not implemented yet for opset 11"}, + {"clip_example", "not implemented yet for opset 11"}, + {"clip_default_min", "not implemented yet for opset 11"}, + {"clip_default_max", "not implemented yet for opset 11"}, + {"clip", "not implemented yet for opset 11"}, }; #ifdef USE_NGRAPH diff --git a/onnxruntime/test/optimizer/graph_transform_test.cc b/onnxruntime/test/optimizer/graph_transform_test.cc index 1052f1ea6378b..c5ac41be393b3 100644 --- a/onnxruntime/test/optimizer/graph_transform_test.cc +++ b/onnxruntime/test/optimizer/graph_transform_test.cc @@ -537,7 +537,10 @@ TEST(GraphTransformationTests, FuseConvBnAddMulFloat16) { } TEST(GraphTransformationTests, ReluClipFusion) { - Model model("ReluClipFusion"); + + // Clip op schema changed for opset version 11. Until Clip op is updated in ORT hard coding this model to use + // older opset. + Model model("ReluClipFusion", true, ModelMetaData(), IOnnxRuntimeOpSchemaRegistryList(), {{"", 10}}, {}); auto& graph = model.MainGraph(); std::vector inputs; diff --git a/onnxruntime/test/python/onnx_backend_test_series.py b/onnxruntime/test/python/onnx_backend_test_series.py index 703a879fdc1c3..47d1855db08ad 100644 --- a/onnxruntime/test/python/onnx_backend_test_series.py +++ b/onnxruntime/test/python/onnx_backend_test_series.py @@ -109,7 +109,19 @@ def create_backend_test(testname=None): '^test_cumsum_1d_reverse_cpu.*', '^test_cumsum_1d_reverse_exclusive_cpu.*', '^test_cumsum_2d_axis_0_cpu.*', - '^test_cumsum_2d_axis_1_cpu.*' + '^test_cumsum_2d_axis_1_cpu.*', + '^test_dynamicquantizelinear*', + '^test_dynamicquantizelinear_expanded*', + '^test_dynamicquantizelinear_max_adjusted*', + '^test_dynamicquantizelinear_max_adjusted_expanded*', + '^test_dynamicquantizelinear_min_adjusted*', + '^test_dynamicquantizelinear_min_adjusted_expanded*', + '^test_clip*', + '^test_depthtospace*', + '^test_gather_elements*', + '^test_scatter_elements*', + '^test_top_k*', + '^test_unique_*', ) # Example of how to disable tests for a specific provider. diff --git a/tools/ci_build/github/linux/docker/scripts/install_onnx.sh b/tools/ci_build/github/linux/docker/scripts/install_onnx.sh index a8495aff3a966..c15c01ec4adc5 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_onnx.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_onnx.sh @@ -13,7 +13,7 @@ version2tag=(5af210ca8a1c73aa6bae8754c9346ec54d0a756e-onnx123 bae6333e149a59a3faa9c4d9c44974373dcf5256-onnx130 9e55ace55aad1ada27516038dfbdc66a8a0763db-onnx141 7d7bc83d29a328233d3e8affa4c4ea8b3e3599ef-onnx150 - 65b8e0f9979fbade16e3becbdfa69c0764946f72-onnxtip) + 7d90796473295ca3cdf976ed772215c5980ad3e0-onnxtip) for v2t in ${version2tag[*]}; do onnx_version="$(cut -d'-' -f1<<<${v2t})" onnx_tag="$(cut -d'-' -f2<<<${v2t})"