-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·68 lines (57 loc) · 1.79 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·68 lines (57 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
cd "$(dirname "$0")"
echo "========================================"
echo " CSM-1B on RTX 5090 — Setup"
echo "========================================"
# Preflight
nvidia-smi --query-gpu=name,driver_version,compute_cap --format=csv,noheader || {
echo "ERROR: nvidia-smi not found. Install NVIDIA drivers."; exit 1; }
PYTHON=${PYTHON:-python3}
VENV=${1:-.venv}
# Create venv
if [ ! -d "$VENV" ]; then
echo "[1/5] Creating venv at $VENV..."
$PYTHON -m venv "$VENV"
else
echo "[1/5] Reusing venv at $VENV"
fi
source "$VENV/bin/activate"
pip install --upgrade pip -q
# PyTorch nightly (sm_120 kernels)
echo "[2/5] Installing PyTorch nightly cu128..."
pip install --pre torch torchaudio \
--index-url https://download.pytorch.org/whl/nightly/cu128
# Fix missing nightly deps
pip install packaging numpy -q
# Verify CUDA
echo "[3/5] Verifying sm_120..."
python3 -c "
import torch
assert torch.cuda.is_available(), 'CUDA not available'
t = torch.randn(10, device='cuda') * 2
print(f' torch={torch.__version__} cuda={torch.version.cuda} sm_120=OK')
"
# Install dependencies
echo "[4/5] Installing dependencies..."
pip install -r requirements.txt -q
# Patch transformers
echo "[5/5] Patching transformers for CUDA graphs..."
python3 patch_transformers.py
# ptxas hint
PTXAS=$(which ptxas 2>/dev/null || find /usr/local/cuda* -name ptxas 2>/dev/null | head -1)
if [ -n "$PTXAS" ]; then
echo ""
echo "ptxas found: $PTXAS"
echo "Add to your shell: export TRITON_PTXAS_PATH=$PTXAS"
fi
echo ""
echo "========================================"
echo " Setup complete!"
echo "========================================"
echo ""
echo " source $VENV/bin/activate"
echo " python csm_pipeline.py"
echo ""
echo " Accept sesame/csm-1b license at:"
echo " https://huggingface.co/sesame/csm-1b"