@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5490d633ce
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[UT] fix unify_kv_cache_configs when kv cache config needs sort (#23843)

Ning Xie committed Aug 30, 2025 at 19:22 UTC 5490d633cec0e6b946d3f5c2d56e6236ef42eb40
1 file changed +8 -2
tests/v1/core/test_kv_cache_utils.py
+8 -2
@@ -601,8 +601,14 @@ def test_unify_kv_cache_configs():
601 ]
602
603 unify_kv_cache_configs(need_sort_kv_cache_config)
604 - assert need_sort_kv_cache_config[0].num_blocks == 10
605 - assert need_sort_kv_cache_config[1].num_blocks == 10
604 + sorted_kv_cache_groups = [
605 + KVCacheGroupSpec(["layer1"], new_kv_cache_spec()),
606 + KVCacheGroupSpec(["layer2"], new_kv_cache_spec(num_kv_heads=4)),
607 + ]
608 + assert (
609 + need_sort_kv_cache_config[0].kv_cache_groups == sorted_kv_cache_groups)
610 + assert (
611 + need_sort_kv_cache_config[1].kv_cache_groups == sorted_kv_cache_groups)
612
613 diff_kv_cache_config = [
614 KVCacheConfig(