Conversation
Locate failed external-load blocks with each cache group's physical geometry. Truncate requests at the earliest common safe boundary and evict downstream blocks from every affected group. The request exposes one cross-group computed-token count, so recovery rounds the earliest invalid position down to the scheduler block LCM. This can recompute a short tail for unitary layouts but prevents hybrid groups from resuming at incompatible boundaries. Co-authored-by: andyluo7 <andy.luo@amd.com> Signed-off-by: Yichao Zhu <Yichao.Zhu@amd.com>
YukioZzz
requested review from
ApostaC,
WoosukKwon,
alexm-redhat,
heheda12345,
ivanium,
njhill,
orozery,
robertgshaw2-redhat and
ywang96
as code owners
September 1, 2026 08:35
Signed-off-by: Yichao Zhu <Yichao.Zhu@amd.com>
Signed-off-by: Yichao Zhu <Yichao.Zhu@amd.com>
Expose group block sizes and the null block id through KVCacheManager so scheduler load-failure recovery does not reach through the block pool and coordinator internals directly. Signed-off-by: Yichao Zhu <Yichao.Zhu@amd.com>
Clarify that load-failure recovery rolls back to a scheduler-block boundary, reuse the request id local, and make the hybrid geometry unit test derive its token counts from named block-size constants. Signed-off-by: Yichao Zhu <Yichao.Zhu@amd.com>
Contributor
Author
4 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
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
Recover failed external KV loads for hybrid cache groups without assuming a single block table geometry.
This fixes the scheduler-side path that handles KV load failures. Hybrid models can have multiple cache groups with different physical block sizes, so recovery must inspect each group independently and roll the request back to the earliest common scheduler-safe boundary.
Relation To #53917
This PR is split out from the original full-stack #53917. The end-to-end Kimi-K3 SimpleCPU validation was run on the original #53917 final stack, but this PR is not on the normal AgentX/aiperf hit path. It only covers scheduler fallback behavior after an external KV load reports invalid blocks.
Why
The existing path still has a single-group assumption around failed block IDs. When an external load fails for a hybrid cache layout, the recovery path can crash or truncate the wrong state instead of safely recomputing from a valid boundary.
This is not SimpleCPU-specific; it applies to any KV connector that can report failed external loads for a hybrid model.
Correctness Notes
The scheduler receives a single
num_computed_tokensvalue per request, so rollback must land on a common boundary that every KV cache group can represent. This PR scans each group's block table using the resolved manager block size, then rolls back to the earliest invalid token position rounded down to the scheduler block size.If multiple requests share the same invalid block, only the first request marks that block for recomputation. Later requests that only reference already-marked invalid blocks roll back to their cached scheduler-block boundary, preserving the previous shared-block behavior.
The scheduler reads
KVCacheManager.group_block_sizesandKVCacheManager.null_block_idinstead of reaching into the coordinator and block pool internals directly. Null blocks are ignored during invalid-block matching and downstream eviction because the Mamba align block table can contain the shared null-block sentinel.Validation
The same real
FullAttention + Mamba alignfailure-recovery test was run on the base and this PR. It uses scheduler-allocated hybrid block tables and injects an async load failure for a Mamba state block.Latest head:
The recovery scan also ignores the Mamba null-block sentinel, and the focused hybrid eviction test verifies that downstream blocks are collected from every cache group after rollback.