DeepLearningExamples/PyTorch/Translation/GNMT/scripts/tests/inference.sh
Przemek Strzelczyk a644350589 Updating models and adding BERT/PyT
Tacotron2+Waveglow/PyT
* AMP support
* Data preprocessing for Tacotron 2 training
* Fixed dropouts on LSTMCells

SSD/PyT
* script and notebook for inference
* AMP support
* README update
* updates to examples/*

BERT/PyT
* initial release

GNMT/PyT
* Default container updated to NGC PyTorch 19.05-py3
* Mixed precision training implemented using APEX AMP
* Added inference throughput and latency results on NVIDIA Tesla V100 16G
* Added option to run inference on user-provided raw input text from command line

NCF/PyT
* Updated performance tables.
* Default container changed to PyTorch 19.06-py3.
* Caching validation negatives between runs

Transformer/PyT
* new README
* jit support added

UNet Medical/TF
* inference example scripts added
* inference benchmark measuring latency added
* TRT/TF-TRT support added
* README updated

GNMT/TF
* Performance improvements

Small updates (mostly README) for other models.
2019-07-16 21:13:08 +02:00

45 lines
1.1 KiB
Bash

#!/bin/bash
set -e
DATASET_DIR='data/wmt16_de_en'
REPO_DIR='/workspace/gnmt'
REFERENCE_FILE=$REPO_DIR/scripts/tests/reference_inference_performance
MATH=$1
if [[ ${MATH} != "fp16" && ${MATH} != "fp32" ]]; then
echo "Unsupported option for MATH, use either 'fp16' or 'fp32'"
exit 1
fi
BATCH_SIZE=128
BEAM_SIZE=5
PERF_TOLERANCE=0.95
GPU_NAME=`nvidia-smi --query-gpu=gpu_name --format=csv,noheader |uniq`
echo 'GPU_NAME:' ${GPU_NAME}
REFERENCE_PERF=`grep "${MATH},${BATCH_SIZE},${BEAM_SIZE},${GPU_NAME}" \
${REFERENCE_FILE} | \cut -f 5 -d ','`
if [ -z "${REFERENCE_PERF}" ]; then
echo "WARNING: COULD NOT FIND REFERENCE PERFORMANCE FOR EXECUTED CONFIG"
TARGET_PERF=''
else
PERF_THRESHOLD=$(awk 'BEGIN {print ('${REFERENCE_PERF}' * '${PERF_TOLERANCE}')}')
TARGET_PERF='--target-perf '${PERF_THRESHOLD}
fi
cd $REPO_DIR
python3 translate.py \
--input ${DATASET_DIR}/newstest2014.en \
--reference ${DATASET_DIR}/newstest2014.de \
--output /tmp/output \
--model results/gnmt/model_best.pth \
--batch-size ${BATCH_SIZE} \
--beam-size ${BEAM_SIZE} \
--math ${MATH} \
--warmup 1 \
--target-bleu 24.3 \
${TARGET_PERF}