Text Generation
Transformers
Safetensors
English
llama
gpt-u
tiny-lm
pretrained-from-scratch
text-generation-inference
GPT-U-20M / scripts /run_train.sh
DedeProGames's picture
GPT-U-20M: final weights, tokenizer, model card, scripts and logs
13caab9 verified
Raw History Blame Contribute Delete
1 kB
#!/usr/bin/env bash
# Start GPT-U-20M training in a detached tmux session with a persistent log. Re-running resumes automatically.
# scripts/run_train.sh -> session "gptu", full run, log logs/gptu.out
# SESSION=smoke scripts/run_train.sh --smoke
set -euo pipefail
cd "$(dirname "$0")/.."
SESSION=${SESSION:-gptu}
VENV=${VENV:-$HOME/venvs/gpt-u}
CACHE=${CACHE:-/mnt/c/Users/andre/gpt-u-20m-data/cache} # compiler caches off the exFAT-hosted WSL disk
ENVS="NCCL_P2P_DISABLE=1 NCCL_IB_DISABLE=1 CUDA_DEVICE_ORDER=PCI_BUS_ID PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True OMP_NUM_THREADS=2 TORCHINDUCTOR_CACHE_DIR=$CACHE/inductor TRITON_CACHE_DIR=$CACHE/triton"
# The env goes inside the command: a running tmux server would not inherit this shell's exports.
tmux new-session -d -s "$SESSION" \
"cd $PWD && env $ENVS $VENV/bin/torchrun --standalone --nproc_per_node=2 scripts/train.py $* 2>&1 | tee -a logs/$SESSION.out"
echo "tmux session '$SESSION' started, log: logs/$SESSION.out"