-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_sampling.sh
More file actions
executable file
·46 lines (32 loc) · 2.27 KB
/
example_sampling.sh
File metadata and controls
executable file
·46 lines (32 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
conda activate videosampling
wandb offline
GPUNUM=$(npu-smi info | grep 910B | wc -l)
NUM_PROCESS=$((GPUNUM * WORLD_SIZE))
export HF_HOME="./huggingface"
export HCCL_CONNECT_TIMEOUT=7200
export DECORD_EOF_RETRY_MAX=20480
pip install imageio ffmpeg-python
pip install pysubs2
cd ./lmms-eval-npu && pip install -e .
cd ../VideoLLaMA2 && pip install -e . --no-deps
cd ../LLaVA-NeXT && pip install -e ".[train]"
cd ../
accelerate launch --num_machines $WORLD_SIZE --machine_rank $RANK --num_processes $NUM_PROCESS --main_process_ip $MASTER_ADDR --main_process_port 12345 -m lmms_eval --model internvl2 --model_args pretrained=./InternVL2_5-8B/,num_frame=32,modality=video --tasks egoschema --batch_size 1 --log_samples --log_samples_suffix egoschema_internvl_2_5 --output_path ./logs/ --seed 42
wait
accelerate launch --num_machines $WORLD_SIZE --machine_rank $RANK --num_processes $NUM_PROCESS --main_process_ip $MASTER_ADDR --main_process_port 12347 -m lmms_eval --model llava_vid --model_args pretrained=./LLaVA-Video-7B-Qwen2,conv_template=qwen_1_5,video_decode_backend=decord,max_frames_num=32 --tasks egoschema_subset --batch_size 1 --log_samples --log_samples_suffix egoschema_subset_llava_vid --seed 42 --output_path ./logs
wait
accelerate launch --num_machines $WORLD_SIZE --machine_rank $RANK --num_processes $NUM_PROCESS --main_process_ip $MASTER_ADDR --main_process_port $port -m lmms_eval --model videollama2 --model_args pretrained=./VideoLLaMA2-7B-16F,num_frames=16 --tasks egoschema --batch_size 1 --log_samples --log_samples_suffix egoschema_videollama2 --output_path ./logs/ --seed 42
# if you encountered waiting time error in 910B NPU multiprocessing waiting time, the following command individually launch single card sampling.
# for i in {0..9}
# do
# seed=$((1316 + i))
# port=$((12345 + i))
# echo $seed
# echo $port
# ASCEND_RT_VISIBLE_DEVICES=$i accelerate launch --num_machines $WORLD_SIZE --machine_rank $RANK --num_processes 1 --main_process_ip $MASTER_ADDR --main_process_port $port -m lmms_eval --model videollama2 --model_args pretrained=./VideoLLaMA2-7B-16F,num_frames=16 --tasks egoschema --batch_size 1 --log_samples --log_samples_suffix egoschema_videollama2 --output_path ./logs/ --seed $seed &
# done
# wait
echo Finished, now sleeping.
sleep 1m
exit 0;