-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·87 lines (73 loc) · 2.38 KB
/
setup.sh
File metadata and controls
executable file
·87 lines (73 loc) · 2.38 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# =============================================================================
# Setup Script for Reasoning Bomb
# =============================================================================
#
# This script sets up the environment for running the adversarial puzzle
# generation pipeline.
#
# Usage:
# bash setup.sh
#
# =============================================================================
set -e
echo "================================================================================"
echo "Setting up Reasoning Bomb"
echo "================================================================================"
echo ""
# Check Python version
PYTHON_VERSION=$(python3 --version 2>&1 | cut -d' ' -f2 | cut -d'.' -f1,2)
echo "Python version: ${PYTHON_VERSION}"
if [[ "${PYTHON_VERSION}" < "3.10" ]]; then
echo "Error: Python 3.10+ required"
exit 1
fi
# Check CUDA
if ! command -v nvcc &> /dev/null; then
echo "Warning: CUDA not found. GPU training will not work."
fi
# Install dependencies
echo ""
echo "Installing dependencies..."
# Core PyTorch (adjust CUDA version as needed)
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu121
# verl framework
echo ""
echo "Installing verl..."
pip install verl
# Other dependencies
echo ""
echo "Installing other dependencies..."
pip install -r requirements.txt
# Optional: Flash Attention (uncomment if needed)
# echo ""
# echo "Installing Flash Attention 2..."
# pip install flash-attn --no-build-isolation
# Create output directories
echo ""
echo "Creating output directories..."
mkdir -p outputs/{predictor,warmstart,checkpoints,logs,data}
# Verify installation
echo ""
echo "Verifying installation..."
python3 -c "
import torch
import transformers
import vllm
print(f'PyTorch: {torch.__version__}')
print(f'Transformers: {transformers.__version__}')
print(f'vLLM: {vllm.__version__}')
print(f'CUDA available: {torch.cuda.is_available()}')
if torch.cuda.is_available():
print(f'CUDA devices: {torch.cuda.device_count()}')
"
echo ""
echo "================================================================================"
echo "Setup complete!"
echo "================================================================================"
echo ""
echo "Quick Start:"
echo " 1. Edit configs/default.yaml with your model paths"
echo " 2. Run: bash scripts/1_train_predictor.sh"
echo " 3. Run: bash scripts/4_train_grpo.sh"
echo ""