Repository navigation
[None][fix] Import the model KV geometry spec under its own name in the Mamba manager tests - #22327
Conversation
…he Mamba manager tests Signed-off-by: Wanli Jiang <[email protected]>
|
/bot run --disable-fail-fast |
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
No actionable comments were generated in the recent review. WalkthroughThe test module aliases the model-config ChangesKV cache test
Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Other Merge Risk:
|
|
PR_Github #85140 [ run ] triggered by Bot. Commit: |
|
PR_Github #85140 [ run ] completed with state |
Dev Engineer Review
KVCacheLayerSpecfromtensorrt_llm._torch.model_configtoModelKVCacheLayerSpecin one test module. It does not change source code.KVCacheLayerSpecname. This removes the name collision that the PR reports caused Ruff F811 and a wrong spec construction in the Skip Softmax routing test.test_skip_softmax_hybrid_follows_the_dense_manager_routing. No public API or runtime behavior changes.QA Engineer Review
Test files changed:
tests/unittest/_torch/pyexecutor/kv_cache/test_mamba_cache_manager.py(modified, +2/-2)Test functions changed:
test_skip_softmax_hybrid_follows_the_dense_manager_routing: builds variable-geometry layer specs withModelKVCacheLayerSpec. The PR reports that the parametrized case[False-0-True-KVCacheManagerV2]previously raised aTypeErrorfornum_q_heads. The PR reports that this case passes after the change. This was not verified in this review.Coverage verdict:
sufficientfor the reported fix. The change is a naming fix with no new coverage. Test-list membership intest-db/orqa/was not checked in this review.Per-File QA Perspective:
tests/unittest/_torch/pyexecutor/kv_cache/test_mamba_cache_manager.py: Covers the Skip Softmax hybrid routing with variable-geometry KV layer specs. Confirm that the parametrizedKVCacheManagerV2case passes and that the Ruff check no longer reports F811.Description
test_mamba_cache_manager.pyimports two different classes namedKVCacheLayerSpec: the model's KV geometry spec fromtensorrt_llm._torch.model_config(added by #21553) and the V2 storage layer spec fromkv_cache_manager_v2(added by #21972). The second import rebinds the name, so:ruffreports F811 on the file. ThePre-commit Checkruns hooks on every file a PR changes, so it fails for any PR that touches this file.test_skip_softmax_hybrid_follows_the_dense_manager_routing[False-0-True-KVCacheManagerV2]builds the V2 storage spec withhead_dim/num_kv_heads/num_q_headsand raisesTypeError: KVCacheLayerSpec.__init__() got an unexpected keyword argument 'num_q_heads'.The model spec is now imported as
ModelKVCacheLayerSpec, the aliastest_kv_cache_estimation.pyalready uses. The V2 storage spec keeps its name for_fp8_draft_layer_spec.Test Coverage
tests/unittest/_torch/pyexecutor/kv_cache/test_mamba_cache_manager.py::test_skip_softmax_hybrid_follows_the_dense_manager_routingpre-commit run --files tests/unittest/_torch/pyexecutor/kv_cache/test_mamba_cache_manager.pypasses (fails with F811 on main).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-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin 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.