Skip to content

Commit 8ef6d0a

Browse files
author
niushengxiao
committed
fix
1 parent 1a991b4 commit 8ef6d0a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lightllm/common/mamba_cache_mem_manager/cache_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ def profile_size(
233233

234234
if mamba_cache_size < start_args.running_max_req_size * 2:
235235
ratio = mamba_cache_ratio if mamba_cache_ratio is not None else 0.5
236+
if mamba_cache_size == 0:
237+
ratio_suggestion = "higher than the current setting; the current memory budget cannot fit even 1 buffer"
238+
else:
239+
ratio_suggestion = f"{start_args.running_max_req_size / mamba_cache_size * ratio:.3f} or higher"
236240
raise ValueError(
237241
f"Insufficient memory for mamba cache allocation!\n\n"
238242
f"mamba_cache_size should be at least running_max_req_size * 2\n"
@@ -246,7 +250,7 @@ def profile_size(
246250
f"Solutions:\n"
247251
f" 1. Reduce --running_max_req_size to {mamba_cache_size} or lower\n"
248252
f" 2. Increase --mamba_cache_ratio from {ratio} to "
249-
f"{start_args.running_max_req_size / mamba_cache_size * ratio:.3f} or higher\n"
253+
f"{ratio_suggestion}\n"
250254
f" 3. Increase --mem_fraction to leave more memory for caches\n"
251255
)
252256

0 commit comments

Comments
 (0)