#!/bin/bash
experiment_name=TinyDeepSeek-0.5B-base_pretrainStage2
WANDB_PROJECT=$experiment_name
MODEL_PATH=./ckpts/TinyDeepSeek-0.5B-base_pretrainStage1
DATA_PATH=FreedomIntelligence/TinyDeepSeek-Data-pretrainStage2

LOSS_FUNC=NORMAL # [ZLoss, NORMAL]
log_folder="./logs/${experiment_name}"
mkdir -p $log_folder
log_name=$(date +"%m-%d_%H-%M").log

deepspeed --hostfile hostfile \
    ./src/train.py \
    --deepspeed ./scripts/zero0.json \
    --model_name_or_path $MODEL_PATH \
    --data_path $DATA_PATH \
    --bf16 True \
    --is_pretrain True \
    --output_dir ./ckpts/${experiment_name} \
    --run_name ${experiment_name} \
    --num_train_epochs 1 \
    --per_device_train_batch_size 8 \
    --gradient_accumulation_steps 4 \
    --evaluation_strategy "no" \
    --save_strategy "steps" \
    --loss_func ${LOSS_FUNC} \
    --save_steps 500 \
    --save_safetensors False \
    --gradient_checkpointing False \
    --save_total_limit 100 \
    --learning_rate 1e-4 \
    --weight_decay 0.1 \
    --logging_steps 2 \
    --model_max_length 4096 \
    --lazy_loading True \
    --warmup_ratio 0.0 \
    --lr_scheduler_type "linear" \
    --enable_voc_weight_decay True \
    --remove_unused_columns False \
    --report_to wandb > ${log_folder}/${log_name} 2>&1 & 