52 lines
1.3 KiB
Bash
52 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
PROJECT_ROOT="/d/ai/training/openbiollm-phi"
|
|
|
|
cd "$PROJECT_ROOT"
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
echo "Resolving and locking dependencies..."
|
|
uv lock
|
|
|
|
echo "Installing locked dependencies..."
|
|
uv sync --frozen
|
|
|
|
echo
|
|
echo "=== TRAINING ENVIRONMENT ==="
|
|
|
|
uv run python - <<'PY'
|
|
import accelerate
|
|
import bitsandbytes
|
|
import datasets
|
|
import peft
|
|
import torch
|
|
import transformers
|
|
import trl
|
|
|
|
if not torch.cuda.is_available():
|
|
raise SystemExit("ERROR: PyTorch cannot access CUDA.")
|
|
|
|
print(f"Python: {__import__('sys').version.split()[0]}")
|
|
print(f"PyTorch: {torch.__version__}")
|
|
print(f"CUDA runtime: {torch.version.cuda}")
|
|
print(f"GPU: {torch.cuda.get_device_name(0)}")
|
|
print(f"BF16: {torch.cuda.is_bf16_supported()}")
|
|
print(f"Transformers: {transformers.__version__}")
|
|
print(f"TRL: {trl.__version__}")
|
|
print(f"PEFT: {peft.__version__}")
|
|
print(f"Accelerate: {accelerate.__version__}")
|
|
print(f"Datasets: {datasets.__version__}")
|
|
print(f"bitsandbytes: {bitsandbytes.__version__}")
|
|
|
|
tensor = torch.tensor([1.0], device="cuda")
|
|
print(f"CUDA tensor: {tensor}")
|
|
PY
|
|
|
|
git add pyproject.toml uv.lock scaffolding/02-install-dependencies.sh
|
|
git commit -m "Add locked CUDA training environment"
|
|
|
|
echo
|
|
echo "=== GIT STATUS ==="
|
|
git status --short
|