From 51b3ed02ca544e58b05bcbfd261dfb5c7d355b8d Mon Sep 17 00:00:00 2001 From: Nicolas Castet <26874160+nvcastet@users.noreply.github.com> Date: Fri, 20 Feb 2026 21:51:28 -0600 Subject: [PATCH] Fix bug in symm mem pre-allocation default (#19082) --- python/sglang/srt/server_args.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 5860619e2..952d53563 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -1068,16 +1068,13 @@ class ServerArgs: if model_config.is_multimodal and not self.language_only: self.adjust_mem_fraction_for_vlm(model_config) - # If symm mem is enabled and prealloc size is not set, set it to 4GB - if ( - self.enable_symm_mem - and not envs.SGLANG_SYMM_MEM_PREALLOC_GB_SIZE.is_set() - ): - envs.SGLANG_SYMM_MEM_PREALLOC_GB_SIZE.set(4) - logger.warning( - "Symmetric memory is enabled, setting symmetric memory prealloc size to 4GB as default." - "Use environment variable SGLANG_SYMM_MEM_PREALLOC_GB_SIZE to change the prealloc size." - ) + # If symm mem is enabled and prealloc size is not set, set it to 4GB + if self.enable_symm_mem and not envs.SGLANG_SYMM_MEM_PREALLOC_GB_SIZE.is_set(): + envs.SGLANG_SYMM_MEM_PREALLOC_GB_SIZE.set(4) + logger.warning( + "Symmetric memory is enabled, setting symmetric memory prealloc size to 4GB as default." + "Use environment variable SGLANG_SYMM_MEM_PREALLOC_GB_SIZE to change the prealloc size." + ) def _generate_cuda_graph_batch_sizes(self): """