summaryrefslogtreecommitdiff
path: root/collaborativeagents/slurm/fullscale/test_run.sh
blob: de6a0e1fbf2088576657d7bef8ba9072314e249d (plain)
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
#!/bin/bash
#SBATCH --job-name=test_fullscale
#SBATCH --account=bfqt-delta-gpu
#SBATCH --partition=gpuA100x4
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --gres=gpu:nvidia_a100:2
#SBATCH --mem=128G
#SBATCH --time=1:00:00
#SBATCH --output=test_fullscale_%j.out
#SBATCH --error=test_fullscale_%j.err

# Test run: 2 profiles × 2 methods × 2 sessions = 8 sessions
# Should complete in ~10-15 minutes

cd /projects/bfqt/users/yurenh2/ml-projects/personalization-user-model
source /u/yurenh2/miniforge3/etc/profile.d/conda.sh
conda activate eval

export HF_HOME=/projects/bfqt/users/yurenh2/hf_cache/huggingface
export PYTHONPATH="${PWD}/src:${PWD}/collaborativeagents:${PYTHONPATH}"
export NCCL_P2P_DISABLE=1

# Load OpenAI API key
set -a
source .env
set +a

pip install --quiet openai python-dotenv json-repair

MODEL_8B="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/models/llama-3.1-8b-instruct"

pkill -f "vllm.entrypoints" 2>/dev/null || true
sleep 2

# GPU 0: vLLM 8B agent, GPU 1: adapter models
CUDA_VISIBLE_DEVICES=0 python -m vllm.entrypoints.openai.api_server \
    --model $MODEL_8B --port 8003 --tensor-parallel-size 1 \
    --gpu-memory-utilization 0.5 --max-model-len 8192 \
    --dtype bfloat16 --disable-log-requests &

# Wait for server
for i in $(seq 1 90); do
    curl -s http://localhost:8003/health > /dev/null 2>&1 && break
    sleep 2
done
echo "vLLM 8B agent server ready."

cd collaborativeagents/scripts

# Test run: vanilla + rag_vector (light + heavy methods)
python run_experiments.py \
    --methods vanilla,rag_vector \
    --datasets math-hard \
    --n-profiles 2 \
    --n-sessions 2 \
    --max-turns 8 \
    --use-vllm \
    --use-openai-user \
    --openai-user-model gpt-5-mini \
    --reward-mode llm \
    --vllm-agent-url http://localhost:8003/v1 \
    --parallel-profiles 2 \
    --profile-path ../data/complex_profiles_v2/profiles_200.jsonl \
    --output-dir ../results/fullscale_test_$(date +%Y%m%d_%H%M%S)

echo "Test run complete!"

pkill -f "vllm.entrypoints" 2>/dev/null || true