summaryrefslogtreecommitdiff
path: root/collaborativeagents/scripts/test_parallel_speed_a100.sbatch
diff options
context:
space:
mode:
authorYurenHao0426 <blackhao0426@gmail.com>2026-01-27 09:57:37 -0600
committerYurenHao0426 <blackhao0426@gmail.com>2026-01-27 09:57:37 -0600
commitdc801c07cf38b0c495686463e6ca6f871a64440e (patch)
tree599f03114775921dbc472403c701f4a3a8ea188a /collaborativeagents/scripts/test_parallel_speed_a100.sbatch
parente43b3f8aa36c198b95c1e46bea2eaf3893b13dc3 (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_parallel_speed_a100.sbatch')
-rwxr-xr-xcollaborativeagents/scripts/test_parallel_speed_a100.sbatch126
1 files changed, 126 insertions, 0 deletions
diff --git a/collaborativeagents/scripts/test_parallel_speed_a100.sbatch b/collaborativeagents/scripts/test_parallel_speed_a100.sbatch
new file mode 100755
index 0000000..f3d0848
--- /dev/null
+++ b/collaborativeagents/scripts/test_parallel_speed_a100.sbatch
@@ -0,0 +1,126 @@
+#!/bin/bash
+#SBATCH --job-name=test_all_a100
+#SBATCH --account=bfqt-delta-gpu
+#SBATCH --partition=gpuA100x4
+#SBATCH --gres=gpu:4
+#SBATCH --nodes=1
+#SBATCH --ntasks=1
+#SBATCH --cpus-per-task=16
+#SBATCH --mem=128G
+#SBATCH --time=01:00:00
+#SBATCH --output=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_a100-%j.out
+#SBATCH --error=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_a100-%j.err
+
+set -e
+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="${PWD}:${PWD}/scripts:${PWD}/../src:${PYTHONPATH}"
+
+MODEL_8B="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/models/llama-3.1-8b-instruct"
+PROFILE_PATH="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/collaborativeagents/data/complex_profiles_v2/profiles_200.jsonl"
+
+echo "=== Parallel Speed Test: ALL 6 METHODS (A100) ==="
+echo "Scale: 10 profiles × 3 sessions = 30 sessions per method"
+date
+nvidia-smi --query-gpu=index,name,memory.total --format=csv
+
+pkill -f "vllm.entrypoints" 2>/dev/null || true
+sleep 2
+
+# Start TWO vLLM servers (user on 8004, agent on 8003)
+echo ""
+echo "Starting vLLM servers..."
+CUDA_VISIBLE_DEVICES=0,1 python -m vllm.entrypoints.openai.api_server \
+ --model $MODEL_8B --port 8004 --tensor-parallel-size 2 \
+ --gpu-memory-utilization 0.45 --max-model-len 8192 \
+ --disable-log-requests --dtype bfloat16 &
+
+CUDA_VISIBLE_DEVICES=2,3 python -m vllm.entrypoints.openai.api_server \
+ --model $MODEL_8B --port 8003 --tensor-parallel-size 2 \
+ --gpu-memory-utilization 0.45 --max-model-len 8192 \
+ --disable-log-requests --dtype bfloat16 &
+
+for i in $(seq 1 120); do
+ u=$(curl -s http://localhost:8004/health > /dev/null 2>&1 && echo 1 || echo 0)
+ a=$(curl -s http://localhost:8003/health > /dev/null 2>&1 && echo 1 || echo 0)
+ [ "$u" = "1" ] && [ "$a" = "1" ] && echo "Both servers ready after $((i*2))s" && break
+ sleep 2
+done
+
+# Additional wait for servers to fully load models
+echo "Waiting 30s for servers to fully initialize..."
+sleep 30
+echo "Starting experiments..."
+
+# Common parameters for all tests
+COMMON_ARGS="--datasets math-hard --n-profiles 10 --n-sessions 3 --max-turns 10 --use-vllm --parallel-profiles 10 --no-batch-processing --output-dir ../results/parallel_test_a100 --profile-path $PROFILE_PATH"
+
+# Test 1: vanilla (batch processing)
+echo ""
+echo "=== TEST 1: vanilla (batch processing) ==="
+START=$(date +%s)
+python scripts/run_experiments.py \
+ --methods vanilla \
+ --datasets math-hard \
+ --n-profiles 10 --n-sessions 3 --max-turns 10 \
+ --use-vllm --parallel-profiles 10 \
+ --use-batch-processing --batch-size 30 \
+ --output-dir ../results/parallel_test_a100 \
+ --profile-path "$PROFILE_PATH"
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> vanilla: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+# Test 2: contextual
+echo ""
+echo "=== TEST 2: contextual ==="
+START=$(date +%s)
+python scripts/run_experiments.py --methods contextual $COMMON_ARGS
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> contextual: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+# Test 3: reflection
+echo ""
+echo "=== TEST 3: reflection ==="
+START=$(date +%s)
+python scripts/run_experiments.py --methods reflection $COMMON_ARGS
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> reflection: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+# Test 4: all_memory
+echo ""
+echo "=== TEST 4: all_memory ==="
+START=$(date +%s)
+python scripts/run_experiments.py --methods all_memory $COMMON_ARGS
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> all_memory: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+# Test 5: rag
+echo ""
+echo "=== TEST 5: rag ==="
+START=$(date +%s)
+python scripts/run_experiments.py --methods rag $COMMON_ARGS
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> rag: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+# Test 6: rag_vector
+echo ""
+echo "=== TEST 6: rag_vector ==="
+START=$(date +%s)
+python scripts/run_experiments.py --methods rag_vector $COMMON_ARGS
+END=$(date +%s)
+ELAPSED=$((END - START))
+echo ">>> rag_vector: 30 sessions in ${ELAPSED}s = $((30 * 3600 / ELAPSED)) sessions/hr"
+
+pkill -f "vllm.entrypoints" 2>/dev/null || true
+
+echo ""
+echo "=== ALL SPEED TESTS COMPLETE ==="
+date