Ziyang commited on
Commit
ceaad3e
1 Parent(s): fd82b06

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +157 -1
README.md CHANGED
@@ -47,6 +47,7 @@ model-index:
47
  | GPT-4 (May 2023) | - | - | 88.4 | 76.8 | - | - |-|
48
  | GPT-3.5-Turbo (Nov 2023) | - | - | 72.6 | 65.9 | 81.7 | 69.4 |-|
49
  | Gemini Pro | - | - | 63.4 | 55.5 | 72.9 | 57.9 |-|
 
50
  | WizardCoder-33B-V1.1 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-33B-V1.1" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 79.9 | 73.2 | 78.9 | 66.9 | <a href="https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base/blob/main/LICENSE" target="_blank">Deepseek</a> |
51
  | WizardCoder-Python-34B-V1.0 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-Python-34B-V1.0" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 73.2 | 64.6 | 73.2 | 59.9 | <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama2</a> |
52
  | WizardCoder-15B-V1.0 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-15B-V1.0" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 59.8 | 52.4 | -- | -- | <a href="https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement" target="_blank">OpenRAIL-M</a> |
@@ -74,9 +75,164 @@ Please use **the same systems prompts strictly** with us, and we do not guarante
74
 
75
  ## How to Reproduce the Performance of WizardCoder-33B-V1.1
76
 
77
- We provide all codes [here]().
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
 
82
  ## Citation
 
47
  | GPT-4 (May 2023) | - | - | 88.4 | 76.8 | - | - |-|
48
  | GPT-3.5-Turbo (Nov 2023) | - | - | 72.6 | 65.9 | 81.7 | 69.4 |-|
49
  | Gemini Pro | - | - | 63.4 | 55.5 | 72.9 | 57.9 |-|
50
+ | DeepSeek-Coder-33B-instruct | - | - | 78.7 | 72.6 | 78.7 | 66.7 |-|
51
  | WizardCoder-33B-V1.1 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-33B-V1.1" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 79.9 | 73.2 | 78.9 | 66.9 | <a href="https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base/blob/main/LICENSE" target="_blank">Deepseek</a> |
52
  | WizardCoder-Python-34B-V1.0 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-Python-34B-V1.0" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 73.2 | 64.6 | 73.2 | 59.9 | <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama2</a> |
53
  | WizardCoder-15B-V1.0 | 🤗 <a href="https://huggingface.co/WizardLM/WizardCoder-15B-V1.0" target="_blank">HF Link</a> | 📃 <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> | 59.8 | 52.4 | -- | -- | <a href="https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement" target="_blank">OpenRAIL-M</a> |
 
75
 
76
  ## How to Reproduce the Performance of WizardCoder-33B-V1.1
77
 
78
+ We provide all codes [here](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder/src).
79
 
80
+ ```
81
+ transformers==4.36.2
82
+ vllm==0.2.5
83
+ ```
84
+
85
+ (1) HumanEval and HumanEval-Plus
86
+
87
+ - Step 1
88
+
89
+ Code Generation (w/o accelerate)
90
+ ```bash
91
+ model="WizardLM/WizardCoder-33B-V1.1"
92
+ temp=0.0
93
+ max_len=2048
94
+ pred_num=1
95
+ num_seqs_per_iter=1
96
+
97
+ output_path=preds/T${temp}_N${pred_num}_WizardCoder-33B-V1.1_Greedy_Decode
98
+
99
+ mkdir -p ${output_path}
100
+ echo 'Output path: '$output_path
101
+ echo 'Model to eval: '$model
102
+
103
+ # 164 problems, 21 per GPU if GPU=8
104
+ index=0
105
+ gpu_num=8
106
+ for ((i = 0; i < $gpu_num; i++)); do
107
+ start_index=$((i * 21))
108
+ end_index=$(((i + 1) * 21))
109
+
110
+ gpu=$((i))
111
+ echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu}
112
+ ((index++))
113
+ (
114
+ CUDA_VISIBLE_DEVICES=$gpu python humaneval_gen.py --model ${model} \
115
+ --start_index ${start_index} --end_index ${end_index} --temperature ${temp} \
116
+ --num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path} --greedy_decode
117
+ ) &
118
+ if (($index % $gpu_num == 0)); then wait; fi
119
+ done
120
+ ```
121
+
122
+ Code Generation (w/ vllm accelerate)
123
+ ```bash
124
+ model="WizardLM/WizardCoder-33B-V1.1"
125
+ temp=0.0
126
+ max_len=2048
127
+ pred_num=1
128
+ num_seqs_per_iter=1
129
+
130
+ output_path=preds/T${temp}_N${pred_num}_WizardCoder-33B-V1.1_Greedy_Decode_vllm
131
+
132
+ mkdir -p ${output_path}
133
+ echo 'Output path: '$output_path
134
+ echo 'Model to eval: '$model
135
 
136
+ CUDA_VISIBLE_DEVICES=0,1,2,3 python humaneval_gen_vllm.py --model ${model} \
137
+ --start_index 0 --end_index 164 --temperature ${temp} \
138
+ --num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path} --num_gpus 4 --overwrite
139
+ ```
140
+
141
+ - Step 2: Get the score
142
+
143
+ Install [Eval-Plus](https://github.com/evalplus/evalplus) benchmark.
144
+ ```bash
145
+ git clone https://github.com/evalplus/evalplus.git
146
+ cd evalplus
147
+ export PYTHONPATH=$PYTHONPATH:$(pwd)
148
+ pip install -r requirements.txt
149
+ ```
150
+ Get HumanEval and HumanEval-Plus scores.
151
+ ```bash
152
+ output_path=preds/T0.0_N1_WizardCoder-33B-V1.1_Greedy_Decode
153
+
154
+ echo 'Output path: '$output_path
155
+ python process_humaneval.py --path ${output_path} --out_path ${output_path}.jsonl --add_prompt
156
+
157
+ evalplus.evaluate --dataset humaneval --samples ${output_path}.jsonl
158
+ ```
159
+
160
+ (2) MBPP and MBPP-Plus
161
+
162
+ The preprocessed questions are provided in [mbppplus.json](https://github.com/nlpxucan/WizardLM/blob/main/WizardCoder/data/mbppplus.json).
163
+
164
+ - Step 1
165
+
166
+ Code Generation (w/o accelerate)
167
+ ```bash
168
+ model="WizardLM/WizardCoder-33B-V1.1"
169
+ temp=0.0
170
+ max_len=2048
171
+ pred_num=1
172
+ num_seqs_per_iter=1
173
+
174
+ output_path=preds/MBPP_T${temp}_N${pred_num}_WizardCoder-33B-V1.1_Greedy_Decode
175
+
176
+ mkdir -p ${output_path}
177
+ echo 'Output path: '$output_path
178
+ echo 'Model to eval: '$model
179
+
180
+ # 399 problems, 50 per GPU if GPU=8
181
+ index=0
182
+ gpu_num=8
183
+ for ((i = 0; i < $gpu_num; i++)); do
184
+ start_index=$((i * 50))
185
+ end_index=$(((i + 1) * 50))
186
+
187
+ gpu=$((i))
188
+ echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu}
189
+ ((index++))
190
+ (
191
+ CUDA_VISIBLE_DEVICES=$gpu python mbppplus_gen.py --model ${model} \
192
+ --start_index ${start_index} --end_index ${end_index} --temperature ${temp} \
193
+ --num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path} --mbpp_path "mbppplus.json" --greedy_decode
194
+ ) &
195
+ if (($index % $gpu_num == 0)); then wait; fi
196
+ done
197
+ ```
198
+
199
+ Code Generation (w/ vllm accelerate)
200
+ ```bash
201
+ model="WizardLM/WizardCoder-33B-V1.1"
202
+ temp=0.0
203
+ max_len=2048
204
+ pred_num=1
205
+ num_seqs_per_iter=1
206
+
207
+ output_path=preds/MBPP_T${temp}_N${pred_num}_WizardCoder-33B-V1.1_Greedy_Decode_vllm
208
+
209
+ mkdir -p ${output_path}
210
+ echo 'Output path: '$output_path
211
+ echo 'Model to eval: '$model
212
+
213
+ CUDA_VISIBLE_DEVICES=0,1,2,3 python mbppplus_gen_vllm.py --model ${model} \
214
+ --start_index ${start_index} --end_index ${end_index} --temperature ${temp} \
215
+ --num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path} --mbpp_path "mbppplus.json" --num_gpus 4
216
+ ```
217
+
218
+ - Step 2: Get the score
219
+
220
+ Install [Eval-Plus](https://github.com/evalplus/evalplus) benchmark.
221
+ ```bash
222
+ git clone https://github.com/evalplus/evalplus.git
223
+ cd evalplus
224
+ export PYTHONPATH=$PYTHONPATH:$(pwd)
225
+ pip install -r requirements.txt
226
+ ```
227
+ Get HumanEval and HumanEval-Plus scores.
228
+ ```bash
229
+ output_path=preds/MBPP_T0.0_N1_WizardCoder-33B-V1.1_Greedy_Decode
230
+
231
+ echo 'Output path: '$output_path
232
+ python mbppplus_process_preds.py --path ${output_path} --out_path ${output_path}.jsonl --add_prompt
233
+
234
+ evalplus.evaluate --dataset mbpp --samples ${output_path}.jsonl
235
+ ```
236
 
237
 
238
  ## Citation