forked from nlpxucan/WizardLM
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0475da2
commit 19000ab
Showing
7 changed files
with
217 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
######################################################################### | ||
# File Name: humaneval_1_dgx1.sh | ||
# Author: Xianchao Wu | ||
# mail: [email protected] | ||
# Created Time: Wed Aug 16 08:45:55 2023 | ||
######################################################################### | ||
#!/bin/bash | ||
|
||
#model="/path/to/your/model" | ||
#model="/workspace/asr/WizardLM/WizardCoder/models--WizardLM--WizardCoder-15B-V1.0/snapshots/926ca1b215c4631bc5f8c3e47173381452c23e5c" | ||
|
||
model="/workspace/asr/Llama-X/src/checkpoints_wcode/models--WizardLM--WizardCoder-15B-V1.0/snapshots/69e87732535159460155972c3fac32a6241cc0ca" | ||
temp=0.2 | ||
max_len=2048 | ||
pred_num=20 #200 | ||
num_seqs_per_iter=2 #2 | ||
|
||
output_path=preds/humaneval_T${temp}_N${pred_num}_S${num_seqs_per_iter} | ||
|
||
mkdir -p ${output_path} | ||
echo 'Output path: '$output_path | ||
echo 'Model to eval: '$model | ||
|
||
# 164 problems, 21 per GPU if GPU=8 | ||
index=0 | ||
gpu_num=8 | ||
for ((i = 0; i < $gpu_num; i++)); do | ||
start_index=$((i * 21)) | ||
end_index=$(((i + 1) * 21)) | ||
|
||
gpu=$((i)) | ||
echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu} | ||
((index++)) | ||
( | ||
CUDA_VISIBLE_DEVICES=$gpu python src/humaneval_gen.py --model ${model} \ | ||
--start_index ${start_index} \ | ||
--end_index ${end_index} \ | ||
--temperature ${temp} \ | ||
--num_seqs_per_iter ${num_seqs_per_iter} \ | ||
--N ${pred_num} \ | ||
--max_len ${max_len} \ | ||
--output_path ${output_path} | ||
) & | ||
if (($index % $gpu_num == 0)); then wait; fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
######################################################################### | ||
# File Name: humaneval_2_a100.sh | ||
# Author: Xianchao Wu | ||
# mail: [email protected] | ||
# Created Time: Thu Aug 17 23:05:32 2023 | ||
######################################################################### | ||
#!/bin/bash | ||
|
||
temp=0.2 | ||
pred_num=1 | ||
|
||
output_path=preds/humaneval_T${temp}_N${pred_num} | ||
|
||
echo 'Output path: '$output_path | ||
python src/process_humaneval.py --path ${output_path} \ | ||
--out_path ${output_path}.jsonl \ | ||
--add_prompt | ||
|
||
evaluate_functional_correctness ${output_path}.jsonl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
######################################################################### | ||
# File Name: humaneval_3_a100.sh | ||
# Author: Xianchao Wu | ||
# mail: [email protected] | ||
# Created Time: Thu Aug 17 23:20:01 2023 | ||
######################################################################### | ||
#!/bin/bash | ||
|
||
#model="WizardLM/WizardCoder-15B-V1.0" | ||
model="/workspace/asr/Llama-X/src/checkpoints_wcode/models--WizardLM--WizardCoder-15B-V1.0/snapshots/69e87732535159460155972c3fac32a6241cc0ca" | ||
|
||
temp=0.0 | ||
max_len=2048 | ||
pred_num=1 | ||
num_seqs_per_iter=1 | ||
|
||
output_path=preds/T${temp}_N${pred_num}_WizardCoder_Greedy_Decode | ||
|
||
mkdir -p ${output_path} | ||
echo 'Output path: '$output_path | ||
echo 'Model to eval: '$model | ||
|
||
# 164 problems, 21 per GPU if GPU=8 | ||
index=0 | ||
gpu_num=8 | ||
for ((i = 0; i < $gpu_num; i++)); do | ||
start_index=$((i * 21)) | ||
end_index=$(((i + 1) * 21)) | ||
|
||
gpu=$((i)) | ||
echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu} | ||
((index++)) | ||
( | ||
CUDA_VISIBLE_DEVICES=$gpu python src/humaneval_gen.py \ | ||
--model ${model} \ | ||
--start_index ${start_index} \ | ||
--end_index ${end_index} \ | ||
--temperature ${temp} \ | ||
--num_seqs_per_iter ${num_seqs_per_iter} \ | ||
--N ${pred_num} \ | ||
--max_len ${max_len} \ | ||
--output_path ${output_path} \ | ||
--greedy_decode | ||
) & | ||
if (($index % $gpu_num == 0)); then wait; fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
######################################################################### | ||
# File Name: humaneval_2_a100.sh | ||
# Author: Xianchao Wu | ||
# mail: [email protected] | ||
# Created Time: Thu Aug 17 23:05:32 2023 | ||
######################################################################### | ||
#!/bin/bash | ||
|
||
temp=0.0 | ||
pred_num=1 | ||
|
||
#output_path=preds/humaneval_T${temp}_N${pred_num} | ||
|
||
output_path=preds/T${temp}_N${pred_num}_WizardCoder_Greedy_Decode | ||
|
||
echo 'Output path: '$output_path | ||
python src/process_humaneval.py --path ${output_path} \ | ||
--out_path ${output_path}.jsonl \ | ||
--add_prompt | ||
|
||
evaluate_functional_correctness ${output_path}.jsonl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
######################################################################### | ||
# File Name: trainwcoder.sh | ||
# Author: Xianchao Wu | ||
# mail: [email protected] | ||
# Created Time: Fri Aug 18 08:03:48 2023 | ||
######################################################################### | ||
#!/bin/bash | ||
|
||
#!/bin/bash | ||
|
||
data="/workspace/asr/WizardLM/WizardCoder/data/code_alpaca_20k.json" | ||
#outdir="/workspace/asr/Llama-X/src/checkpoints_wcode" | ||
outdir="/workspace/asr/WizardLM/WizardCoder/ckpts" | ||
|
||
#deepspeed src/train_wizardcoder.py \ | ||
python -m ipdb src/train_wizardcoder.py \ | ||
--model_name_or_path "bigcode/starcoder" \ | ||
--data_path $data \ | ||
--output_dir $outdir \ | ||
--cache_dir "/workspace/asr/WizardLM/WizardCoder" \ | ||
--num_train_epochs 3 \ | ||
--model_max_length 2048 \ | ||
--per_device_train_batch_size 1 \ | ||
--per_device_eval_batch_size 1 \ | ||
--gradient_accumulation_steps 1 \ | ||
--evaluation_strategy "no" \ | ||
--save_strategy "steps" \ | ||
--save_steps 50 \ | ||
--save_total_limit 2 \ | ||
--learning_rate 2e-5 \ | ||
--warmup_steps 30 \ | ||
--logging_steps 2 \ | ||
--lr_scheduler_type "cosine" \ | ||
--report_to "tensorboard" \ | ||
--gradient_checkpointing True \ | ||
--deepspeed configs/deepspeed_config.json \ | ||
--fp16 True | ||
|