Skip to content

[https://nvbugs/6405665][test] Disable block reuse for KV cache comparison#15917

Open
jiaganc wants to merge 1 commit into
NVIDIA:mainfrom
jiaganc:codex/disable-kv-v2-reuse-test-waiver
Open

[https://nvbugs/6405665][test] Disable block reuse for KV cache comparison#15917
jiaganc wants to merge 1 commit into
NVIDIA:mainfrom
jiaganc:codex/disable-kv-v2-reuse-test-waiver

Conversation

@jiaganc

@jiaganc jiaganc commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Tests

    • Updated an integration test comparison to handle cache behavior more consistently during chunked prefill scenarios.
    • Adjusted test settings so both paths use the same prompt-token calculation, improving the reliability of comparison results.
  • Chores

    • Removed an outdated test waiver entry.

Description

Disable block reuse for TestKVCacheV2Llama::test_chunked_prefill_multi_request and remove its NVBug 6405665 waiver.

V1 and V2 use different source-block commit policies: V1 commits only full blocks, while V2 can commit a partial source block. For this test's short prompts, V2 can therefore reuse a partial prefix that V1 cannot, causing the strict output comparison to exercise different prompt-computation paths and produce numerically different greedy output. Disabling block reuse keeps the test focused on V1-versus-V2 scheduler correctness with equivalent prompt computation.

Test Coverage

  • python3 -m py_compile tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py
  • pre-commit run --files tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py tests/integration/test_lists/waives.txt
  • git diff --check
  • B300 diagnosis confirmed the divergence is caused by V2 partial-prefix reuse and disappears when partial reuse is disabled. The waiver removal re-enables the target test in CI.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@jiaganc

jiaganc commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Wait for #15633 first.

…rison

Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
@jiaganc jiaganc force-pushed the codex/disable-kv-v2-reuse-test-waiver branch from 975f758 to d1d0a67 Compare July 3, 2026 15:34
@jiaganc jiaganc marked this pull request as ready for review July 3, 2026 15:46
@jiaganc jiaganc requested a review from lancelly July 3, 2026 15:46
@jiaganc

jiaganc commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 05ac4fed-a88e-48d9-9f42-4c678a71a639

📥 Commits

Reviewing files that changed from the base of the PR and between 0b65e4f and d1d0a67.

📒 Files selected for processing (2)
  • tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

📝 Walkthrough

Walkthrough

A test for chunked prefill multi-request scenarios was updated to disable block reuse when comparing V1 and V2 KV cache managers, ensuring consistent prompt token computation. The corresponding skip waiver for this test was removed from the waives list.

Changes

KV Cache V2 Scheduler Test Fix

Layer / File(s) Summary
Disable block reuse and remove test waiver
tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py, tests/integration/test_lists/waives.txt
The chunked prefill multi-request test now passes kv_extra={"enable_block_reuse": False} to the V1/V2 comparison helper with added explanatory comments, and the previously associated SKIP waiver entry for this test is removed from the waives list.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: yiqingy0, Superjomn

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: disabling block reuse for the KV cache comparison test.
Description check ✅ Passed The description includes the issue, solution, test coverage, and checklist, and is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57487 [ run ] triggered by Bot. Commit: d1d0a67 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57487 [ run ] completed with state SUCCESS. Commit: d1d0a67
/LLM/main/L0_MergeRequest_PR pipeline #46220 completed with status: 'SUCCESS'

CI Report

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants