@@ -126,13 +126,29 @@ elif [ "$device" = "gpu" ]; then
126126 # Determine GPU partition
127127 gpu_partition=" batch"
128128 if [ " $gpu_partition_dynamic " = " true" ]; then
129- # Use pre-selected bench partition if available, otherwise query sinfo
130- if [ -n " ${BENCH_GPU_PARTITION:- } " ]; then
131- gpu_partition=" $BENCH_GPU_PARTITION "
132- echo " Using pre-selected bench partition: $gpu_partition (PR/master consistency)"
129+ if [ " $job_type " = " bench" ]; then
130+ # Benchmarks compare PR against master, so both jobs must land on the
131+ # SAME GPU type or the comparison is meaningless. That rules out a
132+ # partition list (SLURM could place PR and master on different
133+ # hardware); instead a single partition is picked and pinned across
134+ # both jobs via BENCH_GPU_PARTITION. See run_parallel_benchmarks.sh.
135+ if [ -n " ${BENCH_GPU_PARTITION:- } " ]; then
136+ gpu_partition=" $BENCH_GPU_PARTITION "
137+ echo " Using pre-selected bench partition: $gpu_partition (PR/master consistency)"
138+ else
139+ source " ${SCRIPT_DIR} /select-gpu-partition.sh"
140+ gpu_partition=" $SELECTED_GPU_PARTITION "
141+ fi
133142 else
134- source " ${SCRIPT_DIR} /select-gpu-partition.sh"
135- gpu_partition=" $SELECTED_GPU_PARTITION "
143+ # Tests (and build+test) don't compare across hardware, so submit to a
144+ # partition LIST and let SLURM start on whichever frees first instead
145+ # of pinning one partition and queueing behind it. This restores the
146+ # multi-partition backfill that #1299 dropped when it unified test and
147+ # bench onto the single-partition bench selector. gpu-l40s (bad
148+ # hardware) and gpu-rtx6000 (too slow for the test time limit) are
149+ # intentionally omitted.
150+ gpu_partition=" gpu-h200,gpu-h100,gpu-a100,gpu-v100"
151+ echo " Using GPU partition list for test job: $gpu_partition "
136152 fi
137153 fi
138154
0 commit comments