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

the calculation of the FullyConnected layer takes a lot of time #887

Closed
zhaohb opened this issue Aug 27, 2021 · 2 comments
Closed

the calculation of the FullyConnected layer takes a lot of time #887

zhaohb opened this issue Aug 27, 2021 · 2 comments

Comments

@zhaohb
Copy link

zhaohb commented Aug 27, 2021

now I have a model, and I've pressed it with benchmark and found that the FullyConnected layer takes a lot of time,about 25% of the total inference time:

dense/BiasAdd                 EXECUTED       layerType: FullyConnected     realTime: 4481      cpu: 4481           execType: jit_gemm_FP32
...
dense_2/BiasAdd               EXECUTED       layerType: FullyConnected     realTime: 4490      cpu: 4490           execType: jit_gemm_FP32
...

In this link https://toscode.gitee.com/vinsonSpace/openvino/blob/master/build-instruction.md saw that GEMM can be accelerated through openblas or MKL:

image

I want to use mkl:

cmake ..     -DENABLE_CLDNN=OFF     -DENABLE_OPENCV=OFF     -DENABLE_VPU=OFF     -DENABLE_PYTHON=ON    -DNGRAPH_ONNX_IMPORT_ENABLE=ON -DNGRAPH_ONNX_FRONTEND_ENABLE=ON  -DNGRAPH_ONNX_EDITOR_ENABLE=ON  -DGEMM=MKL -DMKLROOT=/work/compile_ov_20214/mklml_lnx_2019.0.5.20190502  -DCMAKE_INSTALL_PREFIX=/work/compile_ov_20214/openvino_dist

but I am reminded that this GEMM macro is not available.

CMake Warning:
  Manually-specified variables were not used by the project:

    GEMM
    DMKLROOT
......

openvino doesn't support this macro?

@zhaohb
Copy link
Author

zhaohb commented Aug 27, 2021

my bad, GEMM macros can be set in version 2021.1, but now I'm using 2021.4.
but how do I choose gemm's implementation? Or will it automatically choose the best performance implementation, MKL or openblas?

@mzegla
Copy link
Collaborator

mzegla commented Sep 7, 2021

This issue is not related to the model server, but OpenVINO itself.
I can see the thread is continued in openvinotoolkit/openvino#7273, so I'm closing this one.

@mzegla mzegla closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants