File tree 1 file changed +6
-3
lines changed 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,12 @@ def _initialize_kv_caches(self,
83
83
kv_cache_config = get_kv_cache_config (vllm_config , kv_cache_spec ,
84
84
available_gpu_memory )
85
85
kv_cache_configs .append (kv_cache_config )
86
- assert len (set (config .num_blocks for config in kv_cache_configs )) == 1 , \
87
- f"num_gpu_blocks need to be the same across workers: { num_gpu_blocks } != { kv_cache_config .num_blocks } "
88
- num_gpu_blocks = kv_cache_configs [0 ].num_blocks
86
+ num_gpu_blocks_set = set (config .num_blocks
87
+ for config in kv_cache_configs )
88
+ assert len (num_gpu_blocks_set ) == 1 , (
89
+ f"num_gpu_blocks need to be the same across workers, "
90
+ f"but they are different: { num_gpu_blocks_set } " )
91
+ num_gpu_blocks = num_gpu_blocks_set .pop ()
89
92
num_cpu_blocks = 0
90
93
91
94
# Initialize kv cache and warmup the execution
You can’t perform that action at this time.
0 commit comments