From ec5742f4ab463d2316a6a3324f6e4552cfc94c15 Mon Sep 17 00:00:00 2001 From: shuwenn <47200617+alphabetc1@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:19:31 +0800 Subject: [PATCH] fix: Auto-correct page_size for Mamba no_buffer radix cache mode (#20538) --- python/sglang/srt/server_args.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 74445c9cd..f6757a1bd 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -2204,6 +2204,13 @@ class ServerArgs: == 0 ), f"For SSM models with extra buffer, either FLA_CHUNK_SIZE or page_size must be divisible by the other, got {FLA_CHUNK_SIZE=}, {self.page_size=}" elif not self.disable_radix_cache: # no_buffer + if self.page_size is not None and self.page_size != 1: + logger.warning( + f"{model_arch} with radix cache requires page_size=1 in the current " + f"Mamba scheduling mode (no_buffer), but got {self.page_size}. " + "Automatically setting page_size=1." + ) + self.page_size = 1 if self.speculative_algorithm is None: logger.warning( "Disabling overlap schedule since mamba no_buffer is not compatible with "