Skip to content

Commit 58d10b8

Browse files
committed
fix shell check
Signed-off-by: wangli <wangli858794774@gmail.com>
1 parent 75f125b commit 58d10b8

File tree

10 files changed

+39
-35
lines changed

10 files changed

+39
-35
lines changed

.github/format_pr_body.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
34
#
@@ -15,7 +16,6 @@
1516
# This file is a part of the vllm-ascend project.
1617
# Adapted from vllm/.github/scripts/cleanup_pr_body.sh
1718

18-
#!/bin/bash
1919

2020
set -eux
2121

benchmarks/scripts/run-performance-benchmarks.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ ensure_sharegpt_downloaded() {
2525
if [ ! -f "$FILE" ]; then
2626
echo "$FILE not found, downloading from hf-mirror ..."
2727
mkdir -p "$DIR"
28-
wget -O "$FILE" https://hf-mirror.com/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json
29-
if [ $? -ne 0 ]; then
28+
if ! wget -O "$FILE" https://hf-mirror.com/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json; then
3029
echo "Download failed!" >&2
3130
return 1
3231
fi

examples/run_dp_attention_etp16_benmark.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,34 @@ rate_array=(0.7)
66

77
# Result file
88
result_file="benchmark_results.txt"
9-
echo "Benchmark Results" > $result_file
10-
echo "===================" >> $result_file
9+
{
10+
echo "Benchmark Results"
11+
echo "==================="
12+
} > $result_file
1113

1214
# Loop through all combinations
1315
for concurrency in "${concurrency_array[@]}"; do
1416
for rate in "${rate_array[@]}"; do
1517
echo "Testing with concurrency=$concurrency, rate=$rate"
16-
echo "" >> $result_file
17-
echo "Concurrency: $concurrency, Request Rate: $rate" >> $result_file
18-
echo "-------------------" >> $result_file
18+
{
19+
echo ""
20+
echo "Concurrency: $concurrency, Request Rate: $rate"
21+
echo "-------------------"
22+
} >> "$result_file"
1923

2024
# Run benchmark test
2125
python /mnt/deepseek/vllm/benchmarks/benchmark_serving.py \
2226
--backend vllm \
2327
--trust-remote-code \
2428
--model auto \
25-
--tokenizer /mnt/deepseek/DeepSeek-R1-W8A8-VLLM \
29+
--tokenizer /mnt/deepseek/DeepSeek-R1-W8A8-VLLM \
2630
--dataset-name random \
2731
--random-input-len 4096 \
2832
--random-output-len 1536 \
2933
--ignore-eos \
3034
--num-prompts 400 \
31-
--max-concurrency $concurrency \
32-
--request-rate $rate \
35+
--max-concurrency "$concurrency" \
36+
--request-rate "$rate" \
3337
--metric-percentiles 90 \
3438
--base-url http://localhost:8006 2>&1 | tee -a $result_file
3539

@@ -38,15 +42,14 @@ for concurrency in "${concurrency_array[@]}"; do
3842
done
3943
done
4044

41-
# Analyze results
42-
echo "Analysis Results" > analysis_results.txt
43-
echo "=================" >> analysis_results.txt
44-
45-
# Extract and analyze TPOT data
46-
echo "TPOT Analysis:" >> analysis_results.txt
47-
grep "Mean TPOT" $result_file | awk -F':' '{
45+
{
46+
echo "Analysis Results"
47+
echo "================="
48+
echo "TPOT Analysis:"
49+
grep "Mean TPOT" "$result_file" | awk -F':' '{
4850
printf "Concurrency %s, Rate %s: %s ms\n", $1, $2, $3
49-
}' >> analysis_results.txt
51+
}'
52+
} > analysis_results.txt
5053

5154
# Extract and analyze throughput data
5255
echo -e "\nThroughput Analysis:" >> analysis_results.txt

examples/run_dp_server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ vllm serve /data/weights/Qwen2.5-0.5B-Instruct \
2727
--max-model-len 2000 \
2828
--max-num-batched-tokens 2000 \
2929
--trust-remote-code \
30-
--gpu-memory-utilization 0.9 \
30+
--gpu-memory-utilization 0.9

tests/e2e/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function create_vllm_venv() {
6868

6969
function get_version() {
7070
local VERSION_NAME="$1"
71-
python3 "${SCRIPT_DIR}/../../docs/source/conf.py" | jq .${VERSION_NAME} | tr -d '"'
71+
python3 "${SCRIPT_DIR}/../../docs/source/conf.py" | jq ."${VERSION_NAME}" | tr -d '"'
7272
}
7373

7474
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)

tests/e2e/pd_disaggreate/setup_pd.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ function run_prefill_instance() {
5959
}')
6060

6161
# start prefill instance
62-
ASCEND_RT_VISIBLE_DEVICES=0 vllm serve $model_name \
62+
ASCEND_RT_VISIBLE_DEVICES=0 vllm serve "$model_name" \
6363
--host 0.0.0.0 \
64-
--port $prefill_port \
65-
--tensor-parallel-size $tp_size \
64+
--port "$prefill_port" \
65+
--tensor-parallel-size "$tp_size" \
6666
--served-model-name Deepseek \
6767
--max-model-len 2000 \
6868
--trust-remote-code \
@@ -110,10 +110,10 @@ function run_decode_instance() {
110110
}')
111111

112112
# start decode instance
113-
ASCEND_RT_VISIBLE_DEVICES=1 vllm serve $model_name \
113+
ASCEND_RT_VISIBLE_DEVICES=1 vllm serve "$model_name" \
114114
--host 0.0.0.0 \
115-
--port $decode_port \
116-
--tensor-parallel-size $tp_size \
115+
--port "$decode_port" \
116+
--tensor-parallel-size "$tp_size" \
117117
--seed 1024 \
118118
--served-model-name Deepseek \
119119
--max-model-len 2000 \

tests/e2e/run_disagg_pd.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
set -eo errexit
2121

22-
. $(dirname "$0")/common.sh
23-
. $(dirname "$0")/pd_disaggreate/setup_pd.sh
22+
. "$(dirname "$0")/common.sh"
23+
. "$(dirname "$0")/pd_disaggreate/setup_pd.sh"
2424

2525
export VLLM_USE_MODELSCOPE="True"
2626

@@ -30,9 +30,11 @@ TP_SIZE=1
3030

3131
# TODO: support multi-card
3232
prefill_ip=$(/usr/local/Ascend/driver/tools/hccn_tool -i 0 -ip -g | grep "ipaddr" | awk -F: '{print $2}' | xargs)
33+
# shellcheck disable=SC2089,SC2090
3334
PREFILL_DEVICE_IPS="[\"$prefill_ip\"]"
3435

3536
decode_ip=$(/usr/local/Ascend/driver/tools/hccn_tool -i 1 -ip -g | grep "ipaddr" | awk -F: '{print $2}' | xargs)
37+
# shellcheck disable=SC2089,SC2090
3638
DECODE_DEVICE_IPS="[\"$decode_ip\"]"
3739

3840
_info "====> Start pd disaggregated test"
@@ -44,14 +46,14 @@ _info "Started pd disaggregated proxy server"
4446
PREFILL_PROC_NAME="Prefill-instance"
4547
PREFILL_PORT=8001
4648
_info "Starting prefill instance"
47-
run_prefill_instance $MODEL_NAME $TP_SIZE $PREFILL_PORT $REGISTER_PORT $PREFILL_DEVICE_IPS $DECODE_DEVICE_IPS &
49+
run_prefill_instance $MODEL_NAME $TP_SIZE $PREFILL_PORT $REGISTER_PORT "$PREFILL_DEVICE_IPS" "$DECODE_DEVICE_IPS" &
4850
_info "Waiting for prefill instance ready"
4951
wait_url_ready $PREFILL_PROC_NAME "http://localhost:${PREFILL_PORT}/v1/completions"
5052

5153
DECODE_PROC_NAME="Decode-instance"
5254
DECODE_PORT=8002
5355
_info "Starting decode instance"
54-
run_decode_instance $MODEL_NAME $TP_SIZE $DECODE_PORT $REGISTER_PORT $PREFILL_DEVICE_IPS $DECODE_DEVICE_IPS &
56+
run_decode_instance $MODEL_NAME $TP_SIZE $DECODE_PORT $REGISTER_PORT "$PREFILL_DEVICE_IPS" "$DECODE_DEVICE_IPS" &
5557
_info "Waiting for decode instance ready"
5658
wait_url_ready $DECODE_PROC_NAME "http://localhost:${DECODE_PORT}/v1/completions"
5759

tests/e2e/run_doctests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
set -eo errexit
2121

22-
. $(dirname "$0")/common.sh
22+
. "$(dirname "$0")/common.sh"
2323

2424
export VLLM_USE_MODELSCOPE=true
2525
export VLLM_LOGGING_LEVEL=ERROR

tools/mypy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ "$CI" -eq 1 ]; then
2626
set -e
2727
fi
2828

29-
if [ $PYTHON_VERSION == "local" ]; then
29+
if [ "$PYTHON_VERSION" == "local" ]; then
3030
PYTHON_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
3131
fi
3232

tools/shellcheck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ if ! [ -x "$(command -v shellcheck)" ]; then
4040
export PATH
4141
fi
4242

43-
should enable this
43+
# should enable this
4444
find . -path ./.git -prune -o -name "*.sh" -print0 \
45-
| xargs -0 -I {} sh -c 'git check-ignore -q "{}" || shellcheck -s bash "{}"'
45+
| xargs -0 -I {} sh -c 'git check-ignore -q "{}" || shellcheck -s bash -e SC1091 "{}"'

0 commit comments

Comments
 (0)