Repository navigation
Conversation
added 6 commits
October 20, 2026 07:39
Validate scheduled token destinations, allocation generations, ownership, logical block order and initialized prefixes for adapted dense PA/MLA paths. Reuse the scheduler output channel and common V1/V2 checker runtime. Audit ordered eager arguments and current FULL metadata without redundant graph callbacks. Track completed physical zero/copy and Mooncake receive lifecycle boundaries, with bounded diagnostics and optional failure latching. Integrate with current upstream main d606456, retaining its strided MLA, dummy replay and background receive contracts. Include focused CPU cases, a service regression entry point, user documentation and a release fragment. Present the already-reviewed complete patch as one linear commit so CI's plain git rebase does not replay obsolete intermediate implementations. Validation: 98 focused CPU tests and repository-pinned Ruff check/format pass. NPU service and performance validation remain deferred at user request. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Configure per-engine KV address diagnostics and failure actions through additional_config.kv_guard_config instead of environment variables. Gate scheduler hooks per instance and share runner installation and execution state across V1 and V2, retaining only the V2-specific adapter. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Track external-load logical ranges and generations through receive completion, preserve unaffected prefixes on failure, and safely drain cancelled submissions. Freeze step metadata and overlap copies with ordinary single-worker async generation. Validate before output release or the next forward, retaining every step's checks. Other layouts keep synchronous validation. Add lifecycle, async audit and scope regressions; document the behavior. Validated on 179 with 192 focused Linux tests, four receiver contracts and V1/V2 eager/FULL normal and injected-fault cases. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Merge upstream main 20aa1cd. Preserve KV guard integration through the V1 directory relocation and the current V2 runner. The guard checker, runtime and scheduler wrappers are unchanged. The merged tree passes 192 focused Guard tests and four receiver completion contract tests with the new verified vLLM source 24420b7a341af37a9bc3186e6fc6062512e0aa58. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Signed-off-by: TAJh <taojiaheng1@huawei.com>
Keep the cache-group metadata audit while removing scheduler, allocator, connector and result-method patches. Bind expected addresses from standard SchedulerOutput and call the guard from native Ascend runner boundaries. Limit scope to metadata-plan consistency and complete audits synchronously. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Tjh-UKN
changed the base branch from
codex/kv-block-trace-design
to
review/upstream-main-20261107
November 7, 2026 10:44
Remove the V1 runner integration and compatibility fallbacks. Require explicit V2 batch identities and model state, reject enabled guard configuration with V1, and restrict the service regression and documentation to V2. Signed-off-by: TAJh <taojiaheng1@huawei.com>
Tjh-UKN
force-pushed
the
codex/kv-guard-no-patch-latest-17833
branch
from
November 10, 2026 07:33
f417980 to
02ddd24
Compare
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.
关联 RFC: msprobe #680
What this PR does / why we need it?
Add opt-in Runner V2 KV address-plan checks using standard
SchedulerOutputbindings. Each engine keeps an independent request/block mirror and checks final attention metadata once per cache group. No Scheduler, allocator, V1 Runner or attention-operator monkeypatch is added.The review base remains the upstream-main snapshot
28e9e97ba254b076a88275e8a275556cb9a11664. The feature is adapted from #17833.Enable with
VLLM_USE_V2_MODEL_RUNNER=1and--additional-config '{"kv_guard_config":{"enabled":true,"action":"raise"}}'.The adapters distinguish connector-admitted local bindings, speculative scheduler budgets and independent worker frontiers, decoder self/cross caches, and DCP/PCP rank-local address plans. Remote KV bytes, speculative acceptance policy and model numerical correctness are outside the address-plan contract. DBO is no longer rejected by configuration name, but this backend revision itself disables DBO; actual DBO execution is not claimed.
This follow-up also fixes the observed native PCP decode crash: an empty rank completes peer KV gathering/cache writes, then clears its output inside the existing transfer window and skips local attention. Active graph capture and DCP overrides retain their existing paths. This is a native backend fix, in a separate commit, rather than operator instrumentation.
The audit constructs large prefill slot plans with block runs, bypasses unnecessary flattening for flat slots, and reuses pinned storage while preserving the direct-copy fast path for repeated shapes. Copies must still complete before reuse, and violations still block output in raise mode.
How was this patch tested?
bash format.sh ciwas attempted but failed on missing/bin/bash,python3and shellcheck; this is not a full CI pass.24420b7a341af37a9bc3186e6fc6062512e0aa58. The Catlass gitlink is recorded as a pointer; its checkout contents are not validated.d7b467de972e; all 906 runtime files and core/native maps are byte-identical at finalf417980e0d42, whose only added file is the C8 test. The complete PCP bundle contains 90 hashed files.0a79437ac059versus finalf417980e0d42, 40 hot samples per scenario: C1 prefill CPU audit median 1,501.77→364.59 µs; mixed C8 1,563.83→410.91 µs. C8 decode snapshot 260.28→257.43 µs. Alternating prefill/decode shapes no longer allocate pinned buffers on each switch. Copy counts/bytes match. These are metadata-only timings, not end-to-end TTFT or throughput results.Final-head performance on 179: one Ascend 910B4, Llama-3.1-8B-Instruct BF16, FULL, 2,048 input/256 output tokens, block128, prefix cache off, chunked prefill on. OFF→ON→ON→OFF at C1/C8: eight trials, 220 requests; each trial exceeds 60 seconds. Both ON servers must report deferred audit. Server CPU0–15/client16–23; external resource sampling, no model hooks or profiler.
C1 paired throughput-drop range: +0.015% to +0.042%.
C8 paired throughput-drop range: +0.044% to +0.375%.
Each switch/concurrency has two repetitions; these observed ranges are not confidence intervals. Positive drop means ON is slower. The host is shared; RSS can double-count shared pages, and HBM snapshots are not peak memory.
Raw HTTP complete-text differences against the first OFF arm (ON1, ON2, OFF2): C1 [0, 0, 0]; C8 [8, 6, 5]. This HTTP benchmark does not fix admission/prefill plans and does not establish complete-text equivalence for this workload. The separate native regression fixes those plans and compares actual token IDs.
All C8 complete-text differences are confined to the initial eight requests; the remaining 40 responses match across all four arms.
Strict source/array verification passed with zero errors; 124 performance evidence files were hashed, including source bytes before/after, input/output lengths, all actual SSE intervals, affinity/configuration, warmup outputs and NPU preflight receipts.
All four server logs retain an EngineDeadError stack after the last successful HTTP response and API shutdown/SIGTERM. These teardown errors are preserved separately; the logs are not described as entirely error-free. No business-stage traceback, guard violation or coverage gap was observed.
Earlier adapter checks at
0a79437ac059covered ordinary eager, asynchronous NGram (21 drafts/18 accepted/3 rejected per arm), genuine Mooncake transfer (257 external tokens/three remote blocks/read completion/ACK), random small Whisper offline engines, and a valid random MQA DCP2 service. These are earlier-head functional evidence, not new-head performance or production-model accuracy claims. The DCP2 run did not request output token IDs. Production encoder/decoder and MLA models, additional speculative proposers, DBO execution and unrecorded combinations remain unvalidated.