pip3 install deepspeed==0.14.0

MASTER_ADDR=${ARNOLD_WORKER_0_HOST}
MASTER_PORT=(${ARNOLD_WORKER_0_PORT//,/ })
NPROC_PER_NODE=${ARNOLD_WORKER_GPU}
NNODES=${ARNOLD_WORKER_NUM}
NODE_RANK=${ARNOLD_ID}
export MASTER_ADDR
export MASTER_PORT
export NPROC_PER_NODE
export NNODES
export NODE_RANK

cd /.../.../.../fastchat/

RUN_CMD="torchrun --master_port=${MASTER_PORT} --master_addr=${MASTER_ADDR} --nproc_per_node=${NPROC_PER_NODE} --nnodes=${NNODES} --node_rank=${NODE_RANK} "
export RUN_CMD


OTHER="--use_peft=True --lora_r=16 --lora_alpha=16   --my_task_name=phi2-code-dpo_torchrun_bs64_lr5e-6 --ddp_find_unused_parameters=False --save_hdfs_path=....../home/.../.../user/.../metadata/generate/codedpo/phi2/phi2-code-dpo-multinode_bs256lr5e-6rpo1_${NNODES}_${NODE_RANK} --num_train_epochs=30 --save_on_each_node=False --per_device_train_batch_size=1 --gradient_accumulation_steps=16 --learning_rate=5e-6 --rpo_alpha=1.0 "
export OTHER

bash dpo.code.a100.phi2.sh
