From 5490d633cec0e6b946d3f5c2d56e6236ef42eb40 Mon Sep 17 00:00:00 2001 From: Ning Xie Date: Sat, 30 Aug 2025 19:22:14 +0800 Subject: [PATCH] [UT] fix unify_kv_cache_configs when kv cache config needs sort (#23843) --- tests/v1/core/test_kv_cache_utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/v1/core/test_kv_cache_utils.py b/tests/v1/core/test_kv_cache_utils.py index c4f927d69c2dd..e738f2bd46472 100644 --- a/tests/v1/core/test_kv_cache_utils.py +++ b/tests/v1/core/test_kv_cache_utils.py @@ -601,8 +601,14 @@ def test_unify_kv_cache_configs(): ] unify_kv_cache_configs(need_sort_kv_cache_config) - assert need_sort_kv_cache_config[0].num_blocks == 10 - assert need_sort_kv_cache_config[1].num_blocks == 10 + sorted_kv_cache_groups = [ + KVCacheGroupSpec(["layer1"], new_kv_cache_spec()), + KVCacheGroupSpec(["layer2"], new_kv_cache_spec(num_kv_heads=4)), + ] + assert ( + need_sort_kv_cache_config[0].kv_cache_groups == sorted_kv_cache_groups) + assert ( + need_sort_kv_cache_config[1].kv_cache_groups == sorted_kv_cache_groups) diff_kv_cache_config = [ KVCacheConfig(