opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.95k stars 55.62k forks source link

Fixed OpenVINO gemm layer #25518

Closed alexlyulkov closed 2 days ago

alexlyulkov commented 2 weeks ago

Fixed OpenVINO gemm layer The problem was that our layer didn't properly handle all the possible gemm options in OpenVINO mode Fixes #25472

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

asmorkalov commented 2 weeks ago

The related ONNX conformance test was skipped in Abduragim's PR. Please enable it back.

dkurt commented 2 weeks ago

Please change a target branch to 4.x

asmorkalov commented 1 week ago

The PR brings several test regressions with OpenVINO 2022.1.1:

[  FAILED  ] 26 tests, listed below:
[  FAILED  ] Test_Model.Keypoints_face/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_Model.TextRecognitionWithCTCPrefixBeamSearch/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Linear/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Multiplication/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Constant/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.LinearWithConstant/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.MatmulWithTwoInputs/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Alexnet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Googlenet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.CaffeNet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.RCNN_ILSVRC13/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ZFNet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ResNet18v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ResNet50v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.MobileNet_v2_FP16/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.LResNet100E_IR/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Inception_v2/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Inception_v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Shufflenet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Resnet34_kinetics/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ViT_B_32/0, where GetParam() = NGRAPH/CPU
asmorkalov commented 1 week ago

Regressions with OpenVINO 2024.0:

[  FAILED  ] Test_Int8_nets.Inception_v2/1, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_Int8_nets.Shufflenet/1, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_Model.Keypoints_face/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_Model.TextRecognition/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_Model.TextRecognitionWithCTCPrefixBeamSearch/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Linear/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Multiplication/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.Constant/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.LinearWithConstant/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_layers.MatmulWithTwoInputs/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Alexnet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Googlenet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.CaffeNet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.RCNN_ILSVRC13/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ZFNet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ResNet18v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ResNet50v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.MobileNet_v2_FP16/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.LResNet100E_IR/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Inception_v2/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Inception_v1/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Shufflenet/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.Resnet34_kinetics/0, where GetParam() = NGRAPH/CPU
[  FAILED  ] Test_ONNX_nets.ViT_B_32/0, where GetParam() = NGRAPH/CPU
asmorkalov commented 1 week ago

Failure example:

[----------] 1 test from Test_ONNX_nets
[ RUN      ] Test_ONNX_nets.Alexnet/0, where GetParam() = NGRAPH/CPU
unknown file: Failure
C++ exception with description "Check 'TRShape::broadcast_merge_into(output_shape, input_shapes[1], autob)' failed at src/core/shape_inference/include/eltwise_shape_inference.hpp:28:
While validating node 'opset1::Add Add_51 (opset1::MatMul MatMul_49[0]:f32[4096,1000], opset1::Constant Constant_50[0]:f32[1000,1]) -> (dynamic[...])' with friendly_name 'Add_51':
Argument shapes are inconsistent.
" thrown in the test body.
[  FAILED  ] Test_ONNX_nets.Alexnet/0, where GetParam() = NGRAPH/CPU (705 ms)
[----------] 1 test from Test_ONNX_nets (705 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (705 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Test_ONNX_nets.Alexnet/0, where GetParam() = NGRAPH/CPU