File size: 5,768 Bytes
23e73f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
# Run 17 verified-by-smoke methods.
# Confidence levels noted inline. Failures of one method do NOT abort the rest.

source /root/miniconda3/etc/profile.d/conda.sh
export PYTHONPATH=$PYTHONPATH:/root/autodl-tmp/SplatAtlas

ERROR_LOG="/root/autodl-tmp/SplatAtlas/run_errors.log"
STATUS_LOG="/root/autodl-tmp/SplatAtlas/run_status.log"

echo "================================================================" | tee -a "$ERROR_LOG" "$STATUS_LOG"
echo "17-method run started at $(date)"                                  | tee -a "$ERROR_LOG" "$STATUS_LOG"
echo "================================================================" | tee -a "$ERROR_LOG" "$STATUS_LOG"

# ----------------------------------------------------------------
# Pre-flight: lp_3dgs env is missing torch (audit confirmed).
# Install before queue starts so it doesn't waste a slot failing on import.
# ----------------------------------------------------------------
echo "[pre-flight] checking lp_3dgs torch..."
if ! /root/autodl-tmp/envs/lp_3dgs/bin/python -c "import torch" 2>/dev/null; then
    echo "[pre-flight] lp_3dgs missing torch, installing torch==2.1.2+cu118..."
    conda activate /root/autodl-tmp/envs/lp_3dgs
    pip install torch==2.1.2 torchvision torchaudio \
        --index-url https://download.pytorch.org/whl/cu118 -q
    if /root/autodl-tmp/envs/lp_3dgs/bin/python -c "import torch; assert torch.cuda.is_available()" 2>/dev/null; then
        echo "[pre-flight] lp_3dgs torch OK"
    else
        echo "[pre-flight] lp_3dgs torch install FAILED — will skip lp_3dgs in queue" \
            | tee -a "$ERROR_LOG"
        SKIP_LP3DGS=1
    fi
    conda deactivate
fi

# ----------------------------------------------------------------
# Task list. Format: "<env_path> <script_path>  # <confidence note>"
# Order: low risk → high risk
# ----------------------------------------------------------------
declare -a tasks=(
    # --- Tier 1: smoke 3000-iter user-confirmed exit 0 ---
    "/root/autodl-tmp/envs/gigs                scripts/run_gigs_benchmark.py"
    "/root/autodl-tmp/envs/sort_free_gs        scripts/run_sortfreegs_benchmark.py"
    "/root/autodl-tmp/envs/analytic_splatting  scripts/run_analyticsplatting_benchmark.py"
    "/root/autodl-tmp/envs/ngs                 scripts/run_ngs_benchmark.py"
    "/root/autodl-tmp/envs/aaa_gaussians       scripts/run_aaags_benchmark.py"
    "/root/autodl-tmp/envs/improving_adc       scripts/run_improvingadc_benchmark.py"
    "/root/autodl-tmp/envs/compact3dgs         scripts/run_compact3dgs_benchmark.py"
    "/root/autodl-tmp/envs/sogs                scripts/run_sogs_benchmark.py"

    # --- Tier 2: 100-iter audit OK (worker B 报告过 + audit 复核) ---
    "/root/autodl-tmp/envs/cdc_gs              scripts/run_cdcgs_benchmark.py"
    "/root/autodl-tmp/envs/op43dgs             scripts/run_op43dgs_benchmark.py"
    "/root/autodl-tmp/envs/bags                scripts/run_bags_benchmark.py"
    "/root/autodl-tmp/envs/gspull              scripts/run_gspull_benchmark.py"
    "/root/autodl-tmp/envs/FLoD                scripts/run_flod_benchmark.py"

    # --- Tier 3: 慢 / 弱信号(silent failure 风险),放后面 ---
    "/root/autodl-tmp/envs/spec_gaussian       scripts/run_specgaussian_benchmark.py"
    "/root/autodl-tmp/envs/pup_3dgs            scripts/run_pup3dgs_benchmark.py"
    "/root/autodl-tmp/envs/gaussianfocus       scripts/run_gaussianfocus_benchmark.py"
    "/root/autodl-tmp/envs/lp_3dgs             scripts/run_lp3dgs_benchmark.py"
)

# ----------------------------------------------------------------
# Run loop
# ----------------------------------------------------------------
TOTAL=${#tasks[@]}
IDX=0
for task in "${tasks[@]}"; do
    IDX=$((IDX + 1))
    read -r env_path script_path <<< "$task"
    method_name=$(basename "$script_path" .py)

    echo "----------------------------------------------------------------" \
        | tee -a "$STATUS_LOG"
    echo "[$IDX/$TOTAL] $(date '+%Y-%m-%d %H:%M:%S')  $method_name" \
        | tee -a "$STATUS_LOG"

    # Skip lp_3dgs if pre-flight torch install failed
    if [ "$method_name" = "run_lp3dgs_benchmark" ] && [ "$SKIP_LP3DGS" = "1" ]; then
        echo "[skip] lp_3dgs torch not available" | tee -a "$STATUS_LOG" "$ERROR_LOG"
        continue
    fi

    # Sanity: env exists?
    if [ ! -d "$env_path" ]; then
        echo "[skip] env missing: $env_path" | tee -a "$STATUS_LOG" "$ERROR_LOG"
        continue
    fi

    conda activate "$env_path"
    if [ $? -ne 0 ]; then
        echo "[fail] could not activate $env_path" | tee -a "$STATUS_LOG" "$ERROR_LOG"
        continue
    fi

    # Common deps (idempotent, fast if already there)
    pip install lpips imageio scikit-image -q 2>/dev/null

    START=$(date +%s)
    PYTHONPATH=/root/autodl-tmp/SplatAtlas \
        "$CONDA_PREFIX/bin/python" "/root/autodl-tmp/SplatAtlas/$script_path" \
        2> >(tee -a "$ERROR_LOG" >&2)
    RC=$?
    END=$(date +%s)
    DURATION=$((END - START))

    if [ $RC -eq 0 ]; then
        echo "[done] $method_name  (rc=0, ${DURATION}s)" | tee -a "$STATUS_LOG"
    else
        echo "[FAIL] $method_name  (rc=$RC, ${DURATION}s) — see $ERROR_LOG" \
            | tee -a "$STATUS_LOG"
        echo "[$(date)] FAILED: $method_name (rc=$RC)" >> "$ERROR_LOG"
    fi

    conda deactivate
done

echo "================================================================" | tee -a "$STATUS_LOG"
echo "17-method run finished at $(date)"                                 | tee -a "$STATUS_LOG"
echo "Status log: $STATUS_LOG"
echo "Error log:  $ERROR_LOG"
echo ""
echo "To check render flags after run:"
echo "  ls outputs/*/render_complete_30000.flag 2>/dev/null | wc -l"
echo "================================================================"