[None][feat] KV reuse probe - #14395
Conversation
|
/bot run --disable-fail-fast |
|
PR_Github #49639 [ run ] triggered by Bot. Commit: |
|
PR_Github #49639 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #49704 [ run ] triggered by Bot. Commit: |
|
PR_Github #49704 [ run ] completed with state |
12396e6 to
04a52f1
Compare
|
/bot run --disable-fail-fast |
1 similar comment
|
/bot run --disable-fail-fast |
|
PR_Github #49721 [ run ] triggered by Bot. Commit: |
|
PR_Github #49721 [ run ] completed with state |
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> (cherry picked from commit f9968c6) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
04a52f1 to
fb14a8f
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #49753 [ run ] triggered by Bot. Commit: |
peihu-nv
left a comment
There was a problem hiding this comment.
LGTM.
One follow up needed for full E2E is wiring the probe reuse to the existing probe_prefix_match_length(...) I think.
|
PR_Github #49753 [ run ] completed with state |
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com> Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Co-authored-by: Yao Yao <lowsfer@users.noreply.github.com>
Summary
Stacked on top of #14353. Adds the KV cache reuse probe API from #14333 by cherry-picking
f9968c6bd3onto thefeat/dsv4-refactor-and-probestack.Add KV cache reuse probe([None][feat] add KV cache reuse probe #14333,f9968c6bd3) — addsKVCacheManager.probe_reuse()plus theBlockRadixTree.match→ReuseMatchrefactor that splits the prune logic out of_KVCache._setup_for_reuse.Conflict resolution notes (
tensorrt_llm/runtime/kv_cache_manager_v2/_core/_kv_cache.py)#14333 was based on
main, which doesn't have DSv4's reuse-stats tracking. The cherry-pick conflicted in two regions; resolved as follows:_KVCache.__init__— keep_pending_stats = _PendingStats()and the post-setup_refresh_generation_alloc_ready()call, while adopting the newreuse_match: ReuseMatch | Noneparameter from [None][feat] add KV cache reuse probe #14333._setup_for_reuse— adopt [None][feat] add KV cache reuse probe #14333's lean shape (usematch.blocks/match.num_tokensfrom a pre-prunedReuseMatch), then re-insert the DSv4 stats tracking inside the per-life-cycle loop (full_reused_blocks,partial_reused_blocks,_pending_stats.record_reuse,mark_stats_dirty) usingnum_tokensinstead of the removedget_num_matched_tokens(matched)helper. Indexing was migrated frommatched[ordinal][0]tomatched[ordinal]sincematchedis nowlist[Block]._KVCache.__init__previously defaultedexpected_prompt_lengthfromlen(input_tokens). After [None][feat] add KV cache reuse probe #14333 removes theinput_tokensparameter, that fallback was moved up one level intoKVCacheManager.create_kv_cacheso the public-API behavior is preserved.