[https://nvbugs/6418912][test] Fix KV cache reuse accounting tests - #16012
[https://nvbugs/6418912][test] Fix KV cache reuse accounting tests#16012chienchunhung wants to merge 2 commits into
Conversation
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
📝 WalkthroughWalkthroughTest expectations in kvCacheManagerTest.cpp are updated to reflect free-but-cached KV-cache reuse semantics: released blocks with no active references now contribute to estimatedReusableTokens instead of yielding zero, with corresponding comment updates across three test cases. ChangesKV-Cache Reuse Accounting Test Updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
SimengLiu-nv
left a comment
There was a problem hiding this comment.
The test changes looks good to me.
I suggest moving cpp/test_unit_tests.py::test_unit_tests[batch_manager-80] to pre_merge due to the active dev of kvcache manager and the importance of it.
Move the A30 batch_manager C++ shard out of post-merge and register a dedicated pre-merge stage so KV-cache changes are gated before landing. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
/bot run |
|
PR_Github #57866 [ run ] triggered by Bot. Commit: |
|
PR_Github #57866 [ run ] completed with state
|
| linux_distribution_name: ubuntu* | ||
| terms: | ||
| stage: post_merge | ||
| stage: pre_merge |
There was a problem hiding this comment.
It doesn't always sound good to me if we see a test failure in post-merge, then we just add the test to pre-merge. When everyone does this, the pre-merge pipeline will be bloat eventually.
Perhaps the question is that why existing CPP tests on A10 in pre-merge cannot cover the failure? The fix looks like testing-only changes.
There was a problem hiding this comment.
Hi @chzblych , kvcache cpp test is fundamental and important in my opinion. There are quite a lot of active development around kvcache. The whole suite does not take more than 15 mins to execute anyway. I strongly support putting it in the pre_merge stage.
There was a problem hiding this comment.
FYI this PR is subsumed by PR#16019, which is a superset of multiple fixes for the NVBUG.
I agree we should clearly define what tests should be included in pre-merge (run more frequently) vs. stay in post-merge (run more comprehensively) to strike the right balance between coverage and overhead. I will defer the decision to kv cache dev folks. cc: @thorjohnsen
Pull request was closed
Summary by CodeRabbit
Bug Fixes
Tests
Description
PR #15066 separated two reuse budgets: block-capacity accounting only discounts currently allocated reusable blocks, while
estimatedReusableTokenscredits every cached prefix block because those tokens do not need recomputation. Three existing tests still conflate those budgets and expect zero reusable tokens after the cached blocks are released.Update the assertions and comments to expect two recoverable cached blocks, or 32 tokens. Production behavior is unchanged.
Following reviewer feedback, move
cpp/test_unit_tests.py::test_unit_tests[batch_manager-80]from A30 post-merge coverage to a dedicatedA30-CPP-1pre-merge stage so active KV-cache development is gated before landing.This was exposed while validating NVBUG 6418912 / PR #15994, but is independent of the BufferIndexHolder fix.
Affected tests
KVCacheManagerReuseAccountingTest.CountReusableBlocksPartialMatchKVCacheManagerReuseAccountingTest.GetNeededBlocksOneStepWithFullReuseKVCacheManagerReuseAccountingTest.MultipleRequestsWithSharedPrefixTest Coverage
pre-commit run --files cpp/tests/unit_tests/batch_manager/kvCacheManagerTest.cpp jenkins/L0_Test.groovy tests/integration/test_lists/test-db/l0_a30.ymlscripts/check_test_list.py --validate: 2,217 unique entries validatedbatch_manager-80resolves exclusively toA30-CPP-1A30-CPP-1pipeline #46619 completed SUCCESS on integration head1248a186.FillKvCacheWithRequestsAndCompleteOneByOne/5case passed in 1,739 ms.Merge dependency
Because this PR activates
batch_manager-80in pre-merge, merge it after #15994, #16011, and #16037. Its earlier standalone pipeline #46561 lacked those fixes and is therefore not a valid final merge gate.