Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cloudbuild/macrobenchmarks/scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@ shared_workload_helm_args() {

# Poll a JobSet until it reports Completed (return 0) or Failed/timeout (record
# the failure in the ledger, dump diagnostics, return 1). Shared by the
# seed-checkpoint and run-workload steps so the 240x30s poll lives in one place.
# seed-checkpoint and run-workload steps. Default is 240x30s (2h), FSDP gets 480x30s (4h).
# Usage: wait_for_jobset <jobset-name> <step-id>
wait_for_jobset() {
local jobset="$1" step="$2" complete failed
echo "Waiting for JobSet $jobset to complete..."
for _ in $(seq 1 240); do

local max_iterations=240
if [[ "$step" == "run-workload" ]] && [[ "${_TRAINING_STRATEGY}" == "fsdp_full" || "${_TRAINING_STRATEGY}" == "fsdp_sharded" ]]; then
max_iterations=480
fi
Comment thread
yuxin00j marked this conversation as resolved.

echo "Waiting for JobSet $jobset to complete (max_iterations=${max_iterations})..."
for _ in $(seq 1 $max_iterations); do
complete=$(kubectl get jobset "$jobset" -o jsonpath='{.status.conditions[?(@.type=="Completed")].status}' 2>/dev/null || echo "")
failed=$(kubectl get jobset "$jobset" -o jsonpath='{.status.conditions[?(@.type=="Failed")].status}' 2>/dev/null || echo "")
if [ "$complete" = "True" ]; then echo "JobSet $jobset completed."; return 0; fi
Expand Down
Loading