|
#!/bin/bash |
|
|
|
|
|
export OMP_NUM_THREADS=8 |
|
export NCCL_IB_DISABLE=0 |
|
export NCCL_IB_GID_INDEX=3 |
|
export NCCL_SOCKET_IFNAME=eth0 |
|
export NCCL_DEBUG=INFO |
|
export NCCL_IB_SL=1 |
|
export CUDA_DEVICE_MAX_CONNECTIONS=1 |
|
export NCCL_BLOCKING_WAIT=1 |
|
export NCCL_ASYNC_ERROR_HANDLING=1 |
|
export NCCL_TIMEOUT=500 |
|
export TORCH_DISTRIBUTED_DEBUG=DETAIL |
|
|
|
DATETIME=`date +'%y-%m-%d-%H-%M-%S'` |
|
|
|
|
|
ports=(`echo $METIS_WORKER_0_PORT | tr ',' ' '`) |
|
port=${ports[0]} |
|
|
|
echo "total workers: ${ARNOLD_WORKER_NUM}" |
|
echo "cur worker id: ${ARNOLD_ID}" |
|
echo "gpus per worker: ${ARNOLD_WORKER_GPU}" |
|
echo "master ip: ${METIS_WORKER_0_HOST}" |
|
echo "master port: ${port}" |
|
|
|
source /mnt/bn/tns-algo-video-public-my2/wangpeng.an/environment/anaconda3/bin/activate multimodal |
|
|
|
cd /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/OmniFusion-main |
|
|
|
|
|
pip3 install requests |
|
pip3 install attrs |
|
pip3 install aiofiles |
|
pip3 install pynvml |
|
|
|
|
|
|
|
echo "Python executable: $(which python)" |
|
echo "torchrun executable: $(which torchrun)" |
|
echo "deepspeed executable: $(which deepspeed)" |
|
echo "PYTHONPATH before torchrun: $PYTHONPATH" |
|
|
|
sudo chmod 777 /var/lib/fastrak -R |
|
|
|
|
|
ACCELERATE_CPU_AFFINITY=1 torchrun --nproc_per_node=$ARNOLD_WORKER_GPU --nnodes=$ARNOLD_WORKER_NUM --node_rank=$ARNOLD_ID --master_addr=$METIS_WORKER_0_HOST --master_port=$port \ |
|
llava/train/train_mem.py \ |
|
--deepspeed ./scripts/zero2.json \ |
|
--model_name_or_path /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/tmp/OmniFusion-main/checkpoints/OmniFusion-8B-stage3-1018 \ |
|
--version llama_3_1 \ |
|
--data_path /mnt/bn/tns-algo-video-public-my2/wangpeng.an/data/stage4_1031/videochatgpt_tune_stage4.json \ |
|
--video_folder /mnt/bn/tns-algo-video-public-my2/wangpeng.an/data/Video-LLaVA \ |
|
--X "Video" \ |
|
--audio_tower /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/LanguageBind_Audio_Asr \ |
|
--audio_caption_tower /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/pretrained_model/LanguageBind_Audio \ |
|
--video_tower /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/pretrained_model/LanguageBind_Video_merge \ |
|
--image_tower /mnt/bn/tns-algo-video-public-my2/wangpeng.an/model/pretrained_model/LanguageBind_Image \ |
|
--mm_projector_type mlp2x_gelu \ |
|
--mm_vision_select_layer -2 \ |
|
--mm_use_x_start_end False \ |
|
--mm_use_x_patch_token False \ |
|
--is_fusion True \ |
|
--image_aspect_ratio pad \ |
|
--group_by_modality_length True \ |
|
--bf16 True \ |
|
--output_dir ./checkpoints/OmniFusion-8B-stage4-1031 \ |
|
--num_train_epochs 1 \ |
|
--per_device_train_batch_size 8 \ |
|
--per_device_eval_batch_size 4 \ |
|
--gradient_accumulation_steps 1 \ |
|
--evaluation_strategy "no" \ |
|
--save_strategy "steps" \ |
|
--save_steps 3000 \ |
|
--save_total_limit 4 \ |
|
--learning_rate 2e-5 \ |
|
--weight_decay 0. \ |
|
--warmup_ratio 0.03 \ |
|
--lr_scheduler_type "cosine" \ |
|
--logging_steps 1 \ |
|
--tf32 True \ |
|
--model_max_length 4096 \ |
|
--tokenizer_model_max_length 6144 \ |
|
--gradient_checkpointing True \ |
|
--dataloader_num_workers 8 \ |
|
--lazy_preprocess True \ |
|
--report_to none \ |
|
--cache_dir "./cache_dir" |
|
|