Harden dynamic inference request lifecycle handling - #7256
Open
lmcafee-nvidia wants to merge 17 commits into
Open
Harden dynamic inference request lifecycle handling#7256lmcafee-nvidia wants to merge 17 commits into
lmcafee-nvidia wants to merge 17 commits into
Conversation
Source review: #47 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #48 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #49 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #51 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #52 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #53 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #54 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #55 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #56 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #57 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #58 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Source review: #59 Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Exclude the UVM and offload row that depended on closed fork PR #40, remove its inherited fixture assumptions, and classify request fields supplied by landed prerequisite aggregates. Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Route paused-event configuration through the current explicit test field and exercise the coordinator multipart reply and shared text-finalization interfaces. Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
tdene
approved these changes
Sep 11, 2026
tdene
left a comment
Contributor
There was a problem hiding this comment.
I closely reviewed each of the individual PRs, and they were all good. Approved.
Contributor
|
/ok to test 9df76ec |
shanmugamr1992
approved these changes
Sep 11, 2026
kvareddy
approved these changes
Sep 12, 2026
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.
What does this PR do?
This PR hardens dynamic inference across request admission, checkpoints, pause and resume, recompute, completion, and result construction. It preserves request identity and state, bounds prompt memory residency, aligns token metadata, and returns failures and completed text through consistent ownership boundaries.
It combines the active request-lifecycle split review records:
Example failure scenario(s)
Scenario 1 (Hidden prompt remains in a result)
Scenario 2 (Serialization damages the live request)
Scenario 3 (Checkpoint loses request settings)
Scenario 4 (Checkpoint history retains GPU memory)
Scenario 5 (Checkpoint boundary changes decoded text)
Scenario 6 (Reset strands a coordinator waiter)
Scenario 7 (Reset mutates suspended storage)
Scenario 8 (Omitted sampling settings fail admission)
Scenario 9 (Duplicate ID mutates state)
Scenario 10 (An all-invalid call returns nothing)
Scenario 11 (One caller consumes another caller's failure)
Scenario 12 (A coordinator failure remains after reply)
Scenario 13 (Paused ID has the wrong shape)
[[2]]instead of ID2.Scenario 14 (Resume removes the wrong pause)
Scenario 15 (Recompute changes request order)
Scenario 16 (Partial prompt scores are counted twice)
Scenario 17 (Completed prompt scores are erased)
Scenario 18 (A stop sequence crosses a checkpoint)
Scenario 19 (Speculation passes the first stop)
Scenario 20 (A stripped step has no score to read)
Scenario 21 (Partial prefill scores the wrong token)
Scenario 22 (Skipped prompt scores leave a hidden row)
How was this bug discovered?
The campaign compared uninterrupted requests with requests interrupted at lifecycle boundaries and checked exact tokens, text, scores, state, identities, memory residency, and completion ownership.
Dependency and scope
This branch has merge base
2371e9022a3d2a046d9b70efa17efa8874b7e9a7with upstreammain. The 11 production-fix deltas from fork/47–49 and fork/51–58 were replayed as signed commits in dependency order, and fork/59 contributes test-only coverage. Current-main reconciliation commits only adapt tests and add no production behavior.a1541f0b283798b6ef80c69684260fae202909f32e3d163c29d2e9cadde5f23243521e4986999bc8459bcc30f01a1e762bf31cf5e435a78662533794f666c70e905f411300b929d7913e3567c7013228b904d94f01eb4afa8c0fa4aa11628af78c857f994a68479db6d5c20c4ebdf8f60fcf7ca664c004b310238201b2f30b3782cb8f8e2fcf1a5cce26a99c7df61bd86d74847f769eeed7429583463f4ca58f7024cdb8adb8000cc9da19343b9f18b22ba54ad58e21607ced43a2ee46827d7e1f17743d8d359b60f38fce45358a561e748cf4174b4af7feef20709c29bb8f9f7e81106ed4c15924dca0889e54b5b0ffThe fork PRs remain the detailed review records; this PR is their upstream landing path, so the same changes should not later be landed from both places. Fork PR #50 is intentionally excluded because NVIDIA/Megatron-LM #7063 owns and supersedes that behavior.
The aggregate also excludes the closed fork/40 CUDA-graph prerequisite and #59's unsupported UVM+OFFLOAD row. The two supported #59 runtime rows remain, and its exhaustive policy manifest includes fields supplied by prerequisite work already merged through #7031 and #7053. These current-main reconciliations are test-only.
The change adds no functional-test files. Its unit-test delta is 2,339 additions and 340 removals, or 1,999 net lines, within the campaign's 2,000-line budget.
Validation
git diff --checkpassed against current upstreammain.py_compilepassed for the changed Python surface.9df76ecadb6f5108e7bfdce47e93b04c60422db0.main; they are a pre-existingmainissue outside this change.