11#! /bin/bash
22
3+ set  -e
34
45check_npus () {
56  #  shellcheck disable=SC2155
@@ -67,6 +68,16 @@ kill_npu_processes() {
6768
6869}
6970
71+ update_json_field () {
72+   local  json_file=" $1 " 
73+   local  field_name=" $2 " 
74+   local  field_value=" $3 " 
75+ 
76+   jq --arg value " $field_value " 
77+      --arg key " $field_name " 
78+      ' .[$key] = $value' " $json_file " >  " ${json_file} .tmp" &&  \
79+      mv " ${json_file} .tmp" " $json_file " 
80+ }
7081
7182run_latency_tests () {
7283  #  run latency tests using `benchmark_latency.py`
@@ -103,7 +114,9 @@ run_latency_tests() {
103114
104115    #  run the benchmark
105116    eval  " $latency_command " 
106- 
117+     #  echo model_name to result file
118+     model_name=$( echo " $latency_params " |  jq -r ' .model' ) 
119+     update_json_field " $RESULTS_FOLDER /${test_name} .json" " model_name" " $model_name " 
107120    kill_npu_processes
108121
109122  done 
@@ -144,7 +157,9 @@ run_throughput_tests() {
144157
145158    #  run the benchmark
146159    eval  " $throughput_command " 
147- 
160+     #  echo model_name to result file
161+     model_name=$( echo " $throughput_params " |  jq -r ' .model' ) 
162+     update_json_field " $RESULTS_FOLDER /${test_name} .json" " model_name" " $model_name " 
148163    kill_npu_processes
149164
150165  done 
@@ -243,7 +258,7 @@ cleanup() {
243258}
244259
245260get_benchmarks_scripts () {
246-   git clone -b main --depth=1 git@ github.com: vllm-project/vllm.git &&  \
261+   git clone -b main --depth=1 https:// github.com/ vllm-project/vllm.git &&  \
247262  mv vllm/benchmarks vllm_benchmarks
248263  rm -rf ./vllm
249264}
@@ -263,9 +278,6 @@ main() {
263278  export  VLLM_HOST_IP=$( hostname -I |  awk ' {print $1}' ) 
264279  #  turn of the reporting of the status of each request, to clean up the terminal output
265280  export  VLLM_LOG_LEVEL=" WARNING" 
266- 
267-   #  set env
268-   export  VLLM_USE_MODELSCOPE=" True" 
269281  export  HF_ENDPOINT=" https://hf-mirror.com" 
270282
271283  #  prepare for benchmarking
0 commit comments