summaryrefslogtreecommitdiff
path: root/collaborativeagents/scripts/test_batch_50.sh
diff options
context:
space:
mode:
Diffstat (limited to 'collaborativeagents/scripts/test_batch_50.sh')
-rwxr-xr-xcollaborativeagents/scripts/test_batch_50.sh107
1 files changed, 107 insertions, 0 deletions
diff --git a/collaborativeagents/scripts/test_batch_50.sh b/collaborativeagents/scripts/test_batch_50.sh
new file mode 100755
index 0000000..35f4440
--- /dev/null
+++ b/collaborativeagents/scripts/test_batch_50.sh
@@ -0,0 +1,107 @@
+#!/bin/bash
+# Test batch processing with 50 conversations (paper's configuration)
+
+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}/../src:${PYTHONPATH}"
+
+MODEL_8B="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/models/llama-3.1-8b-instruct"
+PORT_USER=8004
+PORT_AGENT=8003
+
+echo "============================================"
+echo "Batch Processing Test (Paper Configuration)"
+echo "Batch Size: 50 conversations"
+echo "============================================"
+date
+nvidia-smi --query-gpu=index,name,memory.total --format=csv
+echo ""
+
+# Kill any existing vLLM servers
+pkill -f "vllm.entrypoints" 2>/dev/null || true
+sleep 2
+
+# Start servers with TP=2
+echo "Starting 8B user simulator server (GPU 0-1, TP=2)..."
+CUDA_VISIBLE_DEVICES=0,1 python -m vllm.entrypoints.openai.api_server \
+ --model $MODEL_8B \
+ --port $PORT_USER \
+ --tensor-parallel-size 2 \
+ --gpu-memory-utilization 0.85 \
+ --max-model-len 4096 \
+ --disable-log-requests \
+ --dtype bfloat16 &
+SERVER_USER_PID=$!
+
+echo "Starting 8B agent server (GPU 2-3, TP=2)..."
+CUDA_VISIBLE_DEVICES=2,3 python -m vllm.entrypoints.openai.api_server \
+ --model $MODEL_8B \
+ --port $PORT_AGENT \
+ --tensor-parallel-size 2 \
+ --gpu-memory-utilization 0.85 \
+ --max-model-len 4096 \
+ --disable-log-requests \
+ --dtype bfloat16 &
+SERVER_AGENT_PID=$!
+
+echo "Waiting for servers..."
+for i in $(seq 1 100); do
+ READY_USER=$(curl -s http://localhost:$PORT_USER/health > /dev/null 2>&1 && echo 1 || echo 0)
+ READY_AGENT=$(curl -s http://localhost:$PORT_AGENT/health > /dev/null 2>&1 && echo 1 || echo 0)
+ if [ "$READY_USER" = "1" ] && [ "$READY_AGENT" = "1" ]; then
+ echo "Both servers ready after $((i*3)) seconds"
+ break
+ fi
+ if [ $((i % 20)) -eq 0 ]; then
+ echo " Still waiting... ($((i*3))s)"
+ fi
+ sleep 3
+done
+
+if ! curl -s http://localhost:$PORT_USER/health > /dev/null; then
+ echo "ERROR: User server not healthy"; kill $SERVER_USER_PID $SERVER_AGENT_PID 2>/dev/null; exit 1
+fi
+if ! curl -s http://localhost:$PORT_AGENT/health > /dev/null; then
+ echo "ERROR: Agent server not healthy"; kill $SERVER_USER_PID $SERVER_AGENT_PID 2>/dev/null; exit 1
+fi
+echo "✓ Both servers healthy"
+
+echo ""
+echo "============================================"
+echo "Test 1: Batch=50, Turns=5"
+echo "============================================"
+python scripts/test_batch_50.py \
+ http://localhost:$PORT_USER/v1 \
+ http://localhost:$PORT_AGENT/v1 \
+ 50 5
+
+echo ""
+echo "============================================"
+echo "Test 2: Batch=50, Turns=10 (paper config)"
+echo "============================================"
+python scripts/test_batch_50.py \
+ http://localhost:$PORT_USER/v1 \
+ http://localhost:$PORT_AGENT/v1 \
+ 50 10
+
+echo ""
+echo "============================================"
+echo "Test 3: Batch=100, Turns=10 (stress test)"
+echo "============================================"
+python scripts/test_batch_50.py \
+ http://localhost:$PORT_USER/v1 \
+ http://localhost:$PORT_AGENT/v1 \
+ 100 10
+
+# Cleanup
+echo ""
+echo "Cleaning up..."
+kill $SERVER_USER_PID $SERVER_AGENT_PID 2>/dev/null || true
+
+echo ""
+date