diff options
| author | YurenHao0426 <Blackhao0426@gmail.com> | 2026-04-01 12:59:33 -0500 |
|---|---|---|
| committer | YurenHao0426 <Blackhao0426@gmail.com> | 2026-04-01 12:59:33 -0500 |
| commit | cbeb4d6292f5d19a313ddfc7d37707a7f5f33fef (patch) | |
| tree | b568b57aac7c6a9a6d2ef2e0bde839717793876c /run_clean_sparsity.sh | |
| parent | 8eb04f011e7092a8d2e6c89800721a00112fd384 (diff) | |
Add run_clean_sparsity.sh: shell runner for independent-process sparsity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'run_clean_sparsity.sh')
| -rwxr-xr-x | run_clean_sparsity.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/run_clean_sparsity.sh b/run_clean_sparsity.sh new file mode 100755 index 0000000..3737013 --- /dev/null +++ b/run_clean_sparsity.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Run full clean sparsity analysis — each method+seed in independent Python process +# GPU 1 only (CUDA_VISIBLE_DEVICES=1) +set -e +cd /home/yurenh2/fa +export CUDA_VISIBLE_DEVICES=1 +mkdir -p results/confirmatory/clean_sparsity + +CIFAR_SEEDS="42 123 456 789 1024 2048" +CIFAR_METHODS="bp dfa state_bridge credit_bridge" + +SYNTH_SEEDS="42 123 456 789 1024 2048" +SYNTH_METHODS="bp dfa state_bridge credit_bridge" +SYNTH_ALPHAS="0.0 0.5 1.0" +SYNTH_DEPTHS="4 8" + +echo "=== CIFAR SPARSITY ($(echo $CIFAR_SEEDS | wc -w) seeds × $(echo $CIFAR_METHODS | wc -w) methods) ===" +count=0 +total=$(($(echo $CIFAR_SEEDS | wc -w) * $(echo $CIFAR_METHODS | wc -w))) +for method in $CIFAR_METHODS; do + for seed in $CIFAR_SEEDS; do + count=$((count + 1)) + echo "[$count/$total] CIFAR $method s=$seed" + python experiments/clean_sparsity_full.py --dataset cifar --method $method --seed $seed --gpu 0 --output_dir results/confirmatory/clean_sparsity + done +done +echo "=== CIFAR DONE ===" + +echo "" +echo "=== SYNTHETIC SPARSITY ===" +count=0 +total=$(($(echo $SYNTH_SEEDS | wc -w) * $(echo $SYNTH_METHODS | wc -w) * $(echo $SYNTH_ALPHAS | wc -w) * $(echo $SYNTH_DEPTHS | wc -w))) +for alpha in $SYNTH_ALPHAS; do + for depth in $SYNTH_DEPTHS; do + for method in $SYNTH_METHODS; do + for seed in $SYNTH_SEEDS; do + count=$((count + 1)) + ckpt="results/confirmatory/checkpoints_A1/a${alpha}_L${depth}_${method}_s${seed}.pt" + if [ ! -f "$ckpt" ]; then + echo "[$count/$total] SKIP $ckpt" + continue + fi + echo "[$count/$total] synth a=$alpha L=$depth $method s=$seed" + python experiments/clean_sparsity_full.py --dataset synth --method $method --seed $seed --alpha $alpha --depth $depth --gpu 0 --output_dir results/confirmatory/clean_sparsity + done + done + done +done +echo "=== SYNTHETIC DONE ===" +echo "=== ALL CLEAN SPARSITY DONE ===" |
