datamatters24 commited on
Commit
de9907a
·
verified ·
1 Parent(s): 3538c62

Scriptwriter dataset sync

Browse files
Files changed (2) hide show
  1. restart-train.sh +17 -9
  2. scriptwriter-runpod-ready.tgz +2 -2
restart-train.sh CHANGED
@@ -1,5 +1,5 @@
1
  #!/bin/bash
2
- # Stable single-GPU restart (DDP SIGABRT'd on this pod).
3
  # curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/restart-train.sh" | bash
4
  set -euo pipefail
5
 
@@ -26,13 +26,17 @@ export HF_DATASET_REPO="${HF_DATASET_REPO:-datamatters24/scriptwriter-corpus-ia}
26
  export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
27
  export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
28
  export RUNPOD_SKIP_FORCE_PIP=1
29
- export CUDA_VISIBLE_DEVICES=0
30
  export MAX_SEQ_LENGTH=2048
31
  export MAX_SEQ_LENGTH_CAP=2048
32
  export PER_DEVICE_TRAIN_BATCH_SIZE=1
33
- export GRADIENT_ACCUMULATION_STEPS=8
34
  export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
 
 
 
35
  export RESUME_FROM_CHECKPOINT="${RESUME_FROM_CHECKPOINT:-1}"
 
36
 
37
  if [[ ! -f /workspace/data/processed/train.jsonl ]]; then
38
  echo "train.jsonl missing — use fix-and-train.sh instead"
@@ -58,19 +62,23 @@ export CONFIG_PATH=/workspace/scriptwriter-runpod/config/training.yaml
58
  export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
59
  export OUTPUT_DIR=/workspace/models/lora
60
  export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
61
- export CUDA_VISIBLE_DEVICES=0
62
  export MAX_SEQ_LENGTH=2048
63
  export MAX_SEQ_LENGTH_CAP=2048
64
  export PER_DEVICE_TRAIN_BATCH_SIZE=1
65
- export GRADIENT_ACCUMULATION_STEPS=8
66
  export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
 
 
 
67
  export RESUME_FROM_CHECKPOINT="${RESUME_FROM_CHECKPOINT:-1}"
 
68
  exec > >(tee -a /workspace/logs/train_live.log) 2>&1
69
  echo "========== TRAIN START $(date -Is) =========="
70
- echo "STABLE 1-GPU: seq=2048 batch=1 accum=8 (DDP disabled — prior SIGABRT)"
71
  ls /workspace/models/lora/checkpoint-* 2>/dev/null | tail -5 || echo "no prior checkpoint"
72
  nvidia-smi || true
73
- python3 scripts/train_runpod.py
74
  echo "========== UPLOAD $(date -Is) =========="
75
  python3 scripts/sync_hf.py upload-model --repo "$HF_MODEL_REPO" --folder /workspace/models/lora
76
  echo "========== DONE $(date -Is) =========="
@@ -81,5 +89,5 @@ chmod +x "$WORKER"
81
  tmux new-session -d -s scriptwriter-train -n train "bash $WORKER"
82
  tmux new-window -t scriptwriter-train -n monitor
83
  tmux send-keys -t scriptwriter-train:monitor "watch -n 15 'nvidia-smi --query-gpu=index,memory.used,utilization.gpu --format=csv; echo; tail -25 /workspace/logs/train_live.log'" Enter
84
- echo "Started STABLE 1-GPU train — attach: tmux attach -t scriptwriter-train"
85
- echo "GPU 1 idle is expected. Resume checkpoint if present."
 
1
  #!/bin/bash
2
+ # GPU DDP restart
3
  # curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/restart-train.sh" | bash
4
  set -euo pipefail
5
 
 
26
  export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
27
  export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
28
  export RUNPOD_SKIP_FORCE_PIP=1
29
+ unset CUDA_VISIBLE_DEVICES
30
  export MAX_SEQ_LENGTH=2048
31
  export MAX_SEQ_LENGTH_CAP=2048
32
  export PER_DEVICE_TRAIN_BATCH_SIZE=1
33
+ export GRADIENT_ACCUMULATION_STEPS=4
34
  export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
35
+ export NCCL_IB_DISABLE=1
36
+ export NCCL_P2P_DISABLE=1
37
+ export TOKENIZERS_PARALLELISM=false
38
  export RESUME_FROM_CHECKPOINT="${RESUME_FROM_CHECKPOINT:-1}"
39
+ export NPROC="${NPROC:-2}"
40
 
41
  if [[ ! -f /workspace/data/processed/train.jsonl ]]; then
42
  echo "train.jsonl missing — use fix-and-train.sh instead"
 
62
  export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
63
  export OUTPUT_DIR=/workspace/models/lora
64
  export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
65
+ unset CUDA_VISIBLE_DEVICES
66
  export MAX_SEQ_LENGTH=2048
67
  export MAX_SEQ_LENGTH_CAP=2048
68
  export PER_DEVICE_TRAIN_BATCH_SIZE=1
69
+ export GRADIENT_ACCUMULATION_STEPS=4
70
  export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
71
+ export NCCL_IB_DISABLE=1
72
+ export NCCL_P2P_DISABLE=1
73
+ export TOKENIZERS_PARALLELISM=false
74
  export RESUME_FROM_CHECKPOINT="${RESUME_FROM_CHECKPOINT:-1}"
75
+ NPROC="${NPROC:-2}"
76
  exec > >(tee -a /workspace/logs/train_live.log) 2>&1
77
  echo "========== TRAIN START $(date -Is) =========="
78
+ echo "DDP on ${NPROC} GPUs: seq=2048 batch=1 accum=4 (NCCL_P2P/IB disabled)"
79
  ls /workspace/models/lora/checkpoint-* 2>/dev/null | tail -5 || echo "no prior checkpoint"
80
  nvidia-smi || true
81
+ torchrun --standalone --nproc_per_node="$NPROC" scripts/train_runpod.py
82
  echo "========== UPLOAD $(date -Is) =========="
83
  python3 scripts/sync_hf.py upload-model --repo "$HF_MODEL_REPO" --folder /workspace/models/lora
84
  echo "========== DONE $(date -Is) =========="
 
89
  tmux new-session -d -s scriptwriter-train -n train "bash $WORKER"
90
  tmux new-window -t scriptwriter-train -n monitor
91
  tmux send-keys -t scriptwriter-train:monitor "watch -n 15 'nvidia-smi --query-gpu=index,memory.used,utilization.gpu --format=csv; echo; tail -25 /workspace/logs/train_live.log'" Enter
92
+ echo "Started 2-GPU DDP — attach: tmux attach -t scriptwriter-train"
93
+ echo "Expect both GPUs ~6–11 GiB and high util."
scriptwriter-runpod-ready.tgz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:51834db8130e7a45b215ed86659c79db7b44b8336eee0f22b3aac5bcf01e2c40
3
- size 10116
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55e8cd0992886d06af8f926a83029e5ce1739fedbfa7f1dcfa9cdb1ef6569638
3
+ size 10225