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/scale_test_batch1.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/scale_test_batch1.sbatch')
| -rw-r--r-- | collaborativeagents/scripts/scale_test_batch1.sbatch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/collaborativeagents/scripts/scale_test_batch1.sbatch b/collaborativeagents/scripts/scale_test_batch1.sbatch new file mode 100644 index 0000000..119be9b --- /dev/null +++ b/collaborativeagents/scripts/scale_test_batch1.sbatch @@ -0,0 +1,121 @@ +#!/bin/bash +#SBATCH --job-name=scale_b1 +#SBATCH --account=bfqt-delta-gpu +#SBATCH --partition=gpuH200x8-interactive +#SBATCH --nodes=1 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --gres=gpu:4 +#SBATCH --mem=200G +#SBATCH --time=01:00:00 +#SBATCH --output=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/scale_b1-%j.out +#SBATCH --error=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/scale_b1-%j.err + +# Scale Test Batch 1: Users 1-5, 15 sessions each, 3 methods +# With CollaborativeAgents-style prompts + +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" +MEMORY_STORE="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/data/corpora/empty_store" + +echo "=== Scale Test Batch 1: 5 users × 15 sessions × 3 methods ===" +date +nvidia-smi --query-gpu=index,name,memory.total --format=csv + +# Start vLLM servers +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 16384 --dtype bfloat16 --download-dir $HF_HOME & + +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 16384 --dtype bfloat16 & + +echo "Waiting for vLLM servers..." +for i in {1..200}; do + if curl -s http://localhost:8004/health > /dev/null 2>&1; then + echo "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 "Agent ready after $((i*5))s" + break + fi + sleep 5 +done +sleep 5 + +OUTPUT_DIR="../results/scale_test_$(date +%Y%m%d_%H%M%S)" + +# Run each method with 5 profiles, 15 sessions +for METHOD in vanilla rag rag_vector; do + echo "" + echo "============================================" + echo "Testing: $METHOD (5 users × 15 sessions)" + echo "============================================" + + # Clear memory store before each method + > ${MEMORY_STORE}/memory_cards.jsonl + rm -f ${MEMORY_STORE}/memory_embeddings.npy + + date + python scripts/run_experiments.py --methods $METHOD \ + --datasets math-hard --n-profiles 5 --n-sessions 15 --max-turns 15 \ + --use-vllm --no-batch-processing --parallel-profiles 1 \ + --output-dir $OUTPUT_DIR --profile-path $PROFILE_PATH + + echo "Method $METHOD completed" + if [ "$METHOD" != "vanilla" ]; then + echo "Final memory cards: $(wc -l < ${MEMORY_STORE}/memory_cards.jsonl 2>/dev/null || echo 0)" + fi +done + +echo "" +echo "=== Scale Test Batch 1 Complete ===" +date + +# Generate comparison +python3 << 'PYEOF' +import json +from pathlib import Path + +output_base = sorted(Path("../results").glob("scale_test_*"))[-1] +print(f"\n=== Results Summary ===\nDir: {output_base}\n") + +methods = ["vanilla", "rag", "rag_vector"] +results = {} + +for subdir in output_base.iterdir(): + if subdir.is_dir(): + for method in methods: + result_file = subdir / method / "results.json" + if result_file.exists() and method not in results: + with open(result_file) as f: + results[method] = json.load(f) + +if results: + print(f"{'Method':<12} {'Success':<10} {'Turns':<10} {'Enforce':<10} {'Sessions':<10}") + print("-" * 55) + for method in methods: + if method in results: + data = results[method] + n = len(data) + succ = sum(r['metrics']['task_success'] for r in data) / n + turns = sum(r['metrics']['total_turns'] for r in data) / n + enf = sum(r['metrics']['enforcement_count'] for r in data) / n + print(f"{method:<12} {succ:<10.1%} {turns:<10.1f} {enf:<10.1f} {n:<10}") +PYEOF + +pkill -f "vllm.entrypoints" 2>/dev/null || true |
