Skip to content

Commit 8da6a4f

Browse files
authored
test: Add a test for session config in onnxruntime backend (#7962)
1 parent 4f5c810 commit 8da6a4f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

qa/L0_onnx_optimization/test.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -66,6 +66,11 @@ for MODEL in \
6666
(cd models/${MODEL}_test && \
6767
sed -i 's/_float32_float32_float32/&_test/' config.pbtxt && \
6868
echo -e "\ninstance_group { count: ${INSTANCE_COUNT} }" >> config.pbtxt) && \
69+
# Enable session.use_device_allocator_for_initializers
70+
cp -r models/${MODEL}_test models/${MODEL}_session_config && \
71+
(cd models/${MODEL}_session_config && \
72+
sed -i 's/_float32_test/_float32_session_config/' config.pbtxt && \
73+
echo "parameters: { key: \"session.use_device_allocator_for_initializers\" value: { string_value: \"1\" }}" >> config.pbtxt) && \
6974
# CUDA EP optimization params
7075
cp -r models/${MODEL}_test models/${MODEL}_cuda_config && \
7176
(cd models/${MODEL}_cuda_config && \
@@ -160,6 +165,12 @@ for MODEL in \
160165

161166
set +e
162167

168+
grep "Configuring 'session.use_device_allocator_for_initializers' to '1'" $SERVER_LOG
169+
if [ $? -ne 0 ]; then
170+
echo -e "\n***\n*** Failed. Expected Configuring 'session.use_device_allocator_for_initializers' to '1'\n***"
171+
RET=1
172+
fi
173+
163174
grep "TensorRT Execution Accelerator is set for '${MODEL}_trt'" $SERVER_LOG
164175
if [ $? -ne 0 ]; then
165176
echo -e "\n***\n*** Failed. Expected TensorRT Execution Accelerator is set for '${MODEL}_trt'\n***"

0 commit comments

Comments
 (0)