-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·231 lines (158 loc) · 8.38 KB
/
setup.sh
File metadata and controls
executable file
·231 lines (158 loc) · 8.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
docker run --name siqi_slime_opsd --gpus all --ipc=host --shm-size=64g \
--ulimit memlock=-1 --ulimit stack=67108864 \
-v /mnt/disk1_from_server2/siqizhu4/opsd_slime:/root/slime_siqi \
-v /mnt/disk1_from_server2/siqizhu4/ray_tmp:/tmp/ray_siqi \
-v /mnt/disk1_from_server2/siqizhu4/checkpoints:/root/checkpoints_siqi \
-v /mnt/disk1_from_server2/siqizhu4/hf_cache:/root/.cache/huggingface \
-w /root/slime_siqi \
-it slimerl/slime:latest /bin/bash
docker run --name siqi_slime_opsd_v2 --gpus all --ipc=host --shm-size=64g \
--ulimit memlock=-1 --ulimit stack=67108864 \
-v /mnt/disk1_from_server2/siqizhu4/opsd_slime:/root/slime_siqi \
-v /mnt/disk1_from_server2/siqizhu4/ray_tmp:/tmp/ray_siqi \
-v /mnt/disk1_from_server2/siqizhu4/checkpoints:/root/checkpoints_siqi \
-v /mnt/disk1_from_server2/siqizhu4/hf_cache:/root/.cache/huggingface \
-w /root/slime_siqi \
-it slimerl/slime:latest /bin/bash
/data/siqizhu4/opsd_slime
examples/on_policy_distillation/run-qwen3-1.7B-opsd_grpo-openthoughts_baseline.sh
docker run --name siqi_slime_opsd --gpus all --ipc=host -p 30000:30000 --shm-size=64g \
--ulimit memlock=-1 --ulimit stack=67108864 \
-v /data/siqizhu4/opsd_slime:/root/slime_siqi \
-v /data/siqizhu4/ray_tmp:/tmp/ray_siqi \
-v /data/siqizhu4/checkpoints:/root/checkpoints_siqi \
-v /data/siqizhu4/hf_cache:/root/.cache/huggingface \
-w /root/slime_siqi \
-it slimerl/slime:latest /bin/bash
docker run --name siqi_slime_opsd --gpus all \
--network host \
--ipc=host --shm-size=64g \
--ulimit memlock=-1 --ulimit stack=67108864 \
-v /mnt/disk1_from_server2/siqizhu4/opsd_slime:/root/slime_siqi \
-v /mnt/disk1_from_server2/siqizhu4/ray_tmp:/tmp/ray_siqi \
-v /mnt/disk1_from_server2/siqizhu4/checkpoints:/root/checkpoints_siqi \
-w /root/slime_siqi \
-it slimerl/slime:latest /bin/bash
ray stop --force
pkill -9 ray
rm -rf /tmp/ray/*
rm -rf /tmp/ray_siqi/*
export HF_HOME=/mnt/disk1_from_server2/siqizhu4/hf_cache
docker exec -it siqi_slime_opsd bash
bash start.ps1
apt install iproute2 -y
export RAY_memory_usage_threshold=0.99
export RAY_memory_monitor_refresh_ms=0
export TRAIN_DATASET="open-thoughts/OpenThoughts-114k"
export TRAIN_CONFIG="metadata"
TRAIN_ANSWER_FORMAT=answer EVAL_ANSWER_FORMAT=answer bash examples/on_policy_distillation/run-qwen3-4B-opsd_pi.sh
TRAIN_ANSWER_FORMAT=boxed EVAL_ANSWER_FORMAT=boxed bash examples/on_policy_distillation/run-qwen3-4B-opsd_pi.sh
bash examples/on_policy_distillation/run-qwen3-4B-opsd_pi.sh
CUDA_VISIBLE_DEVICES=6,7 python -m sglang.launch_server \
--model-path /root/checkpoints_siqi/models--Qwen--Qwen3-30B-A3B-Instruct-2507 \
--host 0.0.0.0 \
--port 30000 \
--context-length 16384 \
--tp-size 2
CUDA_VISIBLE_DEVICES=7,8 python -m sglang.launch_server \
--model-path checkpoints/models--Qwen--Qwen3-30B-A3B-Instruct-2507 \
--host 0.0.0.0 \
--port 30000 \
--context-length 65536 \
--tp-size 2
export NCCL_P2P_DISABLE=1
CUDA_VISIBLE_DEVICES=4,5,8,9 python -m sglang.launch_server \
--model-path /root/checkpoints_siqi/models--Qwen--Qwen3-30B-A3B-Instruct-2507 \
--host 0.0.0.0 \
--port 30000 \
--context-length 32768 \
--tp-size 4
base_url="http://172.22.224.251:30000/v1"
For server1:
sed -n '1360,1370p' /sgl-workspace/sglang/python/sglang/srt/managers/tokenizer_manager.py
然后把约 1365 行的:
await self.send_to_scheduler.send_pyobj(obj)
改为(去掉 await):
self.send_to_scheduler.send_pyobj(obj)
或者用一行命令修复:
sed -i 's/await
self\.send_to_scheduler\.send_pyobj(obj)/self.send_to_scheduler.send_pyobj(obj)/' \
/sgl-workspace/sglang/python/sglang/srt/managers/tokenizer_manager.py
# 删除data文件夹的git记录
git rm -r --cached data
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
CUDA_VISIBLE_DEVICES=3,6,7,8 python3 -m sglang.launch_server --model-path /root/checkpoints_siqi/Qwen3-1.7B --port 30000 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=7 python3 -m sglang.launch_server --model-path Qwen/Qwen3-8B --port 30001 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=0,1 python3 -m sglang.launch_server --model-path /root/checkpoints_siqi/Qwen3-1.7B --port 30002 --host 0.0.0.0 --tp 2
CUDA_VISIBLE_DEVICES=4,6 python3 -m sglang.launch_server --model-path Qwen/Qwen2.5-7B-Instruct --port 30002 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=0,1 python3 -m sglang.launch_server --model-path Qwen/Qwen2.5-7B-Instruct --port 30002 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=1 python3 -m sglang.launch_server --model-path Qwen/Qwen3-8B --port 30001 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=3,4 python3 -m sglang.launch_server --model-path Qwen/Qwen3-1.7B-step29 --port 30002 --host 0.0.0.0 --tp 2
CUDA_VISIBLE_DEVICES=5 python3 -m sglang.launch_server --model-path /root/checkpoints_siqi/Qwen3-1.7B --port 30002 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=4 python3 -m sglang.launch_server --model-path Qwen/Qwen3-8B --port 30001 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=4,5,7,8 python3 -m sglang.launch_server --model-path Qwen/Qwen3-8B --port 30001 --host 0.0.0.0 --tp 4
kill -9 $(lsof -t -i :30086)
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input ./eval_math500_student_teacher_inference.jsonl \
--output ./token_winner_interactive.html \
--n-bins 200 \
--max-requests 500
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input ./eval_math500_student_teacher_inference.jsonl
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input ./eval_math500_student_teacher_inference_s1.7t8b_noanswer_v2.jsonl \
--output ./token_winner_interactive.html \
--tokenizer Qwen/Qwen3-1.7B \
--show-last-k-tokens 64
eval_math500_student_teacher_inference_s1.7t8b_same_as_student_b512.jsonl
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input eval_math500_student_teacher_inference_s1.7t1.7b_answeronly_b512.jsonl \
--output ./token_winner_interactive.html \
--tokenizer Qwen/Qwen3-1.7B \
--show-last-k-tokens 128
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input eval_math500_student_teacher_inference_s1.7t8b_answeronly_disablethinking_b512.jsonl \
--output ./token_winner_interactive.html \
--tokenizer Qwen/Qwen3-1.7B \
--show-last-k-tokens 64
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input eval_math500_student_teacher_inference_s1.7t1.7b_answeronly_disablethinking_b512.jsonl \
--output ./token_winner_interactive.html \
--tokenizer Qwen/Qwen3-1.7B \
--show-last-k-tokens 64
python examples/on_policy_distillation/plot_token_winner_interactive.py \
--input ./eval_math500_student_teacher_inference_s1.7t8b_answeronly.jsonl \
--output ./token_winner_interactive.html \
--tokenizer Qwen/Qwen3-1.7B \
--show-last-k-tokens 64
ps -o pid,ppid,user,tty,lstart,cmd -p 314845
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "default",
"messages": [
{"role": "user", "content": "What is SGLang?"}
],
"temperature": 0.7
}'
curl http://localhost:30006/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-name",
"messages": [
{"role": "user", "content": "How many rs are in strawberry?"}
],
"temperature": 0.6,
"chat_template_kwargs": {
"enable_thinking": false
}
}'
CUDA_VISIBLE_DEVICES=1 python3 -m sglang.launch_server --model-path Qwen/Qwen3-8B --port 30000 --host 0.0.0.0 --tp 1 --mem-fraction-static 0.8 --watchdog-timeout 3600
cd /root/slime_siqi
python3 tools/convert_torch_dist_to_hf.py \
--input-dir output/Qwen3-1.7B_privileged_grpo_full_openthoughts/iter_0000099 \
--output-dir /root/checkpoints_siqi/Qwen3-1.7B_privileged_grpo_full_openthoughts_step99 \
--origin-hf-dir /root/checkpoints_siqi/Qwen3-1.7B
CUDA_VISIBLE_DEVICES=2 python3 -m sglang.launch_server --model-path output/Qwen3-1.7B_openthoughts_sft_step198 --port 30000 --host 0.0.0.0 --tp 1
CUDA_VISIBLE_DEVICES=7 python3 -m sglang.launch_server --model-path output/Qwen3-1.7B_opsd_masked_grpo_dapo_hf --port 30006 --host 0.0.0.0 --tp 1