Triton Paddle Backend

September 6, 2022 · View on GitHub

English | 简体中文

Triton Paddle Backend

Table of Contents

Quick Start

Pull Image

docker pull paddlepaddle/triton_paddle:21.10

Note: Only Triton Inference Server 21.10 image is supported.

Create A Model Repository

The model repository is the directory where you place the models that you want Triton to server. An example model repository is included in the examples. Before using the repository, you must fetch it by the following scripts.

$ cd examples
$ ./fetch_models.sh
$ cd .. # back to root of paddle_backend

Launch Triton Inference Server

  1. Launch the image
$ docker run --gpus=all --rm -it --name triton_server --net=host -e CUDA_VISIBLE_DEVICES=0 \
           -v `pwd`/examples/models:/workspace/models \
           paddlepaddle/triton_paddle:21.10 /bin/bash
  1. Launch the triton inference server
/opt/tritonserver/bin/tritonserver --model-repository=/workspace/models

Note: /opt/tritonserver/bin/tritonserver --help for all available parameters

Verify Triton Is Running Correctly

Use Triton’s ready endpoint to verify that the server and the models are ready for inference. From the host system use curl to access the HTTP endpoint that indicates server status.

$ curl -v localhost:8000/v2/health/ready
...
< HTTP/1.1 200 OK
< Content-Length: 0
< Content-Type: text/plain

The HTTP request returns status 200 if Triton is ready and non-200 if it is not ready.

Examples

Before running the examples, please make sure the triton server is running correctly.

Change working directory to examples

$ cd examples

ERNIE Base

ERNIE-2.0 is a pre-training framework for language understanding.

Steps to run the benchmark on ERNIE

$ bash perf_ernie.sh

ResNet50 v1.5

The ResNet50-v1.5 is a modified version of the original ResNet50 v1 model.

Steps to run the benchmark on ResNet50-v1.5

$ bash perf_resnet50_v1.5.sh

Steps to run the inference on ResNet50-v1.5.

  1. Prepare processed images following DeepLearningExamples and place imagenet folder under examples directory.

  2. Run the inference

$ bash infer_resnet_v1.5.sh imagenet/<id>

Performance

ERNIE Base (T4)

PrecisionBackend AcceleratorClient Batch SizeSequences/secondP90 Latency (ms)P95 Latency (ms)P99 Latency (ms)Avg Latency (ms)
FP16TensorRT1270.03.8133.8464.0073.692
FP16TensorRT2500.44.2824.3324.7093.980
FP16TensorRT4831.25.1415.2425.5694.797
FP16TensorRT81128.07.7887.9498.2557.089
FP16TensorRT161363.212.70212.99313.50711.738
FP16TensorRT321529.622.49522.81724.63420.901

ResNet50 v1.5 (V100-SXM2-16G)

PrecisionBackend AcceleratorClient Batch SizeSequences/secondP90 Latency (ms)P95 Latency (ms)P99 Latency (ms)Avg Latency (ms)
FP16TensorRT1288.83.4943.5243.6083.462
FP16TensorRT2494.04.0834.1104.2084.047
FP16TensorRT4758.45.3275.3595.4605.273
FP16TensorRT81044.87.7287.7707.9497.658
FP16TensorRT161267.212.74212.81013.88312.647
FP16TensorRT321113.628.84029.04430.35728.641
FP16TensorRT641100.858.51258.64259.96758.251
FP16TensorRT1281049.6121.371121.834123.371119.991

ResNet50 v1.5 (T4)

PrecisionBackend AcceleratorClient Batch SizeSequences/secondP90 Latency (ms)P95 Latency (ms)P99 Latency (ms)Avg Latency (ms)
FP16TensorRT1291.83.4713.4893.5313.427
FP16TensorRT2466.04.3234.3364.3824.288
FP16TensorRT4665.66.0316.0716.1426.011
FP16TensorRT8833.69.6629.6849.7679.609
FP16TensorRT16899.218.06118.20818.89917.748
FP16TensorRT32761.642.33343.45644.16741.740
FP16TensorRT64793.679.86080.41080.80779.680
FP16TensorRT128793.6158.207158.278158.643157.543