summaryrefslogtreecommitdiff
path: root/collaborativeagents/slurm/run_rag_vector_llm_test.sh
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/slurm/run_rag_vector_llm_test.sh
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/slurm/run_rag_vector_llm_test.sh')
-rw-r--r--collaborativeagents/slurm/run_rag_vector_llm_test.sh76
1 files changed, 76 insertions, 0 deletions
diff --git a/collaborativeagents/slurm/run_rag_vector_llm_test.sh b/collaborativeagents/slurm/run_rag_vector_llm_test.sh
new file mode 100644
index 0000000..01d9c58
--- /dev/null
+++ b/collaborativeagents/slurm/run_rag_vector_llm_test.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+#SBATCH --job-name=rvec_llm
+#SBATCH --account=bfqt-delta-gpu
+#SBATCH --partition=gpuH200x8
+#SBATCH --nodes=1
+#SBATCH --ntasks=1
+#SBATCH --cpus-per-task=32
+#SBATCH --gres=gpu:h200:4
+#SBATCH --mem=200G
+#SBATCH --time=1:00:00
+#SBATCH --output=rvec_llm_%j.out
+#SBATCH --error=rvec_llm_%j.err
+
+set -e
+cd /projects/bfqt/users/yurenh2/ml-projects/personalization-user-model
+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}/src:${PWD}/collaborativeagents:${PYTHONPATH}"
+export NCCL_P2P_DISABLE=1
+
+# Load OpenAI API key
+set -a
+source .env
+set +a
+
+# Install openai if not present
+pip install --quiet openai python-dotenv
+
+MODEL_70B="meta-llama/Llama-3.1-70B-Instruct"
+MODEL_8B="/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/models/llama-3.1-8b-instruct"
+
+pkill -f "vllm.entrypoints" 2>/dev/null || true
+sleep 2
+
+# 70B user simulator on GPUs 0,1
+CUDA_VISIBLE_DEVICES=0,1 python -m vllm.entrypoints.openai.api_server \
+ --model $MODEL_70B --port 8004 --tensor-parallel-size 2 \
+ --gpu-memory-utilization 0.95 --max-model-len 16384 \
+ --download-dir $HF_HOME --dtype bfloat16 --disable-log-requests &
+
+# 8B agent on GPUs 2,3 with 40% memory (leaving room for embedding + reranker)
+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.40 --max-model-len 16384 \
+ --dtype bfloat16 --disable-log-requests &
+
+# Wait for servers
+for i in $(seq 1 120); do
+ R1=$(curl -s http://localhost:8004/health > /dev/null 2>&1 && echo 1 || echo 0)
+ R2=$(curl -s http://localhost:8003/health > /dev/null 2>&1 && echo 1 || echo 0)
+ [ "$R1" = "1" ] && [ "$R2" = "1" ] && break
+ sleep 3
+done
+
+echo "vLLM servers ready."
+
+cd collaborativeagents/scripts
+
+# Small test: 2 profiles, 5 sessions each
+python run_experiments.py \
+ --methods rag_vector_llm \
+ --datasets math-hard \
+ --n-profiles 2 \
+ --n-sessions 5 \
+ --use-vllm \
+ --vllm-user-url http://localhost:8004/v1 \
+ --vllm-agent-url http://localhost:8003/v1 \
+ --parallel-profiles 2 \
+ --profile-path ../data/complex_profiles_v2/profiles_200.jsonl \
+ --output-dir ../results/rag_vector_llm_test_$(date +%Y%m%d_%H%M%S)
+
+echo "Test complete!"
+
+pkill -f "vllm.entrypoints" 2>/dev/null || true