@@ -39,15 +39,6 @@ SAMPLE_MODELS_REPO="../../../samples/model_repository"
3939EXPECTED_NUM_TESTS=1
4040
4141# Helpers =======================================
42- function assert_curl_success {
43- message=" ${1} "
44- if [ " $code " != " 200" ]; then
45- cat ./curl.out
46- echo -e " \n***\n*** ${message} : line ${BASH_LINENO} \n***"
47- RET=1
48- fi
49- }
50-
5142rm -rf models && mkdir -p models
5243cp -r ${SAMPLE_MODELS_REPO} /vllm_model models/vllm_opt
5344# `vllm_opt` model will be loaded on server start and stay loaded throughout
@@ -58,7 +49,7 @@ sed -i 's/"gpu_memory_utilization": 0.5/"gpu_memory_utilization": 0.4/' models/v
5849
5950RET=0
6051
61- # Test vLLM metrics
52+ # Test disabling vLLM metrics reporting without parameter "REPORT_METRICS" in config.pbtxt
6253run_server
6354if [ " $SERVER_PID " == " 0" ]; then
6455 cat $SERVER_LOG
@@ -67,11 +58,11 @@ if [ "$SERVER_PID" == "0" ]; then
6758fi
6859
6960set +e
70- python3 $CLIENT_PY VLLMTritonMetricsTest.test_vllm_metrics -v > $CLIENT_LOG 2>&1
61+ python3 $CLIENT_PY VLLMTritonMetricsTest.test_vllm_metrics_disabled -v > $CLIENT_LOG 2>&1
7162
7263if [ $? -ne 0 ]; then
7364 cat $CLIENT_LOG
74- echo -e " \n***\n*** Running $CLIENT_PY VLLMTritonMetricsTest.test_vllm_metrics FAILED. \n***"
65+ echo -e " \n***\n*** Running $CLIENT_PY VLLMTritonMetricsTest.test_vllm_metrics_disabled FAILED. \n***"
7566 RET=1
7667else
7768 check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
@@ -86,8 +77,15 @@ set -e
8677kill $SERVER_PID
8778wait $SERVER_PID
8879
89- # Test disabling vLLM metrics with disable_log_stats set to true
90- sed -i ' s/"disable_log_stats": false/"disable_log_stats": true/' models/vllm_opt/1/model.json
80+ # Test disabling vLLM metrics reporting with parameter "REPORT_METRICS" set to "no" in config.pbtxt
81+ echo -e "
82+ parameters: {
83+ key: \" REPORT_METRICS\"
84+ value: {
85+ string_value:\" no\"
86+ }
87+ }
88+ " >> models/vllm_opt/config.pbtxt
9189
9290run_server
9391if [ " $SERVER_PID " == " 0" ]; then
@@ -116,9 +114,16 @@ set -e
116114kill $SERVER_PID
117115wait $SERVER_PID
118116
119- # Test vLLM metrics if disable_log_stats is not set in model.json
120- jq ' del(.disable_log_stats)' models/vllm_opt/1/model.json > " temp.json"
121- mv temp.json models/vllm_opt/1/model.json
117+ # Test vLLM metrics reporting with parameter "REPORT_METRICS" set to "no" in config.pbtxt
118+ cp ${SAMPLE_MODELS_REPO} /vllm_model/config.pbtxt models/vllm_opt
119+ echo -e "
120+ parameters: {
121+ key: \" REPORT_METRICS\"
122+ value: {
123+ string_value:\" yes\"
124+ }
125+ }
126+ " >> models/vllm_opt/config.pbtxt
122127
123128run_server
124129if [ " $SERVER_PID " == " 0" ]; then
0 commit comments