Git Product home page Git Product logo

benchmark-fp32-fp16-int8-with-tensorrt's Introduction

Benchmark-FP32-FP16-INT8-with-TensorRT

Benchmark inference speed of CNNs with various quantization methods with TensorRT!

Image classification

Run: inference_tensorrt.py

Hardware:Jetson Nano.

Models are converted to TensorRT unless noted.

Latency of image inference (1,3,256,256) [ms]

FP32 FP16 INT8
resnet18 26 18
resnet34 48 30
resnet50 79 42

Jetson Nano does not support INT8..

Hardware:Jetson Xavier.

Models are converted to TensorRT unless noted.

Latency of image inference (1,3,256,256) [ms]

resnet18 resnet34 resnet50
Raw 11 12 16
FP32 3.8 5.6 9.9
FP16 2.1 3.3 4.4
INT8 1.7 2.7 3.0

Image segmentation

beatles

Hardware:Jetson Xavier.

Models are converted to TensorRT unless noted.

Latency of image inference (1,3,512,512) [ms]

fcn_resnet50 fcn_resnet101 deeplabv3_resnet50 deeplabv3_resnet101
Raw 200 344 281 426
FP32 173 290 252 366
FP16 36 57 130 151
INT8 21 32 97 108

Hardware:Jetson Nano.

Latency of image inference (1,3,256,256) [ms]

fcn_resnet50
Raw 6800
FP32 767
FP16 40
INT8 NA

Hardware setup

The hardware setup seems tricky.

  • Install pytorch

https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-4-0-now-available/72048

The stable version for Jetson nano seems to be torch==1.1

For Xavier, torch==1.3 worked fine for me.

  • Install torchvision

I followed this instruction and installed torchvision==0.3.0

https://medium.com/hackers-terminal/installing-pytorch-torchvision-on-nvidias-jetson-tx2-81591d03ce32

sudo apt-get install libjpeg-dev zlib1g-dev
git clone -b v0.3.0 https://github.com/pytorch/vision torchvision
cd torchvision
sudo python3 setup.py install
  • Install torch2trt

Followed readme.

https://github.com/NVIDIA-AI-IOT/torch2trt

sudo apt-get install libprotobuf* protobuf-compiler ninja-build
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
sudo python3 setup.py install --plugins 

benchmark-fp32-fp16-int8-with-tensorrt's People

Contributors

kentaroy47 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.