| | source /mnt/weka/peacock/idc/cronscript/venv/bin/activate ; |
| |
|
| | |
| | |
| | ckpt_dir="/mnt/weka/peacock/idc/cronscript/ckpts/" |
| | tools_dir="/mnt/weka/peacock/idc/mint/docker/intel_code/llama13b/Model-References/PyTorch/nlp/DeepSpeedExamples/Megatron-DeepSpeed_old/tools" |
| | |
| | old_ckpt_dir=$ckpt_dir"/checkpoints_zero_stage_2/" |
| |
|
| | univ_ckpt_dir=$ckpt_dir"/universal/" |
| | hf_ckpt_dir=$ckpt_dir"/hf_ckpt/" |
| |
|
| | mkdir -p $old_ckpt_dir $univ_ckpt_dir $hf_ckpt_dir |
| | wandb login 2b6ad71e332b0a53ea11b7282d283cc28b7e22a6 |
| | accelerate config --config_file /mnt/weka/peacock/idc/cronscript/default_config.yaml |
| |
|
| | export PYTHONPATH="${PYTHONPATH}:/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness" |
| | |
| |
|
| | old_ckpt_file=$old_ckpt_dir"/proc_files.txt" |
| | if [ ! -f $old_ckpt_file ]; then |
| | touch $old_ckpt_file |
| | fi |
| | readarray -t old_files < $old_ckpt_file |
| | new_files=($(ls -l $old_ckpt_dir | grep ^d | awk '{print $NF'})) |
| | if [ ${#old_files[@]} > ${#new_files[@]} ]; then |
| | touch $old_ckpt_file |
| | readarray -t old_files < $old_ckpt_file |
| | fi; |
| | new_ckpts=($(echo ${old_files[@]} ${new_files[@]} | tr ' ' '\n' | sort | uniq -u )) |
| | for ckpt in ${new_ckpts[@]}; do |
| | echo "evaluation running for ${ckpt}..." |
| | convert_ds_to_univ="python $tools_dir/convert_checkpoint/ds_to_universal.py --input_folder $old_ckpt_dir/$ckpt --output_folder $univ_ckpt_dir/$ckpt" |
| | convert_univ_to_hf="python $tools_dir/convert_checkpoint/universal_to_huggingface.py --universal-dir $univ_ckpt_dir/$ckpt --hf-dir $hf_ckpt_dir/$ckpt --model-type llama --config $ckpt_dir/mds_to_hf_llama_custom.json" |
| | |
| | run_cmd="accelerate launch --main_process_port 39500 -m lm_eval --model hf --model_args pretrained=$hf_ckpt_dir/$ckpt --tasks indiccopa-hi --batch_size auto --wandb_args project=bharatgpt,group=trial_expt_1" |
| | cd /mnt/weka/peacock/idc/mint/docker/intel_code/llama13b/Model-References/PyTorch/nlp/DeepSpeedExamples/Megatron-DeepSpeed_old/ |
| | eval $convert_ds_to_univ |
| | eval $convert_univ_to_hf |
| | cp /mnt/weka/peacock/idc/cronscript/ckpts/hf_ckpt/tokenizer.model $hf_ckpt_dir/$ckpt/ |
| | cd /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness |
| | eval $run_cmd |
| | |
| | done; |
| |
|