-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_gpu_experiments.sh
More file actions
executable file
·85 lines (69 loc) · 2.73 KB
/
run_gpu_experiments.sh
File metadata and controls
executable file
·85 lines (69 loc) · 2.73 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
#!/bin/bash
# 🖥️ GPU Experiment Runner for CloudRift Instance
# Run this script on your GPU instance: ssh riftuser@176.124.69.199
set -e
echo "🚀 Starting GPU experiments for KV Cache Profiler..."
# Check if we're in the right directory
if [ ! -f "pyproject.toml" ]; then
echo "❌ Error: Not in kv-cache-profiler directory"
echo "Please run: cd kv-cache-profiler"
exit 1
fi
# Install HuggingFace CLI
echo "📦 Installing HuggingFace CLI..."
pip install huggingface_hub
# 1. Check GPU availability
echo "🔍 Checking GPU availability..."
nvidia-smi || { echo "❌ nvidia-smi failed - no GPU available"; exit 1; }
# 2. Check PyTorch CUDA
echo "🔍 Checking PyTorch CUDA support..."
python3 -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}'); print(f'GPU count: {torch.cuda.device_count()}')" || { echo "❌ PyTorch CUDA check failed"; exit 1; }
# 3. Check HuggingFace authentication
echo "🔐 Checking HuggingFace authentication..."
if [ -z "$HF_TOKEN" ]; then
echo "❌ HF_TOKEN environment variable not set"
echo "Please run: export HF_TOKEN='your_token_here'"
exit 1
fi
# 4. Test environment
echo "🧪 Testing environment..."
uv run profiler/cli.py env
# 5. Quick GPU memory test
echo "🧪 Quick GPU memory test..."
uv run profiler/cli.py bench --model facebook/opt-1.3b --concurrency 1 --prompt-toks 32 --gen-toks 8 --verbose
# 6. Run Llama 3.1 8B experiment with GPU memory tracking
echo "🦙 Running Llama 3.1 8B experiment (GPU accelerated)..."
uv run experiments/exp1_concurrency.py \
--model meta-llama/Llama-3.1-8B-Instruct \
--concurrency 1 2 4 \
--prompt-toks 128 \
--gen-toks 32 \
--verbose \
--output-dir data/gpu_llama31
# 7. Run smaller Llama 4 experiment (be conservative with memory)
echo "🦙 Running Llama 4 Scout 17B experiment (GPU accelerated)..."
uv run experiments/exp1_concurrency.py \
--model meta-llama/Llama-4-Scout-17B-16E-Instruct \
--concurrency 1 2 \
--prompt-toks 64 \
--gen-toks 16 \
--verbose \
--output-dir data/gpu_llama4
# 8. Show results
echo "📊 Experiment Results Summary:"
echo "================================"
echo "📁 Generated files:"
ls -la data/gpu_*
echo ""
echo "✅ GPU experiments completed successfully!"
echo ""
echo "🔄 Next steps:"
echo "1. Check the generated plots in data/gpu_llama31/ and data/gpu_llama4/"
echo "2. Copy results back to main environment with:"
echo " scp -r riftuser@176.124.69.199:~/kv-cache-profiler/data/gpu_* ./data/"
echo "3. Update README with real GPU memory data"
echo ""
echo "📈 Quick preview of results:"
echo "GPU memory should now show real values like:"
echo "- Llama 3.1 8B: 16GB → 19GB → 23GB (instead of 0.00 GB)"
echo "- Throughput: ~15-20x faster than CPU"