Repository navigation
[Workflow] Raise modal CI timeouts to absorb slower sandbox provisioning - #8403
Conversation
The modal-torch-latest GPU job is killed at its 75-minute cap before the test suite finishes. On master this now happens in roughly half the runs. The suite is not what grew. Phase timings taken from the job logs show the regression is confined to Modal sandbox provisioning, which went from about 0.1 min in late August to 18-22 min from 2026-08-31 onward, while pytest itself stayed in its usual 38-49 min band for a near-identical test count: run provisioning env setup pytest tests 08-22 12:53 0.1m 6.0m 37.5m 1150 passed 08-29 00:40 0.2m 6.2m 39.3m 1194 passed 09-01 11:47 17.8m 6.6m 48.4m 1241 passed 09-02 04:00 22.0m 4.8m 38.5m 1241 passed Raise the outer GitHub job budget to 90 minutes. Raise the inner Modal sandbox lifetime to 70 minutes as well: its clock starts when the container starts, so it has to cover env setup plus pytest, which has already been observed at 55 min, leaving only 5 minutes of headroom against the old 3600s value. This only buys back the margin the provisioning regression consumed. The regression itself still needs investigation on the Modal side. Signed-off-by: Ma, Guokai <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7cf05bc92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| name: modal-torch-latest / DeepSpeedAI CI | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 75 | ||
| timeout-minutes: 90 |
There was a problem hiding this comment.
Add the required Signed-off-by trailer
This is a single-parent, non-merge commit, but its commit message has no Signed-off-by: trailer. Add the author’s configured name and email using git commit --signoff so the commit satisfies the repository’s mandatory DCO requirement.
AGENTS.md reference: AGENTS.md:L6-L8
Useful? React with 👍 / 👎.
…ai#8404) Stacked on deepspeedai#8403 — review that one first; this PR's base retargets to `master` automatically once it merges. ## Problem A single wall-clock budget cannot tell **"we never got a GPU"** apart from **"the tests ran long"**. Both surface as the same job timeout today, and a run that spends 22 minutes waiting for capacity takes that time out of the budget the tests still need. Measured on completed master runs, the wait between `Sandbox.create()` and the first sandbox output: | run | acquisition wait | pytest | |---|---|---| | 08-22 12:53 | 0.1m | 37.5m | | 08-29 00:40 | 0.2m | 39.3m | | 08-31 08:45 | 7.9m | 48.8m | | 08-31 14:11 | 10.8m | 44.5m | | 08-31 17:36 | 0.9m | 38.4m | | 09-01 11:47 | 17.8m | 48.4m | | 09-02 04:00 | 22.0m | 38.5m | `Sandbox.create()` returns before the container exists, so the wait for the `l40s:2` reservation surfaces on the first `exec`. ## Change Bound the two phases separately: - **acquisition: 30 min** (`SANDBOX_ACQUIRE_TIMEOUT_SECONDS`). Past that the run aborts with `SandboxStartTimeout`, whose message states that no test ran, instead of holding a runner for the rest of the budget. - **tests: 70 min**, unchanged from deepspeedai#8403. The Sandbox lifetime clock starts when the container starts, so this budget is always fully available once a GPU is reserved, however long acquisition took. - **job timeout: 105 min**, now only a backstop covering 30 + 70 plus runner setup and cleanup. 30 min leaves headroom over the worst observed acquisition (22.0 min) while still failing fast when capacity never arrives. ## Observability The startup duration is printed with `flush=True`. Sandbox output is otherwise block-buffered by Python and lost when the job is killed, which is why the timed-out runs show a silent gap rather than any progress. This makes the acquisition wait directly visible in the log instead of something you have to reconstruct from timestamps. ## Tests `ci/test_torch_latest.py` gains coverage for the abort path: - `test_await_sandbox_start_gives_up_when_the_container_never_runs` — catches a controller that blocks forever on a reservation that is never satisfied. - `test_controller_aborts_without_running_tests_when_sandbox_never_starts` — catches a controller that spends the whole budget waiting, runs commands against a Sandbox that never started, or leaks the Sandbox when startup times out. - `test_await_sandbox_start_reports_startup_duration` Verified by mutation: with the `is_alive()` check removed, the suite hangs instead of failing, which is the exact defect these tests guard against. The acquisition budget is also pinned in `test_sandbox_kwargs_are_fixed_and_secret_free`, so changing a resource limit stays visible in review like the other fixed Sandbox parameters. ## Not addressed here Why acquisition grew from ~0.1 min to 18-22 min. Ruled out from the repo side (image name, preset table, pinned `modal==1.2.6`, sandbox kwargs all unchanged); confirming whether it is GPU queueing or an image pull needs the Modal dashboard for app `deepspeedai-torch-latest-ci`. This PR makes that case fail fast and legibly rather than fixing it. --------- Signed-off-by: Ma, Guokai <[email protected]>
The
modal-torch-latestGPU job is killed at its 75-minute cap before the suite finishes. On master this now happens in roughly half the runs (e.g. runs33622520807,33600515110,33533630019,33526004564), each annotated by GitHub withThe job has exceeded the maximum execution time of 1h15m0s.The test suite is not what grew. Phase timings extracted from the job logs:
pytest stayed in its usual 38-49 min band for a near-identical test count (1150 -> 1241, +8%). The entire regression is in Modal sandbox provisioning: ~0.1 min -> 18-22 min since 2026-08-31.
What this PR changes
This only restores the margin that regression consumed:
The sandbox clock starts when the container starts, so it has to cover env setup plus pytest, which has already been observed at 55 min - only 5 minutes of headroom under the old 3600s value. Both limits are raised together so the inner one does not become the new binding constraint.
ci/test_torch_latest.pypins both values as a guard against unreviewed changes to the CI configuration, so the two assertions are updated in the same commit.Note: the provisioning regression is not addressed here
It still needs investigation on the Modal side. Ruled out from the repo side:
pytorch/pytorch:2.10.0-cuda12.8-cudnn9-devel, preset table untouched since Add configurable torch-latest dependency versions #8016 (2026-05-19)modal==1.2.6The modal client prints no build output during the wait, which points at scheduling/capacity for
l40s:2rather than an image pull. Concurrency of our own runs does not correlate (2 concurrent -> 0.9 min, 1 concurrent -> 17.8 min). Confirming this requires the Modal dashboard for appdeepspeedai-torch-latest-ci.If provisioning keeps growing, 90 minutes will be consumed the same way, so the underlying cause is worth tracking separately.