Repository navigation
fix(inference): skip empty KV pulls for fully cached handoffs - #7838
Closed
adenzhou1350 wants to merge 1 commit into
Closed
adenzhou1350 wants to merge 1 commit into
adenzhou1350 wants to merge 1 commit into
Conversation
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
3 of 5 tasks
Author
|
Current main already resolves this through the disaggregated-inference update in #6675 (09462ef). The pull path now calls begin_pull_blocks only when imported_blocks is nonempty, independently starts SSM imports, and the new push path similarly prepares KV transfers only for nonempty imports. Main also includes test_fully_cached_handoff_skips_kv_but_imports_ssm, covering pull/push and hybrid/non-hybrid modes with PP metadata. It asserts no KV transfer call for a fully cached prefix and verifies the independent SSM transfer. The regression and production behavior this PR aimed to add are therefore covered by current main. Closing as superseded, retaining the original branch/history; no new NIXL or distributed/GPU validation is claimed. |
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?
Skip an empty KV pull when decode reuses every prompt KV block, while still starting the independent SSM import.
_try_start_kv_handoff_import()currently submitsbegin_pull_blocks()even when the uncached KV suffix is empty. For the PP-metadata path reported in #7837, this can fail before_start_ssm_handoff_import()runs. Guarding the KV submission withimported_blocksleaves its handle asNone; existing pending-handle collection already filtersNone, and SSM transfer startup is unchanged.The regression covers no/partial/full prefix hits, with and without SSM, and flat/PP metadata. It checks continuation-block ownership and that nonempty suffix transfers still happen.
Issue tracking
For PRs from open-source community contributors:
Linked issue: Fixes #7837
Contribution process
Pre-checks
jit_fuser/torch.compile, CUDA extension, TE or external-library dispatch, or a scatter/index accumulation), I have added or updated its bit-exact determinism test and registered it intests/unit_tests/determinism/kernels/manifest.py(guide)Verification scope
AI-assisted implementation. CPU source-component checks using the actual method/helper bodies and regression test pass all 12 combinations after the change; the baseline fails the four full-cache combinations. Transfer agents are mocked, and the component loader substitutes the unused
SamplingParamsconstructor. This is not a native NIXL or distributed-suite pass.Full test collection with CUDA hidden is blocked by the existing import chain reaching
ssm/ops/gdp/common.py, which queries device 0. No GB200/NIXL model run or performance result is claimed. Python syntax andgit diff --checkpass. The Linux autoformatter and official distributed test remain pending.Suggested targeted CI command:
Kept as Draft pending author review and CI, as required by this repository. This changes handoff control flow, not a numerical kernel.
Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.