From d2539980b6fc8244c3887b02c8d8d68237c053c9 Mon Sep 17 00:00:00 2001 From: Jimmy Shong <69131491+Jiminator@users.noreply.github.com> Date: Wed, 17 Jun 2026 22:11:27 -0700 Subject: [PATCH] [Fix] don't force hybrid-SWA when sliding_window is disabled (#28604) --- python/sglang/srt/configs/laguna.py | 5 +---- python/sglang/srt/configs/model_config.py | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/python/sglang/srt/configs/laguna.py b/python/sglang/srt/configs/laguna.py index 5e172d98f..45f9ad8a2 100644 --- a/python/sglang/srt/configs/laguna.py +++ b/python/sglang/srt/configs/laguna.py @@ -137,10 +137,7 @@ class LagunaConfig(PretrainedConfig): self.layer_types = ( list(layer_types) if layer_types - else [ - "full_attention" if i % 4 == 0 else "sliding_attention" - for i in range(num_hidden_layers) - ] + else ["full_attention" for _ in range(num_hidden_layers)] ) self.mlp_layer_types = ( list(mlp_layer_types) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index abc43d354..b51e1c3a5 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -1724,6 +1724,13 @@ def is_hybrid_swa_model( "LagunaForCausalLM", } if any(arch in hybrid_swa_archs for arch in model_architectures): + # Only treat Laguna as hybrid SWA when it actually has a sliding window. + if ( + "LagunaForCausalLM" in model_architectures + and hf_text_config is not None + and not getattr(hf_text_config, "sliding_window", 0) + ): + return False return True # Also recognize models that explicitly opt-in via their HF text config, # so custom hybrid-SWA architectures don't need to be added to the allowlist.