Skip to content

Commit 901b0e9

Browse files
authored
test: Add config parameter "execution_context_allocation_strategy" to TensorRT backend (#8150)
1 parent 20b8dff commit 901b0e9

File tree

10 files changed

+237
-1
lines changed

10 files changed

+237
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
failed to load 'allocation_strategy_invalid_value' version 1: Invalid argument: Invalid value for 'execution_context_allocation_strategy': 'UNKNOWN' for model instance 'allocation_strategy_invalid_value'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
parameters: {
27+
key: "execution_context_allocation_strategy"
28+
value: {
29+
string_value: "UNKNOWN"
30+
}
31+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
parameters: {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'execution_context_allocation_strategy' set to 'STATIC' for model instance 'allocation_strategy_value_1'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
parameters: {
27+
key: "execution_context_allocation_strategy"
28+
value: {
29+
string_value: "STATIC"
30+
}
31+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'execution_context_allocation_strategy' set to 'ON_PROFILE_CHANGE' for model instance 'allocation_strategy_value_2'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
parameters: {
27+
key: "execution_context_allocation_strategy"
28+
value: {
29+
string_value: "ON_PROFILE_CHANGE"
30+
}
31+
}

qa/L0_model_config/test.sh

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,26 @@ cp -r /data/inferenceserver/${REPO_VERSION}/qa_model_repository/openvino_int8_in
298298
cp /data/inferenceserver/${REPO_VERSION}/qa_model_repository/openvino_int8_int8_int8/output0_labels.txt \
299299
autofill_noplatform_success/openvino/partial_config
300300

301-
# Copy decoupled model into the model_metrics test repository.
301+
# Copy decoupled model and config files into the model_metrics test repository.
302302
for modelpath in `ls -d model_metrics/*/*`; do
303303
src_dir="/opt/tritonserver/qa/python_models/async_execute_decouple"
304304
mkdir -p $modelpath/1
305305
cp $src_dir/model.py $modelpath/1/.
306306
cat $src_dir/config.pbtxt $modelpath/partial.pbtxt > $modelpath/config.pbtxt
307307
done
308308

309+
# Copy tensorrt model and config files into the custom_parameters test repository.
310+
for modelpath in `ls -d custom_parameters/tensorrt/*/*`; do
311+
mkdir -p $modelpath/1
312+
model_name=`basename $modelpath`
313+
src_dir="/data/inferenceserver/${REPO_VERSION}/qa_model_repository/plan_float32_float32_float32"
314+
cp ${src_dir}/1/model.plan $modelpath/1/.
315+
cat ${src_dir}/config.pbtxt $modelpath/partial.pbtxt > $modelpath/config.pbtxt
316+
sed -i "s/^name:.*/name: \"${model_name}\"/" $modelpath/config.pbtxt
317+
sed -i "s/^version_policy:.*//" $modelpath/config.pbtxt
318+
sed -i "s/label_filename:.*//" $modelpath/config.pbtxt
319+
done
320+
309321
rm -f $SERVER_LOG_BASE* $CLIENT_LOG
310322
RET=0
311323

@@ -694,6 +706,82 @@ for TARGET_DIR in `ls -d model_metrics/invalid_config/*`; do
694706
fi
695707
done
696708

709+
# Run all custom_parameters tests that are expected to succeed.
710+
for TARGET_DIR in `ls -d custom_parameters/*/valid/*`; do
711+
TARGET_DIR_DOT=`echo $TARGET_DIR | tr / .`
712+
TARGET=`basename ${TARGET_DIR}`
713+
714+
SERVER_ARGS="--model-repository=`pwd`/models --log-info=true"
715+
SERVER_LOG=$SERVER_LOG_BASE.${TARGET_DIR_DOT}.log
716+
717+
rm -fr models && mkdir models
718+
cp -r ${TARGET_DIR} models/.
719+
720+
EXPECTED=models/$TARGET/expected
721+
echo -e "Test $TARGET_DIR" >> $CLIENT_LOG
722+
723+
run_server
724+
if [ "$SERVER_PID" == "0" ]; then
725+
echo -e "*** FAILED: unable to start $SERVER" >> $CLIENT_LOG
726+
RET=1
727+
else
728+
kill $SERVER_PID
729+
wait $SERVER_PID
730+
fi
731+
732+
if [ -f $EXPECTED ]; then
733+
EX_FOUND=0
734+
EX=`cat $EXPECTED`
735+
if grep ^I[0-9][0-9][0-9][0-9].*"$EX" $SERVER_LOG; then
736+
echo -e "Found \"$EX\"" >> $CLIENT_LOG
737+
EX_FOUND=1
738+
else
739+
echo -e "Not found \"$EX\"" >> $CLIENT_LOG
740+
fi
741+
if [ "$EX_FOUND" == "0" ]; then
742+
echo -e "*** FAILED: model_metrics/$TARGET" >> $CLIENT_LOG
743+
RET=1
744+
fi
745+
fi
746+
done
747+
748+
# Run all custom_parameters tests that have invalid values.
749+
for TARGET_DIR in `ls -d custom_parameters/*/invalid/*`; do
750+
TARGET_DIR_DOT=`echo $TARGET_DIR | tr / .`
751+
TARGET=`basename ${TARGET_DIR}`
752+
753+
SERVER_ARGS="--model-repository=`pwd`/models --log-info=true"
754+
SERVER_LOG=$SERVER_LOG_BASE.${TARGET_DIR_DOT}.log
755+
756+
rm -fr models && mkdir models
757+
cp -r ${TARGET_DIR} models/.
758+
759+
EXPECTED=models/$TARGET/expected
760+
echo -e "Test $TARGET_DIR" >> $CLIENT_LOG
761+
762+
# We expect all tests to fail with the expected error message
763+
run_server
764+
if [ "$SERVER_PID" != "0" ]; then
765+
echo -e "*** FAILED: unexpected success starting $SERVER" >> $CLIENT_LOG
766+
RET=1
767+
kill $SERVER_PID
768+
wait $SERVER_PID
769+
else
770+
EX_FOUND=0
771+
EX=`cat $EXPECTED`
772+
if grep ^E[0-9][0-9][0-9][0-9].*"$EX" $SERVER_LOG; then
773+
echo -e "Found \"$EX\"" >> $CLIENT_LOG
774+
EX_FOUND=1
775+
else
776+
echo -e "Not found \"$EX\"" >> $CLIENT_LOG
777+
fi
778+
if [ "$EX_FOUND" == "0" ]; then
779+
echo -e "*** FAILED: model_metrics/$TARGET" >> $CLIENT_LOG
780+
RET=1
781+
fi
782+
fi
783+
done
784+
697785
if [ $RET -eq 0 ]; then
698786
echo -e "\n***\n*** Test Passed\n***"
699787
else

qa/common/check_copyright.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"qa/L0_model_config/cli_messages/cli_override/expected",
7676
"qa/L0_model_config/cli_messages/cli_deprecation/expected",
7777
"qa/L0_model_config/model_metrics",
78+
"qa/L0_model_config/custom_parameters",
7879
"qa/L0_model_namespacing/test_duplication",
7980
"qa/L0_model_namespacing/test_dynamic_resolution",
8081
"qa/L0_model_namespacing/test_ensemble_duplication",

0 commit comments

Comments
 (0)