From dc801c07cf38b0c495686463e6ca6f871a64440e Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Tue, 27 Jan 2026 09:57:37 -0600 Subject: 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 --- .../scripts/full_experiment_batch.sbatch | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 collaborativeagents/scripts/full_experiment_batch.sbatch (limited to 'collaborativeagents/scripts/full_experiment_batch.sbatch') diff --git a/collaborativeagents/scripts/full_experiment_batch.sbatch b/collaborativeagents/scripts/full_experiment_batch.sbatch new file mode 100644 index 0000000..1dc4da1 --- /dev/null +++ b/collaborativeagents/scripts/full_experiment_batch.sbatch @@ -0,0 +1,132 @@ +#!/bin/bash +#SBATCH --job-name=batch_exp +#SBATCH --account=bfqt-delta-gpu +#SBATCH --partition=gpuH200x8 +#SBATCH --gres=gpu:4 +#SBATCH --nodes=1 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --mem=256G +#SBATCH --time=24:00:00 +#SBATCH --output=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/batch_exp-%j.out +#SBATCH --error=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/batch_exp-%j.err + +# Full experiment: Batch-processable methods (vanilla, all_memory) +# 200 profiles × 30 sessions = 6,000 sessions per method +# Using turn-synchronous batch processing (paper's approach) + +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 +PROFILE_PATH="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/collaborativeagents/data/complex_profiles_v2/profiles_200.jsonl" + +echo "============================================" +echo "Full Experiment: Batch Methods" +echo "============================================" +echo "Methods: vanilla, all_memory" +echo "Profiles: 200" +echo "Sessions/profile: 30" +echo "Total: 6,000 sessions per method" +echo "" +date +nvidia-smi --query-gpu=index,name,memory.total --format=csv +echo "" + +# Kill any existing servers +pkill -f "vllm.entrypoints" 2>/dev/null || true +sleep 2 + +# Start vLLM servers with optimized settings +echo "Starting 8B user simulator (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.90 \ + --max-model-len 8192 \ + --disable-log-requests \ + --dtype bfloat16 \ + --max-num-seqs 256 & +SERVER_USER_PID=$! + +echo "Starting 8B agent (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.90 \ + --max-model-len 8192 \ + --disable-log-requests \ + --dtype bfloat16 \ + --max-num-seqs 256 & +SERVER_AGENT_PID=$! + +echo "Waiting for servers (may take 5-10 min for CUDA graph compilation)..." +for i in $(seq 1 200); 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))s" + 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 "" + +# Run batch experiment (only vanilla is truly stateless) +for METHOD in vanilla; do + echo "============================================" + echo "Running: $METHOD (BATCH processing)" + echo "============================================" + START=$(date +%s) + + python scripts/run_experiments.py \ + --methods $METHOD \ + --datasets math-hard,math-500,bigcodebench \ + --n-profiles 200 \ + --n-sessions 30 \ + --max-turns 15 \ + --use-vllm \ + --batch-size 50 \ + --parallel-profiles 50 \ + --output-dir ../results/full_experiment_h200 \ + --profile-path "$PROFILE_PATH" + + END=$(date +%s) + ELAPSED=$((END-START)) + echo "" + echo "$METHOD completed in ${ELAPSED}s" + THROUGHPUT=$((6000 * 3600 / ELAPSED)) + echo "Throughput: ${THROUGHPUT} sessions/hr" + echo "" +done + +# Cleanup +echo "Cleaning up..." +kill $SERVER_USER_PID $SERVER_AGENT_PID 2>/dev/null || true + +echo "" +echo "============================================" +echo "BATCH EXPERIMENT COMPLETE" +echo "============================================" +date -- cgit v1.2.3