From aab35bccb40988a89b30fa0874cf3cf10e044709 Mon Sep 17 00:00:00 2001 From: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:56:16 -0700 Subject: [PATCH] fix: draft model IMA by overide max_positional_embeddings (#10787) Co-authored-by: Qiaolin Yu --- python/sglang/srt/configs/model_config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index 8cb91894e..46c610f00 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -210,6 +210,11 @@ class ModelConfig: ): logger.warning(msg) self.context_len = context_length + if is_draft_model: + self.hf_text_config.max_position_embeddings = context_length + logger.warning( + f"Overriding the draft model's max_position_embeddings to {context_length}." + ) else: raise ValueError( f"{msg} To allow overriding this maximum, set the env var SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1"