[None][fix] Migrate stale event-manager test calls to ReuseScope API - #14445
Merged
lancelly merged 1 commit intoMay 22, 2026
Merged
Conversation
Follow-up to NVIDIA#14353. A few CUDA-gated tests in test_kv_cache_event_manager.py were not exercised in pre-merge CI and kept using the legacy APIs that the ReuseScope refactor removed: - _commit_and_close() forwarded a cache_salt_id= kwarg to KVCacheManager.create_kv_cache, which now takes reuse_scope=. - test_v2_v1_hash_events_include_cache_salt_from_kv_cache passed cache_salt_id=123 to _commit_and_close. - test_v2_stored_events_match_block_hash_chain and test_v2_reused_prefix_does_not_emit_duplicate_stored_events still computed root_key via RootBlock.make_key(None); make_key now takes a ReuseScope. Migrate every call site to the new API (reuse_scope=ReuseScope(...) and RootBlock.make_key(ReuseScope())). _FakeRootBlock keeps its dual-shape constructor on purpose — the V1-compat regression test exercises both shapes. Addresses reviewer feedback on NVIDIA#14353 (peihu-nv). Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
Collaborator
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #49877 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #49877 [ run ] completed with state |
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 10, 2026
…VIDIA#14445) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 11, 2026
…VIDIA#14445) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 12, 2026
…VIDIA#14445) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
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
Follow-up to #14353. The ReuseScope refactor (cp #14140) renamed
KVCacheManager.create_kv_cache(cache_salt_id=)→reuse_scope=andchanged
RootBlock.make_key(None)to take aReuseScope. A fewCUDA-gated tests in
tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_event_manager.pyweren't exercised in pre-merge CI and kept using the legacy shapes;
this PR migrates them.
Call sites updated:
_commit_and_closehelper:cache_salt_id=kwarg →reuse_scope=, forwarded tocreate_kv_cache(reuse_scope=...).test_v2_v1_hash_events_include_cache_salt_from_kv_cache:cache_salt_id=123→reuse_scope=ReuseScope(salt=123).test_v2_stored_events_match_block_hash_chainandtest_v2_reused_prefix_does_not_emit_duplicate_stored_events:RootBlock.make_key(None)→RootBlock.make_key(ReuseScope())._FakeRootBlock's dual-shape constructor is intentionally untouched —test_v2_kv_cache_event_manager_v1_hash_reads_root_reuse_scopeexercises both the new
reuse_scopeshape and the legacy flat(lora_task_id, cache_salt_id)shape on purpose to regression-test theV1-compat hash code in
KVCacheEventManager._root_attrs_from_root_block.