Repository navigation
A wedged container held a B200 for 26 minutes, and nothing was watching for it - #99
Merged
Merged
Conversation
…ceiling Every GPU entry point carried timeout=5400 -- ninety minutes, uniform across six functions doing very different work, derived from nothing. Sized them from what the runs take instead, and added the elapsed line that lets the next round tighten them from data rather than from another guess. The timeout is a ceiling on the function, not on getting to the function. One container wedged before Python started -- fifteen lines of NVIDIA banner, no $ line, twenty-six minutes on a B200 having compiled nothing. Nothing inside modal_app.py could have caught it. scripts/modal-run is the guard in the only process still awake, watching for the tell (a healthy run emits Compiling within a couple of minutes of the banner) and stopping the app rather than paying out the ceiling.
feitreim
force-pushed
the
modal-run-limits
branch
from
July 28, 2026 21:49
b77c736 to
c0da009
Compare
This was referenced Jul 28, 2026
scripts/modal-run returns 0 for a run that was stopped, so a killed gate reads as a passing one
#103
Closed
feitreim
added a commit
that referenced
this pull request
Jul 29, 2026
The first run of this branch: build reaches its first `$ ` line 6.5 s in having never been silent for more than 3.1 s, against a 300 s startup budget; the longest quiet stretch anywhere in either job is 58.9 s of sm_100a codegen against 1200 s. And in tier 2 the silence budget cannot bind at all -- the entry point's own timeout=900 is shorter. Tier 3 is where a tighter value would buy something and is the tier with no measurement here, so it keeps #99's. Also: CI installs modal unpinned and drew 1.5.3, where #103's three exit-code behaviours were measured on 1.5.1. That is the argument for the sentinel in one line.
feitreim
added a commit
that referenced
this pull request
Jul 29, 2026
#118) * Route CI through scripts/modal-run, so the two guards cover the checks `cuda.yml` and `gpu.yml` called `modal run` directly, so #99's wedge watchdog and #115's completion sentinel protected only runs a human started by hand. Every performance number in this repo's recent history came through green checks on the unguarded path. The three jobs now call `scripts/modal-run` as the only command in their step, so its exit code is the step's: 2 (spend limit), 3 (a wedge it stopped) and 4 (a run that ended without finishing) are each red, and nothing remaps them. The wrapper also annotates those three when GITHUB_ACTIONS is set. They share a property that makes them worth naming on the check rather than burying in a log: none of them is the entry point failing, and all of them read from the check list like a broken diff. The spend limit most of all -- it fails every entry point at once, in seconds. No retry. The graces keep their defaults. They budget *silence*, not elapsed time -- every client line resets the clock -- so a cold start costs wall time without consuming one. `build` is 155-221 s warm and ~7.5 min cold (#99), and all of that cold build is after Python is alive, printing `Compiling`, under the 1200 s silence budget; 300 s of startup silence is sized against the failure itself, a container that said nothing for twenty-six minutes. CI.md moves the wrapper out from under "running it by hand" -- it is now how every Modal invocation here happens -- and tiers 2 and 3 say the guard covers them. * CI.md: the graces, justified from the runner's own timestamps The first run of this branch: build reaches its first `$ ` line 6.5 s in having never been silent for more than 3.1 s, against a 300 s startup budget; the longest quiet stretch anywhere in either job is 58.9 s of sm_100a codegen against 1200 s. And in tier 2 the silence budget cannot bind at all -- the entry point's own timeout=900 is shorter. Tier 3 is where a tighter value would buy something and is the tier with no measurement here, so it keeps #99's. Also: CI installs modal unpinned and drew 1.5.3, where #103's three exit-code behaviours were measured on 1.5.1. That is the argument for the sentinel in one line. * CI.md: the device_tests numbers, and what the graces actually cover A dispatched gpu.yml run on this branch: first alive line at +9.2 s after 4.4 s of silence, sentinel at +95 s, 97 s in the step. With that, all three entry points CI invokes are measured, and the shape is clear -- SILENCE_GRACE (1200) is at or above each one's own timeout= (900/900/1200), so it dead-heats with Modal's clock and STARTUP_GRACE is what covers the failure timeout= cannot see. A lower silence budget is what these numbers argue for; not on one warm sample each.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A B200 container wedged today and held the GPU for twenty-six minutes having
compiled nothing — fifteen lines of NVIDIA banner and no
$ <command>line,which means it never reached Python. From the outside it was indistinguishable
from a cold build, and it was found by hand.
Two things were wrong, and they need different fixes.
1. The ceiling was ninety minutes and nobody chose it
Every GPU entry point carried
timeout=5400, uniform across six functions doingvery different amounts of work.
build,regcountCHECKINGdevice_tests,examplesRUNNINGbench,clc_bench,ladder_bench,profileSWEEPINGdoctorASKINGThe names carry the reasoning so the next person to add an entry point picks a
budget by saying what kind of work it is.
These are still partly estimates and the PR says so.
buildis measured;the GPU durations are not, because nothing was recording them. So
_runnowprints elapsed seconds per command — on the failure path too, since a step that
ran for nineteen of a twenty-minute budget and a step that died on contact are
different diagnoses and the exception alone does not tell them apart. The next
round tightens these from the log rather than from another guess.
2.
timeout=is a ceiling on the function, not on reaching the functionThis is the actual failure and the tighter timeouts only half-cover it. The
container printed the image banner and stopped.
_run's first act is aprint, and that print never happened — so no guard insidemodal_app.pycould ever have fired. A
subprocess.run(timeout=…), a stall detector in_run: none of it runs. The guard has to live in the only process still awake,which is the client.
scripts/modal-runis that guard.It watches for the tell — a healthy run emits our
$ <command>or aCompiling …line within a few minutes of the banner — and distinguishes twohangs, because they mean different things:
STARTUP_GRACE, 300 s) — the observed failureSILENCE_GRACE, 1200 s) — set well above anyreal gap between lines, since
benchis legitimately quiet across a 16384³sweep
On either it kills the client and
modal app stops the app, because killingthe client does not reliably stop the container and the container is the thing
being billed. Exit 3. It also exits 2 on the workspace spend limit, which fails
every entry point at once in about fifteen seconds and reads exactly like a
broken diff — that has cost real diagnosis time before.
The guard was watched failing, on all four paths
Both graces are env-overridable so this was possible at all; a check nobody
has seen fire is not a check (#67, #76, #95). Against a stub that reproduces the
observed failure:
Control 4 matters as much as the other three: a watchdog that swallows the
run's own exit code would turn every real failure green.
What is not established
Whether Modal's
timeout=clock covers container startup at all. If itdoes, the wedged run would have died at 15 minutes under the new budget instead
of 26 under the old. If it does not, only
scripts/modal-runcatches this classand the timeouts are purely about in-function hangs. I did not find a way to
settle it without deliberately wedging a container, which costs the thing this
PR exists to stop. Both changes are worth having either way, and the next
observed stall answers it for free — if a run dies at exactly
RUNNING, theclock covers startup.
Scope
modal_app.py: four named budgets replacing nine literals, elapsed logging in_run.scripts/modal-run: new, ~110 lines.CI.md: the tell, the wrapper, and the two exit codes, under §"Running it byhand".
No Rust changed, so tier 3 has nothing to say about this one.