4141# Set up environment variables for SLURM
4242export SLURM_PARTITION=" batch"
4343export SLURM_ACCOUNT=" benchmark"
44- export SLURM_JOB_NAME=" benchmark-dynamo.job"
4544
4645NGINX_IMAGE=" nginx:1.27.4"
4746
4847SQUASH_FILE=" /mnt/lustre01/users-public/sa-shared/$( echo " $IMAGE " | sed ' s/[\/:@#]/_/g' ) .sqsh"
4948NGINX_SQUASH_FILE=" /mnt/lustre01/users-public/sa-shared/$( echo " $NGINX_IMAGE " | sed ' s/[\/:@#]/_/g' ) .sqsh"
5049
51- srun -N 1 -A $SLURM_ACCOUNT -p $SLURM_PARTITION bash -c " enroot import -o $SQUASH_FILE docker://$IMAGE "
52- srun -N 1 -A $SLURM_ACCOUNT -p $SLURM_PARTITION bash -c " enroot import -o $NGINX_SQUASH_FILE docker://$NGINX_IMAGE "
50+ enroot import -o $SQUASH_FILE docker://$IMAGE
51+ enroot import -o $NGINX_SQUASH_FILE docker://$NGINX_IMAGE
5352
5453export ISL=" $ISL "
5554export OSL=" $OSL "
5655
56+ # Legacy path that doesn't use srt-slurm
5757if [[ $FRAMEWORK == " dynamo-sglang" && -z " $CONFIG_FILE " ]]; then
5858 export IMAGE=$SQUASH_FILE
5959 export SGL_SLURM_JOBS_PATH=" dynamo/examples/backends/sglang/slurm_jobs"
@@ -66,7 +66,7 @@ if [[ $FRAMEWORK == "dynamo-sglang" && -z "$CONFIG_FILE" ]]; then
6666 bash " benchmarks/${BENCHMARK_SUBDIR} /${SCRIPT_NAME} "
6767 # Wait for all jobs to complete
6868 echo " Waiting for all jobs to complete..."
69- while [ -n " $( squeue -u $USER --noheader --format= ' %i ' ) " ]; do
69+ while [ -n " $( squeue -j " $jobid " --noheader) " ]; do
7070 echo " Jobs still running..."
7171 squeue --steps -u $USER
7272 sleep 30
@@ -164,13 +164,11 @@ cat srtslurm.yaml
164164echo " Running make setup..."
165165make setup ARCH=aarch64
166166
167- # these 2 lines are for debugging
168- # TODO: remove when merge
169- echo " Make setup complete"
170- ls configs/
171-
172167echo " Submitting job with srtctl..."
173168
169+ # Override the job name in the config file with the runner name
170+ sed -i " s/^name:.*/name: \" ${RUNNER_NAME} \" /" " $CONFIG_FILE "
171+
174172if [[ " $FRAMEWORK " == " dynamo-sglang" ]]; then
175173 SRTCTL_OUTPUT=$( srtctl apply -f " $CONFIG_FILE " --tags " gb200,${MODEL_PREFIX} ,${PRECISION} ,${ISL} x${OSL} ,infmax-$( date +%Y%m%d) " --setup-script install-torchao.sh 2>&1 )
176174else
@@ -180,27 +178,50 @@ echo "$SRTCTL_OUTPUT"
180178
181179JOB_ID=$( echo " $SRTCTL_OUTPUT " | grep -oP ' ✅ Job \K[0-9]+' || echo " $SRTCTL_OUTPUT " | grep -oP ' Job \K[0-9]+' )
182180
181+ set +x
182+
183183if [ -z " $JOB_ID " ]; then
184184 echo " Error: Failed to extract JOB_ID from srtctl output"
185185 exit 1
186186fi
187187
188188echo " Extracted JOB_ID: $JOB_ID "
189189
190- # Wait for this specific job to complete
191- echo " Waiting for job $JOB_ID to complete..."
192- while [ -n " $( squeue -j $JOB_ID --noheader 2> /dev/null) " ]; do
193- echo " Job $JOB_ID still running..."
194- squeue -j $JOB_ID
195- sleep 30
196- done
197- echo " Job $JOB_ID completed!"
198-
199- echo " Collecting results..."
200-
201190# Use the JOB_ID to find the logs directory
202191# srtctl creates logs in outputs/JOB_ID/logs/
203192LOGS_DIR=" outputs/$JOB_ID /logs"
193+ LOG_FILE=" $LOGS_DIR /sweep_${JOB_ID} .log"
194+
195+ # Wait for log file to appear (also check job is still alive)
196+ while ! ls " $LOG_FILE " & > /dev/null; do
197+ if ! squeue -j " $JOB_ID " --noheader 2> /dev/null | grep -q " $JOB_ID " ; then
198+ echo " ERROR: Job $JOB_ID failed before creating log file"
199+ scontrol show job " $JOB_ID "
200+ exit 1
201+ fi
202+ echo " Waiting for JOB_ID $JOB_ID to begin and $LOG_FILE to appear..."
203+ sleep 5
204+ done
205+
206+ # Poll for job completion in background
207+ (
208+ while squeue -j " $JOB_ID " --noheader 2> /dev/null | grep -q " $JOB_ID " ; do
209+ sleep 10
210+ done
211+ ) &
212+ POLL_PID=$!
213+
214+ echo " Tailing LOG_FILE: $LOG_FILE "
215+
216+ # Stream the log file until job completes (-F follows by name, polls instead of inotify for NFS)
217+ tail -F -s 2 -n+1 " $LOG_FILE " --pid=$POLL_PID 2> /dev/null
218+
219+ wait $POLL_PID
220+
221+ set -x
222+
223+ echo " Job $JOB_ID completed!"
224+ echo " Collecting results..."
204225
205226if [ ! -d " $LOGS_DIR " ]; then
206227 echo " Warning: Logs directory not found at $LOGS_DIR "
209230
210231echo " Found logs directory: $LOGS_DIR "
211232
212- cat $LOGS_DIR /sweep_$JOB_ID .log
213-
214- for file in $LOGS_DIR /* ; do
215- if [ -f " $file " ]; then
216- tail -n 500 $file
217- fi
218- done
233+ cp -r " $LOGS_DIR " " $GITHUB_WORKSPACE /LOGS"
234+ tar czf " $GITHUB_WORKSPACE /multinode_server_logs.tar.gz" -C " $LOGS_DIR " .
219235
220236# Find all result subdirectories
221237RESULT_SUBDIRS=$( find " $LOGS_DIR " -maxdepth 1 -type d -name " *isl*osl*" 2> /dev/null)
@@ -254,10 +270,4 @@ else
254270 done
255271fi
256272
257- # Cleanup
258- echo " Cleaning up..."
259- deactivate 2> /dev/null || true
260- rm -rf .venv
261- echo " Cleanup complete"
262-
263273echo " All result files processed"
0 commit comments