File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1612,15 +1612,15 @@ def _get_stats(self,
1612
1612
# KV Cache Usage in %
1613
1613
num_total_gpu = self .cache_config .num_gpu_blocks
1614
1614
gpu_cache_usage_sys = 0.
1615
- if num_total_gpu is not None :
1615
+ if num_total_gpu : # Guard against both None and 0
1616
1616
num_free_gpu = sum (
1617
1617
scheduler .block_manager .get_num_free_gpu_blocks ()
1618
1618
for scheduler in self .scheduler )
1619
1619
gpu_cache_usage_sys = 1.0 - (num_free_gpu / num_total_gpu )
1620
1620
1621
1621
num_total_cpu = self .cache_config .num_cpu_blocks
1622
1622
cpu_cache_usage_sys = 0.
1623
- if num_total_cpu is not None and num_total_cpu > 0 :
1623
+ if num_total_cpu : # Guard against both None and 0
1624
1624
num_free_cpu = sum (
1625
1625
scheduler .block_manager .get_num_free_cpu_blocks ()
1626
1626
for scheduler in self .scheduler )
You can’t perform that action at this time.
0 commit comments