Skip to content

[None][fix] Migrate stale event-manager test calls to ReuseScope API - #14445

Merged
lancelly merged 1 commit into
NVIDIA:feat/deepseek_v4from
lancelly:fix/dsv4-event-test-stale-apis
May 22, 2026
Merged

[None][fix] Migrate stale event-manager test calls to ReuseScope API#14445
lancelly merged 1 commit into
NVIDIA:feat/deepseek_v4from
lancelly:fix/dsv4-event-test-stale-apis

Conversation

@lancelly

@lancelly lancelly commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #14353. The ReuseScope refactor (cp #14140) renamed
KVCacheManager.create_kv_cache(cache_salt_id=)reuse_scope= and
changed RootBlock.make_key(None) to take a ReuseScope. A few
CUDA-gated tests in tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_event_manager.py
weren't exercised in pre-merge CI and kept using the legacy shapes;
this PR migrates them.

Call sites updated:

  • _commit_and_close helper: cache_salt_id= kwarg → reuse_scope=, forwarded to create_kv_cache(reuse_scope=...).
  • test_v2_v1_hash_events_include_cache_salt_from_kv_cache: cache_salt_id=123reuse_scope=ReuseScope(salt=123).
  • test_v2_stored_events_match_block_hash_chain and test_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_scope
exercises both the new reuse_scope shape and the legacy flat
(lora_task_id, cache_salt_id) shape on purpose to regression-test the
V1-compat hash code in KVCacheEventManager._root_attrs_from_root_block.

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>
@lancelly

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49877 [ run ] triggered by Bot. Commit: b3d1889 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49877 [ run ] completed with state SUCCESS. Commit: b3d1889
/LLM/main/L0_MergeRequest_PR pipeline #39460 completed with status: 'SUCCESS'

CI Report

Link to invocation

@lancelly
lancelly merged commit ac51e1a into NVIDIA:feat/deepseek_v4 May 22, 2026
8 of 9 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants