Repository navigation
test(train): Bound capacity wait in SMTJ SFT integ test - #6409
Merged
lucasjia-aws merged 1 commit intoOct 9, 2026
Merged
Conversation
test_sft_trainer_serverful_smtj trains on one ml.g6.12xlarge in us-east-1. When there is no capacity the job stays in Pending, and the test polled for up to 3 hours, which held the GPU integ build until CodeBuild timed out. The job was then left queued behind the killed build and trained hours later with nobody waiting for it. Poll with the shared bounded capacity wait from tests/integ/capacity.py: after 90 minutes in Pending the job is stopped and the test is skipped, and the job is stopped whenever the wait ends with it still running. The total wait is 2 hours, covering the capacity wait plus the job's ~21 minute run time, so the test stays well inside the build timeout.
lucasjia-aws
temporarily deployed
to
auto-approve
October 9, 2026 22:21 — with
GitHub Actions
Inactive
lucasjia-aws
temporarily deployed
to
auto-approve
October 9, 2026 22:21 — with
GitHub Actions
Inactive
lucasjia-aws
temporarily deployed
to
auto-approve
October 9, 2026 22:21 — with
GitHub Actions
Inactive
There was a problem hiding this comment.
🤖 AI code review
This PR replaces a hand-rolled 3-hour poll loop in the SMTJ SFT integ test with the shared wait_for_training_job_with_capacity_timeout helper, bounding the capacity wait to 90 min and total wait to 2 h, stopping orphaned jobs and skipping on capacity shortage. I verified the helper's signature matches the call, the ..capacity import path resolves correctly, time is still used (for unique_id), and secondary_status/failure_reason exist on the TrainingJob shape. The change is correct and well-scoped; no issues found.
Reviewed commit 1d68380. Automated review; verify before acting.
mohamedzeidan2021
approved these changes
Oct 9, 2026
This branch was previously deployed
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.
Summary
test_sft_trainer_serverful_smtjsubmits an SFT job on oneml.g6.12xlargein us-east-1 and polled for up to 3 hours. When there is no capacity the job stays inPending("Preparing the instances for training") and does not fail, so the test held the CI Health V3 GPU integ build until CodeBuild hit its 180-minute timeout. The queued job was then left behind and trained later with nobody waiting for it (for example, on 2026-10-08 the job was submitted at 07:22 UTC and only started training at 14:08 UTC, long after the build was killed).Across the 169 SMTJ jobs this test created since 2026-07-20, the wait for an instance was under 60 minutes for 38% of jobs, under 90 minutes for 47%, and under 180 minutes for 58%; once an instance is acquired, download, training and upload take at most ~21 minutes.
Changes
wait_for_training_job_with_capacity_timeoutfromtests/integ/capacity.py(the shared helper introduced in test(train): Bound capacity wait in gated JumpStart train test #6397 and used by the Nova serverless tests).ml.g6.12xlarge capacity unavailable. The job is also stopped whenever the wait ends with it still running (timeout, error, interrupt), so no orphaned job is left queueing.failure_reason.Testing
black --check(26.3.1) andflake8(7.1.2) pass on the changed file.pytest --collect-only -m "gpu_intensive and us_east_1"collects the test.Notes
ml.g5.12xlarge), which is out of scope here.