-
Notifications
You must be signed in to change notification settings - Fork 4
fix: auto-resolve baked-in checkpoint paths with legacy fallback #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b64ee03
c9eda3c
6c5cd47
dd18525
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,120 +1,156 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run all model grid searches in parallel: Boltz1, Boltz2, Protenix, and RF3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Total: 16 GPUs used (4 jobs x 4 GPUs each) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run all 4 model grid searches in parallel, 2 GPUs each | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Total: 8 GPUs used (4 jobs x 2 GPUs each) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Checkpoints are BAKED INTO the Docker image - no need to mount them! | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Models: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Boltz2 X-ray diffraction (GPUs 0,1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Boltz2 MD (GPUs 2,3) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - RosettaFold3 (GPUs 4,5) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Protenix (GPUs 6,7) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Checkpoints are BAKED INTO the Docker image at /checkpoints/. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # If missing, the code auto-falls back to mounted paths. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Usage: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # ./run_all_models.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Configuration - uses absolute path to data | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DATA_DIR="/mnt/diffuse-private/raw/sampleworks/initial_dataset_40" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| RESULTS_DIR="${RESULTS_DIR:-$HOME/sampleworks-exp/grid_search_results}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Docker image to use (override with IMAGE env var) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMAGE="${IMAGE:-diffuseproject/sampleworks:latest}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DATA_DIR="/mnt/diffuse-private/raw/sampleworks/initial_dataset_40_occ_sweeps" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| RESULTS_DIR="${RESULTS_DIR:-/data/sampleworks-exp/occ_sweep/grid_search_results}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| MSA_CACHE_DIR="${MSA_CACHE_DIR:-/data/sampleworks-exp/msa_cache}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create output directory | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create directories | ||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p "$RESULTS_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p "$MSA_CACHE_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Pull latest image (no-op if already up to date) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Pulling latest Docker image..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| docker pull diffuseproject/sampleworks:latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Common docker options | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DOCKER_OPTS="--rm --shm-size=16g" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Starting all model grid searches" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Models: boltz1, boltz2, protenix, rf3" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Starting all model grid searches (4 jobs x 2 GPUs)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Data: $DATA_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Results: $RESULTS_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Image: $IMAGE" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Checkpoints: BAKED INTO IMAGE" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "MSA Cache: $MSA_CACHE_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Checkpoints: BAKED INTO IMAGE (with mount fallback)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Models:" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Boltz2 X-ray (GPUs 0,1)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Boltz2 MD (GPUs 2,3)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - RF3 (GPUs 4,5)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Protenix (GPUs 6,7)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Track background job PIDs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| declare -a PIDS=() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| declare -a PID_NAMES=() | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to run a model with specific GPUs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Usage: run_model <model> <env> <gpus> [extra_args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run_model() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| local model=$1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| local env=$2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| local gpus=$3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| shift 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| local extra_args=("$@") | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Starting $model on GPUs $gpus" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| docker run $DOCKER_OPTS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gpus "\"device=$gpus\"" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v /mnt/diffuse-private:/mnt/diffuse-private:ro \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$RESULTS_DIR:/data/results" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "$IMAGE" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "$env" run_grid_search.py \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --proteins "$DATA_DIR/proteins.csv" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --models "$model" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --scalers "pure_guidance" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --ensemble-sizes "1 4" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-weights "0.1 0.2" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-normalization --augmentation --align-to-input \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --use-tweedie \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --output-dir /data/results \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "${extra_args[@]}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2>&1 | tee "$RESULTS_DIR/${model}_run.log" & | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS+=($!) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PID_NAMES+=("$model") | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] $model job started (PID: $!)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run all four models in parallel with 4 GPUs each: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - boltz1: GPUs 0,1,2,3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - boltz2: GPUs 4,5,6,7 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - protenix: GPUs 8,9,10,11 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # - rf3: GPUs 12,13,14,15 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Boltz1 (GPUs 0-3) - checkpoints baked in, uses defaults | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run_model "boltz1" "boltz" "0,1,2,3" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Boltz2 (GPUs 4-7) - needs --methods flag | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run_model "boltz2" "boltz" "4,5,6,7" --methods "X-RAY DIFFRACTION" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Protenix (GPUs 8-11) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run_model "protenix" "protenix" "8,9,10,11" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # RF3 (GPUs 12-15) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run_model "rf3" "rf3" "12,13,14,15" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS=() | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- Boltz2 X-ray Diffraction (GPUs 0,1) --- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Starting Boltz2 X-ray on GPUs 0,1" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| docker run $DOCKER_OPTS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gpus '"device=0,1"' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$DATA_DIR:/data/inputs:ro" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$RESULTS_DIR:/data/results" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$MSA_CACHE_DIR:/root/.sampleworks/msa" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| diffuseproject/sampleworks:latest \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -e boltz run_grid_search.py \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --proteins "/data/inputs/proteins.csv" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --models boltz2 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --methods "X-RAY DIFFRACTION" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --scalers pure_guidance \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --partial-diffusion-step 120 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --ensemble-sizes "8" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-weights "0.1 0.2 0.5" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-normalization --augmentation --align-to-input \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --output-dir /data/results \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2>&1 | tee "$RESULTS_DIR/boltz2_xrd_run.log" & | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS+=($!) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Boltz2 X-ray job started (PID: ${PIDS[-1]})" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- Boltz2 MD (GPUs 2,3) --- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Starting Boltz2 MD on GPUs 2,3" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| docker run $DOCKER_OPTS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gpus '"device=2,3"' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$DATA_DIR:/data/inputs:ro" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$RESULTS_DIR:/data/results" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$MSA_CACHE_DIR:/root/.sampleworks/msa" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| diffuseproject/sampleworks:latest \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -e boltz run_grid_search.py \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --proteins "/data/inputs/proteins.csv" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --models boltz2 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --methods "MD" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --scalers pure_guidance \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --partial-diffusion-step 120 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --ensemble-sizes "8" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-weights "0.1 0.2 0.5" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-normalization --augmentation --align-to-input \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --output-dir /data/results \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2>&1 | tee "$RESULTS_DIR/boltz2_md_run.log" & | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS+=($!) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Boltz2 MD job started (PID: ${PIDS[-1]})" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- RosettaFold3 (GPUs 4,5) --- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Starting RosettaFold3 on GPUs 4,5" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| docker run $DOCKER_OPTS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gpus '"device=4,5"' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$DATA_DIR:/data/inputs:ro" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$RESULTS_DIR:/data/results" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$MSA_CACHE_DIR:/root/.sampleworks/msa" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| diffuseproject/sampleworks:latest \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -e rf3 run_grid_search.py \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --proteins "/data/inputs/proteins.csv" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --models rf3 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --partial-diffusion-step 120 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --scalers pure_guidance \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --ensemble-sizes "8" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-weights "0.01 0.02 0.05" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-normalization --augmentation --align-to-input \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --output-dir /data/results \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2>&1 | tee "$RESULTS_DIR/rf3_run.log" & | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS+=($!) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] RosettaFold3 job started (PID: ${PIDS[-1]})" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- Protenix (GPUs 6,7) --- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Starting Protenix on GPUs 6,7" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| docker run $DOCKER_OPTS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gpus '"device=6,7"' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$DATA_DIR:/data/inputs:ro" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$RESULTS_DIR:/data/results" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -v "$MSA_CACHE_DIR:/root/.sampleworks/msa" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| diffuseproject/sampleworks:latest \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -e protenix run_grid_search.py \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --proteins "/data/inputs/proteins.csv" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --models protenix \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --scalers pure_guidance \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --partial-diffusion-step 120 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --ensemble-sizes "8" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-weights "0.1 0.2 0.5" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --gradient-normalization --augmentation --align-to-input \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --output-dir /data/results \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2>&1 | tee "$RESULTS_DIR/protenix_run.log" & | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PIDS+=($!) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] Protenix job started (PID: ${PIDS[-1]})" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "All model jobs launched!" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "All 4 jobs launched! PIDs: ${PIDS[*]}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Logs:" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/boltz1_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/boltz2_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/protenix_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/boltz2_xrd_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/boltz2_md_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/rf3_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - $RESULTS_DIR/protenix_run.log" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Monitor GPU usage: nvidia-smi -l 1" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Waiting for all jobs to complete..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Wait for all background jobs and check exit codes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| overall_exit=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| for i in "${!PIDS[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if wait "${PIDS[$i]}"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] ${PID_NAMES[$i]} completed successfully" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[$(date)] ${PID_NAMES[$i]} FAILED (exit code: $?)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| overall_exit=1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Wait for all background jobs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| wait | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+150
to
154
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Wait for all background jobs | |
| wait | |
| echo "" | |
| echo "==========================================" | |
| # Wait for all background jobs individually and aggregate exit codes | |
| overall_status=0 | |
| for pid in "${PIDS[@]}"; do | |
| if ! wait "$pid"; then | |
| exit_code=$? | |
| echo "[$(date)] Job with PID $pid failed with exit code $exit_code" | |
| overall_status=$exit_code | |
| else | |
| echo "[$(date)] Job with PID $pid completed successfully" | |
| fi | |
| done | |
| echo "" | |
| echo "==========================================" | |
| if [ "$overall_status" -ne 0 ]; then | |
| echo "[$(date)] One or more jobs failed." | |
| echo "==========================================" | |
| exit "$overall_status" | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: diff-use/sampleworks
Length of output: 634
🏁 Script executed:
Repository: diff-use/sampleworks
Length of output: 83
🏁 Script executed:
head -150 run_all_models.sh | cat -nRepository: diff-use/sampleworks
Length of output: 6001
Background pipelines are masking docker run failures.
Each of the 4 job launches uses
docker run ... | tee ... &withoutpipefail. Becauseset -eonly applies to the final command in a pipeline, the exit status comes fromtee(which always succeeds), not fromdocker run. Then the barewaiton line 146 returns success after all children exit, regardless of their actual exit codes. This means the script will report "All jobs completed!" even when one or more containers have failed.Wrap all four launch blocks (lines 49–65, 71–87, 93–107, 113–128) in subshells with
set -o pipefail, then replace the barewaitwith explicit PID-based waits that check exit codes:Suggested change
Apply the same subshell +
pipefailpattern to all four job launches (lines 71–87, 93–107, 113–128).🤖 Prompt for AI Agents