yuccaaa commited on
Commit
a838d66
·
verified ·
1 Parent(s): 7ed9196

Upload models/Qwen2.5-VL-72B-Instruct.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. models/Qwen2.5-VL-72B-Instruct.sh +111 -0
models/Qwen2.5-VL-72B-Instruct.sh ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Add parameter check
4
+ if [ $# -lt 2 ] || [ $# -gt 3 ]; then
5
+ echo "Usage: $0 <gpu_index> <tensor_parallel_size> [base_port]"
6
+ echo "Example: $0 0 4 (to use 4 GPUs starting from GPU 0 with default port 10022)"
7
+ echo " $0 0 2 8080 (to use 2 GPUs starting from GPU 0 with port 8080)"
8
+ echo "Supported tensor parallel sizes: 1, 2, 4, 8"
9
+ exit 1
10
+ fi
11
+
12
+ GPU_INDEX=$1
13
+ TP_SIZE=$2
14
+ # Use default port if not specified
15
+ BASE_PORT=${3:-10022}
16
+
17
+ # Kill existing session if it exists
18
+ tmux kill-session -t vllm-qwen-vl 2>/dev/null
19
+
20
+ NUM_INSTANCES=1
21
+
22
+ VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES
23
+ echo "CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
24
+
25
+ # Get number of available GPUs
26
+ NUM_GPUS=$(nvidia-smi --query-gpu=gpu_name --format=csv,noheader | wc -l)
27
+
28
+ # 解析CUDA_VISIBLE_DEVICES
29
+ if [ -z "$VISIBLE_DEVICES" ]; then
30
+ # 如果CUDA_VISIBLE_DEVICES未设置,使用所有可用的GPU
31
+ AVAILABLE_GPUS=$(seq 0 $((NUM_GPUS-1)) | tr '\n' ',' | sed 's/,$//')
32
+ else
33
+ # 使用CUDA_VISIBLE_DEVICES中指定的GPU
34
+ AVAILABLE_GPUS=$VISIBLE_DEVICES
35
+ fi
36
+
37
+ # 将GPU列表转换为数组
38
+ IFS=',' read -ra GPU_ARRAY <<< "$AVAILABLE_GPUS"
39
+ NUM_AVAILABLE_GPUS=${#GPU_ARRAY[@]}
40
+
41
+ # Validate tensor parallel size
42
+ if [[ ! "$TP_SIZE" =~ ^(1|2|4|8)$ ]]; then
43
+ echo "Error: Tensor parallel size must be 1, 2, 4, or 8"
44
+ exit 1
45
+ fi
46
+
47
+ # Validate GPU index and ensure enough consecutive GPUs are available
48
+ if [ $GPU_INDEX -ge $((NUM_AVAILABLE_GPUS-TP_SIZE+1)) ]; then
49
+ echo "Error: GPU index $GPU_INDEX requires $TP_SIZE consecutive GPUs. Available GPUs: 0 to $((NUM_AVAILABLE_GPUS-TP_SIZE))"
50
+ exit 1
51
+ fi
52
+
53
+ # Use the selected GPUs for tensor parallelism
54
+ SELECTED_GPU=""
55
+ for ((i=0; i<$TP_SIZE; i++)); do
56
+ if [ $i -eq 0 ]; then
57
+ SELECTED_GPU="${GPU_ARRAY[$((GPU_INDEX+i))]}"
58
+ else
59
+ SELECTED_GPU="$SELECTED_GPU,${GPU_ARRAY[$((GPU_INDEX+i))]}"
60
+ fi
61
+ done
62
+
63
+ SESSION_NAME="vllm-qwen-vl"
64
+
65
+ # Create a new tmux session
66
+ tmux new-session -d -s $SESSION_NAME
67
+
68
+ # Create windows and start servers
69
+ for ((i=0; i<$NUM_INSTANCES; i++)); do
70
+ PORT=$((BASE_PORT + i))
71
+
72
+ # Create new window
73
+ if [ $i -eq 0 ]; then
74
+ # First window already exists, just rename it
75
+ tmux rename-window -t $SESSION_NAME:0 "vllm-$PORT"
76
+ else
77
+ # Create new windows with explicit target
78
+ tmux new-window -t $SESSION_NAME: -n "vllm-$PORT"
79
+ fi
80
+
81
+ # Send commands to the window
82
+ tmux send-keys -t "$SESSION_NAME:vllm-$PORT" "proxy_off" C-m
83
+ tmux send-keys -t "$SESSION_NAME:vllm-$PORT" "echo 'Using port: $PORT on GPU $SELECTED_GPU'" C-m
84
+ # tmux send-keys -t "$SESSION_NAME:vllm-$PORT" "eval \"\$(conda shell.bash hook)\" && conda activate vllm" C-m
85
+ tmux send-keys -t "$SESSION_NAME:vllm-$PORT" "export VLLM_WORKER_MULTIPROC_METHOD=spawn" C-m
86
+ tmux send-keys -t "$SESSION_NAME:vllm-$PORT" "CUDA_VISIBLE_DEVICES=$SELECTED_GPU HF_ENDPOINT=https://hf-mirror.com python3 -m vllm.entrypoints.openai.api_server \
87
+ --model /fs-computility/ai-shen/shared/hf-hub/models--Qwen--Qwen2.5-VL-72B-Instruct/snapshots/5d8e171e5ee60e8ca4c6daa380bd29f78fe19021 \
88
+ --trust-remote-code \
89
+ --tensor-parallel-size $TP_SIZE \
90
+ --served-model-name Qwen2.5-VL-72B-Instruct \
91
+ --dtype auto \
92
+ --gpu-memory-utilization 0.88 \
93
+ --max-model-len 16384 \
94
+ --port $PORT \
95
+ --use-v2-block-manager \
96
+ --api-key sk-123456" C-m
97
+ done
98
+
99
+ # Attach to the tmux session
100
+ tmux attach-session -t $SESSION_NAME
101
+
102
+
103
+
104
+ vllm serve /fs-computility/ai-shen/shared/hf-hub/models--Qwen--Qwen2.5-VL-72B-Instruct/snapshots/d91279c190bb874c1f90cf26c70c4261bbf7488c --dtype half --port 8000 --tensor-parallel-size 4 --gpu-memory-utilization 0.9 --limit_mm_per_prompt image=10 --max_model_len 20000 --served-model-name Qwen2.5-VL-72B-Instruct
105
+
106
+ vllm serve /fs-computility/ai-shen/shared/hf-hub/models--Qwen--Qwen2.5-VL-7B-Instruct/snapshots/5b5eecc7efc2c3e86839993f2689bbbdf06bd8d4 --dtype half --port 8000 --tensor-parallel-size 4 --gpu-memory-utilization 0.9 --limit_mm_per_prompt image=10 --max_model_len 20000 --served-model-name Qwen2.5-VL-7B-Instruct
107
+
108
+
109
+ vllm serve /fs-computility/ai-shen/shared/hf-hub/models--Qwen--QwQ-32B/snapshots/976055f8c83f394f35dbd3ab09a285a984907bd0 --dtype half --port 8000 --tensor-parallel-size 8 --gpu-memory-utilization 0.9 --max_model_len 20000 --served-model-name QWQ
110
+
111
+ vllm serve /fs-computility/ai-shen/wangyujia/continue_pretrain/jiaocai_bio/pretrained/output/qwen3-text_function/v0-20250429-150135/checkpoint-3686 --dtype half --port 8000 --tensor-parallel-size 8 --gpu-memory-utilization 0.9 --max_model_len 20000 --served-model-name qwen3-function