This benchmark performs object detection using SSD-ResNet34 network.
The dataset used for this benchmark is COCO 2017 validation set. You can run bash code/ssd-resnet34/tensorrt/download_data.sh
to download the dataset.
The input images are in INT8 NCHW format. Please run python3 code/ssd-resnet34/tensorrt/preprocess_data.py
to run the preprocessing.
The PyTorch model resnet34-ssd1200.pytorch is downloaded from the zenodo link provided by the MLPerf inference repository. We construct TensorRT network by reading layer and weight information from the PyTorch model. Details can be found in SSDResNet34.py.
You can download this model by running bash code/ssd-resnet34/tensorrt/download_model.sh
.
The following TensorRT plugins were used to optimize SSDResNet34 benchmark:
NMS_OPT_TRT
: optimizes non-maximum suppression operation The source codes of the plugins can be found in ../../plugin.
To further optimize performance, with minimal impact on detection accuracy, we run the computations in INT8 precision.
Run the following commands from within the container to run inference through LoadGen:
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO> --test_mode=PerformanceOnly"
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO> --test_mode=AccuracyOnly"
To run inference through Triton Inference Server and LoadGen:
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO> --config_ver=triton --test_mode=PerformanceOnly"
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO> --config_ver=triton --test_mode=AccuracyOnly"
The performance and the accuracy results will be printed to stdout, and the LoadGen logs can be found in build/logs
.
Follow these steps to run inference with new weights:
- Replace
build/models/SSDResNet34/resnet34-ssd1200.pytorch
with new PyTorch model. - Run
make calibrate RUN_ARGS="--benchmarks=ssd-resnet34"
to generate a new calibration cache. - Run inference by
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO>"
.
Follow these steps to run inference with new validation dataset:
- Put the validation dataset under
build/data/coco/val2017
and the new annotation data underbuild/data/coco/annotations
. - Modify
data_maps/imagenet/val_map.txt
to contain all the file names of the new validation dataset according to their order in the annotation file. - Preprocess data by
python3 code/ssd-resnet34/tensorrt/preprocess_data.py --val_only
. - Run inference by
make run RUN_ARGS="--benchmarks=ssd-resnet34 --scenarios=<SCENARIO>"
.
Follow these steps to generate a new calibration cache with new calibration dataset:
- Put the calibration dataset under
build/data/coco/train2017
and the new annotation data underbuild/data/coco/annotations
. - Modify
data_maps/imagenet/cal_map.txt
to contain all the file names of the new calibration dataset. - Preprocess data by
python3 code/ssd-resnet34/tensorrt/preprocess_data.py --cal_only
. - Run
make calibrate RUN_ARGS="--benchmarks=ssd-resnet34"
to generate a new calibration cache.