r/MachineLearning • u/markurtz • Aug 21 '21
Project [P] Tutorial: Prune and quantize YOLOv5 for 12x smaller size and 10x better performance on CPUs
13
u/skydivingdutch Aug 21 '21
How are the PR curves?
12
u/markurtz Aug 21 '21
Hi skydivingdutch, overall the PR curves look similar when comparing the sparse-quantized and dense networks. We have the transfer learning results for the VOC dataset available on weights and biases here which include PR curves if you'd like to dive in more.
6
u/Carvalho96 Aug 21 '21
What would your performance look like on a raspberry pi model 4p? Run any relevant experiments?
1
u/markurtz Aug 22 '21
Hi Carvalho96, the DeepSparse Engine currently only sports x86 architectures. So a raspberry pi is unfortunately unsupported at this time since it is ARM based. This is something we looking at supporting in the medium term, though!
4
u/Saffie91 Aug 21 '21
Nice might try it out. Did you do quantization after training or did you do quantization aware learning?
8
u/markurtz Aug 21 '21
Hi Saffie91, we ran quantization aware training after gradual magnitude pruning. We found that QAT performed much better than post training quantization for these detection networks and especially for the pruned networks.
4
u/apockill Aug 22 '21
How does this compare to using OpenVINO's model optimizer to optimize for CPU performance?
0
Aug 21 '21
[deleted]
11
u/markurtz Aug 21 '21
Hi BusyBoredom, both videos are being processed at the FPS rate given on the left in the video. We have the source code here so you can run it/dive in more if you'd like!
52
u/markurtz Aug 21 '21
Hi everyone!
We wanted to share our latest open-source research on sparsifying YOLOv5. By applying both pruning and INT8 quantization to the model, we are able to achieve 12x smaller model file sizes and 10x faster inference performance on CPUs.
You can apply our research to your own data by visiting neuralmagic.com/yolov5
And if you’d like to go deeper into how we optimized it, check out our recent YOLOv5 blog: neuralmagic.com/blog/benchmark-yolov5-on-cpus-with-deepsparse/