Skip to content

Commit

Permalink
Update to model generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-nv committed Oct 4, 2022
1 parent 03dda11 commit d5424fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion qa/common/gen_qa_custom_ops
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TRITON_VERSION=${TRITON_VERSION:=22.09}
TENSORFLOW_IMAGE=${TENSORFLOW_IMAGE:=nvcr.io/nvidia/tensorflow:$TRITON_VERSION-tf2-py3}
PYTORCH_IMAGE=${PYTORCH_IMAGE:=nvcr.io/nvidia/pytorch:$TRITON_VERSION-py3}

CUDA_DEVICE=0
CUDA_DEVICE=${RUNNER_ID:=0}

###
HOST_BUILD_DIR=${HOST_BUILD_DIR:=/tmp}
Expand All @@ -66,6 +66,7 @@ DESTDIR=/tmp/custom_ops
# Tensorflow
cat >$HOST_SRCDIR/$TFSCRIPT <<EOF
#!/bin/bash -x
nvidia-smi -L || true
set -e
TF_CFLAGS=\$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))')
Expand Down Expand Up @@ -114,6 +115,7 @@ fi
# PyTorch
cat >$HOST_SRCDIR/$PYTSCRIPT <<EOF
#!/bin/bash -x
nvidia-smi -L || true
set -e
python3 $SRCDIR/gen_qa_custom_ops_models.py --libtorch --models_dir=$DESTDIR
cp /root/.cache/torch_extensions/py38_cu118/custom_modulo/custom_modulo.so $DESTDIR/libtorch_modulo/.
Expand Down
7 changes: 6 additions & 1 deletion qa/common/gen_qa_model_repository
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ UBUNTU_IMAGE=${UBUNTU_IMAGE:=ubuntu:20.04}
PYTORCH_IMAGE=${PYTORCH_IMAGE:=nvcr.io/nvidia/pytorch:$TRITON_VERSION-py3}
TENSORFLOW_IMAGE=${TENSORFLOW_IMAGE:=nvcr.io/nvidia/tensorflow:$TRITON_VERSION-tf1-py3}
TENSORRT_IMAGE=${TENSORRT_IMAGE:=nvcr.io/nvidia/tensorrt:$TRITON_VERSION-py3}
CUDA_DEVICE=0
CUDA_DEVICE=${RUNNER_ID:=0}

###
HOST_BUILD_DIR=${HOST_BUILD_DIR:=/tmp}
Expand Down Expand Up @@ -187,6 +187,7 @@ if [[ "aarch64" != $(uname -m) ]] ; then

cat >$HOST_SRCDIR/$OPENVINOSCRIPT <<EOF
#!/bin/bash
nvidia-smi -L || true
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update && \
Expand Down Expand Up @@ -252,6 +253,7 @@ fi # [[ "aarch64" != $(uname -m) ]]
# ONNX
cat >$HOST_SRCDIR/$ONNXSCRIPT <<EOF
#!/bin/bash
nvidia-smi -L || true
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update && \
Expand Down Expand Up @@ -321,6 +323,7 @@ fi
# PyTorch
cat >$HOST_SRCDIR/$TORCHSCRIPT <<EOF
#!/bin/bash
nvidia-smi -L || true
set -e
python3 $SRCDIR/gen_qa_models.py --libtorch --models_dir=$DESTDIR
chmod -R 777 $DESTDIR
Expand Down Expand Up @@ -366,6 +369,7 @@ fi
# Tensorflow
cat >$HOST_SRCDIR/$TFSCRIPT <<EOF
#!/bin/bash
nvidia-smi -L || true
set -e
python3 $SRCDIR/gen_qa_models.py --graphdef --savedmodel --models_dir=$DESTDIR
chmod -R 777 $DESTDIR
Expand Down Expand Up @@ -428,6 +432,7 @@ fi
# TensorRT
cat >$HOST_SRCDIR/$TRTSCRIPT <<EOF
#!/bin/bash
nvidia-smi -L || true
set -e
export TRT_SUPPRESS_DEPRECATION_WARNINGS=1
# Models using shape tensor i/o
Expand Down
2 changes: 1 addition & 1 deletion qa/common/gen_xavier_trt_models
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
############################################################################

TRITON_VERSION=${TRITON_VERSION:=22.09}
CUDA_DEVICE=0
CUDA_DEVICE=${RUNNER_ID:=0}

HOST_BUILD_DIR=${HOST_BUILD_DIR:=/tmp}
TMP_DIR=$HOST_BUILD_DIR/${TRITON_VERSION}
Expand Down

0 comments on commit d5424fe

Please sign in to comment.