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

Why there are so many reorders in a binary network IR trained from nncf #5817

Closed
gj-raza opened this issue May 25, 2021 · 6 comments
Closed
Assignees
Labels
category: MO Model Optimizer feature New feature request

Comments

@gj-raza
Copy link

gj-raza commented May 25, 2021

System information (version)
  • OpenVINO = 2021.1.110
  • Operating System / Platform => ubuntu 18.04
  • Problem classification: Model Conversion
  • Framework: NNCF (Pytorch 1.8.1)
  • Model name: Squeezenet (Classification)
  • CPU: Intel core i7 9700k
Detailed description

I trained a squeezenet classification model using given training pipeline script in nncf examples with XNOR binarization as compression method, keeping first conv layer as fp32 and rest of the net in binary, converted to onnx and then to IR via model optimizer and ran benchmarks with the OV's benchmark tool and found that in addition to fake quantize, there are reorders happening before every binary conv layer execution which are costly and essentially taking away the speed up that could be achieved through binarization as a result, the FPS are even lower that a full FP32 model (benchmark report attached).

As you can see below before every binary conv, a reorder is happening from nchw8c to nhwc, although as per docs of binary conv here, the binary conv layer can accept NCHW format.

Concern is, why the model optimizer/Inferece Engine is adding reorders before every bin conv and is there a way to avoid these?
Detailed benchmark counters for full FP32 model and binary model are attached for reference.

binary_net_benchmark

benchmark_detailed_counters_report_squeezenet1_1_imagenet_binary_xnor.csv
benchmark_detailed_counters_report_squeezenet_1_1_fp32.csv

benchmark_report_squeezenet1_1_imagenet_binary_xnor.csv
benchmark_report_squeezenet_1_1_fp32.csv

@gj-raza gj-raza added bug Something isn't working support_request labels May 25, 2021
@ilyachur
Copy link
Contributor

@dmitry-gorokhov Could you have a look?

@gj-raza
Copy link
Author

gj-raza commented May 28, 2021

@gj-raza
Copy link
Author

gj-raza commented Jun 10, 2021

any updates on this?

@zulkifli-halim
Copy link

zulkifli-halim commented Jun 11, 2021

Hello @gj-raza. Thank you for your patience. The developer is investigating the case and this might take some time.

Ref. 57585

@jgespino jgespino added the category: MO Model Optimizer label Jun 29, 2021
@jgespino jgespino added the PSE label Jul 13, 2021
@jgespino jgespino self-assigned this Jul 13, 2021
@jgespino
Copy link
Contributor

Hi @gj-raza

I apologize for the delay in our response. The development team has confirmed that Binary models support is currently experimental in OpenVINO. Additional optimizations still need to be implemented in order to speed up such binary models.

I will convert this issue into a feature request.

Regards,
Jesus

@jgespino jgespino added feature New feature request and removed bug Something isn't working labels Dec 20, 2021
@jgespino jgespino removed the PSE label Jun 15, 2022
@jgespino jgespino removed their assignment Nov 7, 2022
@hbalasu1
Copy link
Contributor

hbalasu1 commented Apr 5, 2023

Hi @gj-raza, thank you for your feedback on this case,
I am closing this case as it won't fix . This is because binary networks are currently a low priority for OpenVINO.

@hbalasu1 hbalasu1 closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: MO Model Optimizer feature New feature request
Projects
None yet
Development

No branches or pull requests

7 participants