Giter VIP home page Giter VIP logo

bert-benchmark's Introduction

bert-benchmark

Work in progress

Installation

# 1. Run TensorRT Release docker
$ docker run -v $HOME:/mnt --gpus all --rm -ti nvcr.io/nvidia/tensorrt:21.10-py3

# 2. Git clone
$ git clone https://github.com/siahuat0727/bert-benchmark && \
git clone https://github.com/NVIDIA/TensorRT

# 3. Install requirements
$ cd bert-benchmark && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && rm get-pip.py && \
pip install -r requirements.txt -f https://download.pytorch.org/whl/cu113/torch_stable.html && \
cd ..

# 4. Install nnfusion
$ git clone https://github.com/microsoft/nnfusion.git /workspace/nnfusion --branch master --single-branch && \
DEBIAN_FRONTEND="noninteractive" bash /workspace/nnfusion/maint/script/install_dependency.sh && \
cd /workspace/nnfusion/ && mkdir build && cd build && cmake .. && make -j6 && make install && cd /workspace

# Optional, use venv
$ python3 -m venv env --without-pip && . env/bin/activate && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && rm get-pip.py

Verify correctness

$ bash test.sh && python3 plot.py --files max_abs_error_*.txt --type error
...
Save inference-max-abs-error.png

Run benchmark

Including PyTorch, PyTorch-JIT, ONNXRuntime, TensorRT, DeepSpeed, NNFusion

$ bash run.sh && python3 plot.py --files speed*.csv && python3 plot.py --files nvprof*.csv  --frmt nvprof
...
Save inference-speed-python.png
...
Save inference-speed-nvprof.png

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.