From cbeb4d6292f5d19a313ddfc7d37707a7f5f33fef Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Wed, 1 Apr 2026 12:59:33 -0500 Subject: Add run_clean_sparsity.sh: shell runner for independent-process sparsity Co-Authored-By: Claude Opus 4.6 (1M context) --- run_clean_sparsity.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 run_clean_sparsity.sh 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 ===" -- cgit v1.2.3