Skip to content

find-gpu-and-train: retry full zone passes on stockout - #56

Open
nima-siboni wants to merge 1 commit into
mainfrom
feat/find-gpu-retry-loop
Open

find-gpu-and-train: retry full zone passes on stockout#56
nima-siboni wants to merge 1 commit into
mainfrom
feat/find-gpu-retry-loop

Conversation

@nima-siboni

Copy link
Copy Markdown
Member

Summary

  • Wrap the zone-walk in an outer retry loop so it keeps trying when every zone is stocked-out, instead of exiting after one pass.
  • Sleep LORA4VR_RETRY_SLEEP seconds (default 180 = 3 min) between passes.
  • LORA4VR_MAX_PASSES (default 0 = infinite) caps the retry count.
  • Non-stockout failures (e.g. Quota 'GPUS_ALL_REGIONS' exceeded) still abort immediately — retrying wouldn't help and we don't want to leave partial VMs.

Behavior

  • Success in any zone → exit 0 (unchanged).
  • Non-stockout failure → exit RC (unchanged).
  • All zones stocked-out in one pass → log, sleep LORA4VR_RETRY_SLEEPs, run the pass again. The pass counter is included in every zone-attempt log line so it's clear how many full sweeps have happened.

Defaults reflect the user's ask: "at the end of the inner loop give it a little bit of pause, 3 mins or so."

Test plan

  • bash -n scripts/gcp_find_gpu_and_train.sh (syntax OK).
  • Smoke: run with LORA4VR_ZONE_LIST=bogus-zone-1 bogus-zone-2 LORA4VR_RETRY_SLEEP=5 LORA4VR_MAX_PASSES=2 bash scripts/gcp_find_gpu_and_train.sh ... — confirm two passes, ~5s between them, exit 2.
  • Live test with actual stocked-out zones during the next run.

🤖 Generated with Claude Code

…kout

Previously a single pass over the zone list — if every zone was stocked
out, the script exited with code 2 and the user had to re-launch.
Now wraps the zone loop in an outer retry loop: when a whole pass yields
nothing but stockouts, sleep `LORA4VR_RETRY_SLEEP` seconds (default 180)
and try again. Non-stockout failures (e.g. quota exhausted) still abort
immediately so we don't leave partial VMs behind.

Tunables:
  LORA4VR_RETRY_SLEEP=180   # seconds between passes
  LORA4VR_MAX_PASSES=0      # 0 = infinite; >0 = cap then exit 2

The pass counter is logged so it's easy to tell how many full sweeps
the script has done while waiting for capacity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant