#!/bin/bash

MASTER_ADDR=${1:-localhost}
MASTER_PORT=6000
NNODES=${2:-1}
NODE_RANK=${3:-0}
GPUS_PER_NODE=8
DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"

CMD="torchrun $DISTRIBUTED_ARGS \
	src/train.py \
	examples/train_full/qwen2_5vl_full_sft.yaml
"

TIME=$(date "+%Y-%m-%d_%H_%M")

echo $CMD | tee qwen2.5vl-7b_sft_ds3_$TIME.log
eval $CMD | tee -a qwen2.5vl-7b_sft_ds3_$TIME.log
