sync scripts/bootstrap_attack.sh for phase 2
Browse files- scripts/bootstrap_attack.sh +46 -0
scripts/bootstrap_attack.sh
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Phase 2 bootstrap: same dual-venv setup as bootstrap_l4.sh, then exec the
|
| 3 |
+
# attack sweep. Keeps the pre-baked-image workflow reproducible.
|
| 4 |
+
set -euo pipefail
|
| 5 |
+
|
| 6 |
+
CORE=/tmp/venv_core
|
| 7 |
+
ALIGN=/tmp/venv_aligntune
|
| 8 |
+
|
| 9 |
+
if ! command -v uv >/dev/null 2>&1; then
|
| 10 |
+
pip install -q --break-system-packages uv
|
| 11 |
+
fi
|
| 12 |
+
|
| 13 |
+
uv venv --system-site-packages --seed "$CORE"
|
| 14 |
+
"$CORE/bin/pip" install --no-cache-dir \
|
| 15 |
+
"transformers>=5.15,<5.22" \
|
| 16 |
+
"trl>=0.12,<1.15" \
|
| 17 |
+
"peft>=0.18,<1" \
|
| 18 |
+
"huggingface-hub>=1.5,<2" \
|
| 19 |
+
"transformer-lens==3.8.0" \
|
| 20 |
+
"bitsandbytes>=0.41" \
|
| 21 |
+
"datasets>=3.0" \
|
| 22 |
+
"accelerate>=1.4" \
|
| 23 |
+
"sentencepiece" \
|
| 24 |
+
"protobuf" \
|
| 25 |
+
"scikit-learn" \
|
| 26 |
+
"hf_transfer" \
|
| 27 |
+
"curatorkit[hf,connectors]" \
|
| 28 |
+
"circuitkit==0.2.3" \
|
| 29 |
+
"safetune==0.1.18" \
|
| 30 |
+
"auditkit==1.1.11"
|
| 31 |
+
|
| 32 |
+
uv venv --system-site-packages --seed "$ALIGN"
|
| 33 |
+
"$ALIGN/bin/pip" install --no-cache-dir \
|
| 34 |
+
"torchvision==0.28.0" \
|
| 35 |
+
"transformers>=5.15,<5.22" \
|
| 36 |
+
"peft>=0.18,<1" \
|
| 37 |
+
"datasets>=4.7.0" \
|
| 38 |
+
"accelerate>=1.6" \
|
| 39 |
+
"trl==1.7.1" \
|
| 40 |
+
"torchao==0.18.0" \
|
| 41 |
+
"aligntune==0.1.35"
|
| 42 |
+
|
| 43 |
+
export ALIGNTUNE_BIN="$ALIGN/bin/aligntune"
|
| 44 |
+
export ALIGNTUNE_PYTHON="$ALIGN/bin/python"
|
| 45 |
+
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 46 |
+
exec "$CORE/bin/python" /code/scripts/attack_sweep.py "$@"
|