llm1_extractor.py
→ extractions CSV
hipaa_connector.py → Soufflé
→ verdicts + analysis
Step 0 — Connect
You need cluster access first — email rt@cs.stonybrook.edu with your NetID before Tuesday. Then choose your connection method:
- Open Terminal (Cmd+Space → "Terminal")
- Connect: ssh yournetid@submit.ai.stonybrook.edu
- First time: type
yesto accept the host key - Enter your NetID password when prompted (nothing shows as you type — that's normal)
Optional shortcut — add to ~/.ssh/config so you just type ssh ai:
- Install VS Code if you don't have it yet
- Install the Remote - SSH extension (search in Extensions panel:
ms-vscode-remote.remote-ssh) - Verify OpenSSH is installed — open PowerShell and run:
ssh -V
Should print something like
OpenSSH_8.x. If not, install via Windows Settings → Optional Features → OpenSSH Client. - In VS Code: Ctrl+Shift+P → type
Remote-SSH: Add New SSH Host - Enter:
ssh yournetid@submit.ai.stonybrook.edu - Click Connect to Host → choose Linux when asked about OS
- Enter your NetID password
- Download PuTTY from putty.org
- Host Name:
submit.ai.stonybrook.edu· Port:22· Connection type: SSH - Click Open, type your NetID and password
- For file transfer, also download WinSCP — use the same host/port/credentials
Step 1 — First-Time Setup (do this once)
After your first login, run these once to set up your environment. Paste them one at a time.
Load modules and add to your shell profile
module load slurm python3 echo "module load slurm python3" >> ~/.bashrcInstall Miniconda (lightweight Python manager)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh # accept all defaults source ~/.bashrcCreate the ComplianceGPT conda environment
conda create -n compliancegpt python=3.10 -y conda activate compliancegpt pip install torch transformers accelerate pandas tiktokenCreate working directories
mkdir -p ~/compliancegpt/results ~/compliancegpt/logsTest GPU access — submit this job and check the output
# Create test job cat > ~/test_gpu.sh << 'EOF' #!/bin/bash #SBATCH --job-name=test_gpu #SBATCH --output=/home/YOURNETID/logs/test_%j.txt #SBATCH --time=0-00:05 #SBATCH --mem=4000 #SBATCH --gres=gpu:1 source ~/miniconda3/etc/profile.d/conda.sh conda activate compliancegpt python -c "import torch; print('CUDA:', torch.cuda.is_available()); print('GPU:', torch.cuda.get_device_name(0))" EOF # Replace YOURNETID above, then: sbatch ~/test_gpu.shWait 1–2 min, then check output: cat ~/logs/test_*.txt. Should say CUDA: True and a GPU name.
Step 2 — Run LLM Extraction (Exercise 9)
This is the actual research job. It runs llm1_extractor.py on the GoldCoin dataset and writes a CSV of JSON extractions. No Soufflé here.
Create the extraction job script
nano ~/compliancegpt/run_extraction.shPaste this content (replace YOURNETID):
Submit and monitor
sbatch ~/compliancegpt/run_extraction.sh # submit — note the job ID printed squeue -u yournetid # check status (PD=pending, R=running) tail -f ~/compliancegpt/logs/extract_*_out.txt # watch live outputThe job typically takes 3–8 minutes per scenario on a V100. Full 137-scenario run takes ~15–30 minutes. Ctrl+C to stop tail — it won't cancel the job.
Verify the output when done
ls -lh ~/compliancegpt/results/ # confirm CSV exists head -2 ~/compliancegpt/results/extractions_*.csv # peek at first 2 rows sacct -u yournetid --format=JobID,Elapsed,State # job historyStep 3 — Download the Extraction CSV
In a local terminal on your laptop (not on the cluster):
scp yournetid@submit.ai.stonybrook.edu:\ ~/compliancegpt/results/extractions_JOBID.csv \ ~/Downloads/Replace JOBID with the number printed when you ran sbatch. Or use * to grab all CSVs: .../results/extractions_*.csv
- In VS Code with the cluster connected, open the Explorer panel
- Navigate to
/home/yournetid/compliancegpt/results/ - Right-click the CSV → Download
- Choose your local Downloads folder
- Open WinSCP · Host:
submit.ai.stonybrook.edu· Port: 22 · Protocol: SFTP - Login with your NetID and password
- Navigate to
/home/yournetid/compliancegpt/results/ - Drag the CSV to your local Downloads folder on the left panel
Step 4 — Run Soufflé Locally (on your laptop)
Open week2_nlp.ipynb on your laptop. Go to Exercise 9, Step 3. Set EXTRACTION_CSV to your downloaded file path and run the cell — it feeds each scenario_json to the local Soufflé engine and writes a new CSV with verdict_norm added.
SLURM Commands Reference
| Command | What it does |
|---|---|
sbatch myjob.sh | Submit a job — returns a job ID |
squeue -u yournetid | Show your queued/running jobs (PD=pending, R=running) |
squeue | Show all jobs on the cluster |
scancel JOBID | Cancel a job |
sacct -u yournetid | Job history including elapsed time and exit status |
sinfo | Show all nodes and their availability |
tail -f logfile.txt | Watch a log file update in real time (Ctrl+C to exit) |
Job Script Flags — ComplianceGPT Defaults
| Flag | Value | Why |
|---|---|---|
--gres=gpu:1 | 1 GPU | One GPU is enough for 4B inference. Do not request more — other users need them. |
--mem=32000 | 32 GB RAM | Gemma3:4B needs ~24 GB VRAM + system overhead |
--time=0-04:00 | 4 hours | Full 137-scenario run takes ~30 min; 4 hrs gives buffer |
--output=..._%j.txt | %j = job ID | Unique log file per job — don't clobber previous runs |
Troubleshooting
| Problem | Fix |
|---|---|
| Connection refused / timeout | You're not on campus network or VPN — connect to SBU VPN first (vpn.stonybrook.edu) |
Permission denied | Wrong NetID or password. Try again. Password is case-sensitive. |
| Job stuck in PD forever | All GPUs busy. Run sinfo to see which nodes are free. Try adding --nodelist=gpu1 to target a specific node. |
conda: command not found | Run source ~/.bashrc or log out and back in |
CUDA: False in test job | Forgot --gres=gpu:1 in your #SBATCH flags — job ran on a CPU node |
| Empty output CSV | Check logs/extract_*_err.txt — usually a Python import error or wrong file path |
| Can't download CSV | Make sure you're running scp from your laptop terminal, not from inside the cluster |
Questions?
Slack #cluster-help or email priscillakyeidanso@gmail.com. Include your job ID and paste the contents of your error log.
Full hardware specs and advanced usage: cluster.html