forked from huggingface/alignment-handbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be537fc
commit cff21cd
Showing
5 changed files
with
85 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/bash | ||
whoami | ||
pwd | ||
|
||
HOME=/home/l069561 | ||
|
||
ROOT=${HOME}/project/alignment-handbook | ||
|
||
|
||
SCRIPTPATH=${ROOT}/experiments | ||
source ${SCRIPTPATH}/wandb.sh | ||
|
||
echo $SLURM_TMPDIR | ||
export TMPDIR="/cache" | ||
export HF_DATASETS_CACHE="${HOME}/cache/dataset" | ||
export HF_HOME="${HOME}/cache/hf" | ||
export TRITON_CACHE_DIR="/cache" | ||
|
||
|
||
# TORCH and NCCL | ||
export CUDA_LAUNCH_BLOCKING=1 | ||
export TORCH_DISTRIBUTED_DEBUG=INFO | ||
# export NCCL_DEBUG=INFO | ||
# export NCCL_SOCKET_NTHREADS=16 | ||
export DEEPSPEED_TIMEOUT=120 | ||
|
||
# export WORLD_SIZE=$(($SLURM_JOB_NUM_NODES*$SLURM_NTASKS_PER_NODE)) | ||
|
||
echo $PRIMARY | ||
echo $PRIMARY_PORT | ||
|
||
torchrun \ | ||
--nproc_per_node=$SLURM_GPUS_ON_NODE \ | ||
--nnode=$SLURM_JOB_NUM_NODES \ | ||
--node_rank=$SLURM_NODEID \ | ||
--master_addr=$PRIMARY \ | ||
--master_port=$PRIMARY_PORT \ | ||
${ROOT}/scripts/run_sft.py \ | ||
${ROOT}/recipes/llama3-8b/sft/config_qlora.yaml \ | ||
--deepspeed=${ROOT}/recipes/accelerate_configs/deepspeed_zs2.json \ | ||
--tee=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
#!/bin/bash | ||
|
||
#SBATCH --job-name=llm_sft | ||
#SBATCH --mail-type=ALL | ||
#SBATCH [email protected] | ||
#SBATCH --nodes=4 | ||
#SBATCH --ntasks-per-node=1 | ||
#SBATCH --gpus-per-node=4 | ||
#SBATCH --gpus-per-task=4 | ||
#SBATCH --cpus-per-task=80 | ||
#SBATCH --mem=512gb | ||
#SBATCH --time=48:00:00 | ||
#SBATCH --output=/home/l069561/project/log/alignment/sft_%j.out | ||
#SBATCH --partition=batch | ||
##SBATCH --exclusive | ||
##SBATCH --reservation=gatortrongpt | ||
|
||
SCRIPT=$(readlink -f "$0") | ||
SCRIPTPATH=$(dirname "$SCRIPT") | ||
HOME=/home/l069561 | ||
SCRIPTPATH=${HOME}/project/alignment-handbook/experiments | ||
|
||
echo $SCRIPTPATH | ||
echo $SLURM_NTASKS_PER_NODE | ||
echo $SLURM_JOB_NUM_NODES | ||
echo $SLURM_GPUS_ON_NODE | ||
source ${SCRIPTPATH}/util.sh | ||
source ${SCRIPTPATH}/wandb.sh | ||
|
||
CONTAINER=${HOME}/container/pt2402.sif | ||
|
||
srun --jobid $SLURM_JOB_ID apptainer exec -B $SLURM_TMPDIR:/cache --nv $CONTAINER bash ${SCRIPTPATH}/demo_magtrain_llm_sft.sh | ||
|
||
# NSYS=nsys profile -t cuda,nvtx -o /cache/nsys | ||
# srun --jobid $SLURM_JOB_ID apptainer exec -B $SLURM_TMPDIR:/cache --nv $CONTAINER ${NSYS} bash ${SCRIPTPATH}/demo_magtrain_llm_sft.sh | ||
# cp $SLURM_TMPDIR/nsys-rep /home/l069561/project/log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pip install transformers==4.39.2 | ||
pip install trl==0.8.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters