Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mismatch key vs name gpu io test #5143

Merged
merged 5 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add mismatch key name gpu io test
  • Loading branch information
kthui committed Dec 8, 2022
commit 9eed25860cb161938dfe48296d1d746f4edda523
Binary file not shown.
44 changes: 44 additions & 0 deletions qa/L0_tf_gpu_io/mismatch_key_name/config.pbtxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

name: "mismatch_key_name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name it differently, IIUC, it is still an valid model, just that its signature def expose the I/O in names different from the tensor names in the TF graph.

I think the model created from gen_tag_sigdef.py has this characteristic so you should be able to re-use that for this test case. CC @jbkyang-nvi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Updated.

platform: "tensorflow_savedmodel"
max_batch_size: 0

input [
{
name: "INPUT0_key"
data_type: TYPE_FP32
dims: [ -1 ]
}
]
output [
{
name: "OUTPUT0_key"
data_type: TYPE_FP32
dims: [ -1 ]
}
]
76 changes: 48 additions & 28 deletions qa/L0_tf_gpu_io/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
# Copyright 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -42,6 +42,7 @@ export CUDA_VISIBLE_DEVICES=0

CLIENT=../clients/perf_client
BACKENDS=${BACKENDS:="graphdef savedmodel"}
MODEL_TYPES="$BACKENDS mismatch_key_name"
kthui marked this conversation as resolved.
Show resolved Hide resolved
TENSOR_SIZE=16384

DATADIR=/data/inferenceserver/${REPO_VERSION}
Expand All @@ -50,24 +51,43 @@ SERVER=/opt/tritonserver/bin/tritonserver
source ../common/util.sh

RET=0
rm -f ./*.log

#
# Use "identity" model for all model types.
#
rm -f ./*.log
for BACKEND in $BACKENDS; do
MODEL_NAME=${BACKEND}_zero_1_float32
rm -fr models && mkdir -p models
cp -r $DATADIR/qa_identity_model_repository/${MODEL_NAME} \
models/${MODEL_NAME}_def && \
(cd models/${MODEL_NAME}_def && \
sed -i 's/_zero_1_float32/&_def/' config.pbtxt) && \
# Enable GPU I/O for TensorFlow model
cp -r models/${MODEL_NAME}_def models/${MODEL_NAME}_gpu && \
(cd models/${MODEL_NAME}_gpu && \
sed -i 's/_zero_1_float32_def/_zero_1_float32_gpu/' \
config.pbtxt && \
echo "optimization { execution_accelerators { gpu_execution_accelerator : [ { name : \"gpu_io\"} ] } }" >> config.pbtxt)
for MODEL_TYPE in $MODEL_TYPES; do

# Setup models
rm -rf models && mkdir -p models
if [[ " ${BACKENDS[*]} " =~ " ${MODEL_TYPE} " ]]; then
MODEL_NAME=${MODEL_TYPE}_zero_1_float32
INPUT_NAME="INPUT0"
# Copy from qa_identity_model_repository
cp -r $DATADIR/qa_identity_model_repository/${MODEL_NAME} \
models/${MODEL_NAME}_def && \
(cd models/${MODEL_NAME}_def && \
sed -i 's/_zero_1_float32/&_def/' config.pbtxt) && \
# Enable GPU I/O for TensorFlow model
cp -r models/${MODEL_NAME}_def models/${MODEL_NAME}_gpu && \
(cd models/${MODEL_NAME}_gpu && \
sed -i 's/_zero_1_float32_def/_zero_1_float32_gpu/' \
config.pbtxt && \
echo "optimization { execution_accelerators { gpu_execution_accelerator : [ { name : \"gpu_io\"} ] } }" >> config.pbtxt)
else
MODEL_NAME=${MODEL_TYPE}
INPUT_NAME="INPUT0_key"
# Copy a special model
cp -r ${MODEL_NAME} models/${MODEL_NAME}_def && \
(cd models/${MODEL_NAME}_def && \
sed -i "s/${MODEL_NAME}/&_def/" config.pbtxt) && \
# Enable GPU I/O for TensorFlow model
cp -r models/${MODEL_NAME}_def models/${MODEL_NAME}_gpu && \
(cd models/${MODEL_NAME}_gpu && \
sed -i "s/${MODEL_NAME}_def/${MODEL_NAME}_gpu/" \
config.pbtxt && \
echo "optimization { execution_accelerators { gpu_execution_accelerator : [ { name : \"gpu_io\"} ] } }" >> config.pbtxt)
fi

SERVER_ARGS="--model-repository=`pwd`/models --log-verbose=1"
SERVER_LOG="${MODEL_NAME}.serverlog"
Expand All @@ -80,8 +100,8 @@ for BACKEND in $BACKENDS; do

set +e

$CLIENT -m${MODEL_NAME}_def --shape INPUT0:${TENSOR_SIZE} \
>> ${BACKEND}.sanity.log 2>&1
$CLIENT -m${MODEL_NAME}_def --shape ${INPUT_NAME}:${TENSOR_SIZE} \
>> ${MODEL_TYPE}.sanity.log 2>&1
if (( $? != 0 )); then
RET=1
fi
Expand All @@ -92,8 +112,8 @@ for BACKEND in $BACKENDS; do
RET=1
fi

$CLIENT -m${MODEL_NAME}_gpu --shape INPUT0:${TENSOR_SIZE} \
>> ${BACKEND}.gpu.sanity.log 2>&1
$CLIENT -m${MODEL_NAME}_gpu --shape ${INPUT_NAME}:${TENSOR_SIZE} \
>> ${MODEL_TYPE}.gpu.sanity.log 2>&1
if (( $? != 0 )); then
RET=1
fi
Expand All @@ -105,14 +125,14 @@ for BACKEND in $BACKENDS; do
fi

# Sample latency results
$CLIENT -m${MODEL_NAME}_def --shape INPUT0:${TENSOR_SIZE} \
>> ${BACKEND}.log 2>&1
$CLIENT -m${MODEL_NAME}_def --shape ${INPUT_NAME}:${TENSOR_SIZE} \
>> ${MODEL_TYPE}.log 2>&1
if (( $? != 0 )); then
RET=1
fi

$CLIENT -m${MODEL_NAME}_gpu --shape INPUT0:${TENSOR_SIZE} \
>> ${BACKEND}.gpu.log 2>&1
$CLIENT -m${MODEL_NAME}_gpu --shape ${INPUT_NAME}:${TENSOR_SIZE} \
>> ${MODEL_TYPE}.gpu.log 2>&1
if (( $? != 0 )); then
RET=1
fi
Expand All @@ -123,11 +143,11 @@ for BACKEND in $BACKENDS; do
wait $SERVER_PID
done

for BACKEND in $BACKENDS; do
echo -e "\n${BACKEND}\n************"
cat ${BACKEND}.log
echo -e "\n${BACKEND} with GPU I/O\n************"
cat ${BACKEND}.gpu.log
for MODEL_TYPE in $MODEL_TYPES; do
echo -e "\n${MODEL_TYPE}\n************"
cat ${MODEL_TYPE}.log
echo -e "\n${MODEL_TYPE} with GPU I/O\n************"
cat ${MODEL_TYPE}.gpu.log
done
kthui marked this conversation as resolved.
Show resolved Hide resolved

if [ $RET -eq 0 ]; then
Expand Down