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_a100x8.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_a100x8.sbatch')
| -rw-r--r-- | collaborativeagents/scripts/test_all_a100x8.sbatch | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/collaborativeagents/scripts/test_all_a100x8.sbatch b/collaborativeagents/scripts/test_all_a100x8.sbatch new file mode 100644 index 0000000..3f117e1 --- /dev/null +++ b/collaborativeagents/scripts/test_all_a100x8.sbatch @@ -0,0 +1,124 @@ +#!/bin/bash +#SBATCH --job-name=test_all_a100x8 +#SBATCH --account=bfqt-delta-gpu +#SBATCH --partition=gpuA100x8-interactive +#SBATCH --gres=gpu:4 +#SBATCH --nodes=1 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --mem=256G +#SBATCH --time=01:00:00 +#SBATCH --output=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_a100x8-%j.out +#SBATCH --error=/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/test_all_a100x8-%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 (A100x8) ===" +echo "Scale: 10 profiles × 3 sessions = 30 sessions per method" +echo "vLLM memory: 45% (leaves room for embedding+reranker)" +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 with REDUCED memory (45%) to leave room for embedding+reranker +echo "" +echo "Starting vLLM servers (45% GPU memory)..." +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 + +sleep 30 +echo "Starting experiments..." + +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/test_a100x8 --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/test_a100x8 \ + --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 |
