diff options
| author | YurenHao0426 <blackhao0426@gmail.com> | 2026-01-27 09:57:37 -0600 |
|---|---|---|
| committer | YurenHao0426 <blackhao0426@gmail.com> | 2026-01-27 09:57:37 -0600 |
| commit | dc801c07cf38b0c495686463e6ca6f871a64440e (patch) | |
| tree | 599f03114775921dbc472403c701f4a3a8ea188a /collaborativeagents/scripts/test_all_methods.sbatch | |
| parent | e43b3f8aa36c198b95c1e46bea2eaf3893b13dc3 (diff) | |
Add collaborativeagents module and update gitignore
- Add collaborativeagents subproject with adapters, agents, and evaluation modules
- Update .gitignore to exclude large binary files (.whl, .tar), wandb logs, and results
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'collaborativeagents/scripts/test_all_methods.sbatch')
| -rw-r--r-- | collaborativeagents/scripts/test_all_methods.sbatch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/collaborativeagents/scripts/test_all_methods.sbatch b/collaborativeagents/scripts/test_all_methods.sbatch new file mode 100644 index 0000000..6550cdf --- /dev/null +++ b/collaborativeagents/scripts/test_all_methods.sbatch @@ -0,0 +1,91 @@ +#!/bin/bash +#SBATCH --job-name=test_all +#SBATCH --account=bfqt-delta-gpu +#SBATCH --partition=gpuH200x8 +#SBATCH --nodes=1 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --gres=gpu:4 +#SBATCH --mem=200G +#SBATCH --time=02:00:00 +#SBATCH --output=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_methods_%j.out +#SBATCH --error=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_methods_%j.err + +cd /projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/collaborativeagents +source /u/yurenh2/miniforge3/etc/profile.d/conda.sh +conda activate eval +export HF_HOME=/projects/bfqt/users/yurenh2/hf_cache/huggingface +export PYTHONPATH="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/src:$PYTHONPATH" + +PROFILE_PATH="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/collaborativeagents/data/complex_profiles_v2/profiles_200.jsonl" +AGENT_MODEL="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/models/llama-3.1-8b-instruct" +USER_MODEL="meta-llama/Llama-3.1-70B-Instruct" + +echo "=== Small-scale test: ALL methods with 70B user sim ===" +echo "Scale: 5 profiles × 3 sessions = 15 sessions per method" +date +nvidia-smi --query-gpu=index,name,memory.total --format=csv + +# Start 70B user simulator on GPUs 0,1 +echo "" +echo "Starting 70B user simulator..." +CUDA_VISIBLE_DEVICES=0,1 python -m vllm.entrypoints.openai.api_server \ + --model $USER_MODEL \ + --port 8004 --tensor-parallel-size 2 --gpu-memory-utilization 0.90 \ + --max-model-len 8192 --dtype bfloat16 --download-dir $HF_HOME & +USER_PID=$! + +# Start 8B agent on GPUs 2,3 (0.45 for RAG methods) +echo "Starting 8B agent (0.45 memory for embedding/reranker)..." +CUDA_VISIBLE_DEVICES=2,3 python -m vllm.entrypoints.openai.api_server \ + --model $AGENT_MODEL \ + --port 8003 --tensor-parallel-size 2 --gpu-memory-utilization 0.45 \ + --max-model-len 8192 --dtype bfloat16 & +AGENT_PID=$! + +# Wait for servers +echo "Waiting for vLLM servers (70B takes ~8 min)..." +for i in {1..200}; do + if curl -s http://localhost:8004/health > /dev/null 2>&1; then + echo "70B user simulator ready after $((i*5))s" + break + fi + sleep 5 +done +for i in {1..60}; do + if curl -s http://localhost:8003/health > /dev/null 2>&1; then + echo "8B agent ready after $((i*5))s" + break + fi + sleep 5 +done + +echo "" +echo "=== GPU Memory after vLLM servers ===" +nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv + +# Test each method sequentially +for METHOD in vanilla contextual reflection all_memory rag rag_vector; do + echo "" + echo "==============================================" + echo "Testing method: $METHOD" + echo "==============================================" + date + + python scripts/run_experiments.py --methods $METHOD \ + --datasets math-hard --n-profiles 5 --n-sessions 3 --max-turns 10 \ + --use-vllm --no-batch-processing --parallel-profiles 5 \ + --output-dir ../results/test_all_methods --profile-path $PROFILE_PATH + + echo "" + echo "=== GPU Memory after $METHOD ===" + nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv +done + +echo "" +echo "==============================================" +echo "ALL METHODS TESTED" +echo "==============================================" +date + +pkill -f "vllm.entrypoints" 2>/dev/null || true |
