From 3d484be547e016ca0f0dea379fe800292565ab30 Mon Sep 17 00:00:00 2001 From: ratish <114130421+Ratish1@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:42:26 +0400 Subject: [PATCH] fix(attention): Prevent trtllm_mha auto-selection with eagle3 speculative decoding (#15127) --- python/sglang/srt/server_args.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index b777ad3be..4498f4214 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -1493,7 +1493,14 @@ class ServerArgs: and is_fa3_default_architecture(self.model_config.hf_config) ): self.attention_backend = "fa3" - elif is_sm100_supported() and is_no_spec_infer_or_topk_one(self): + elif ( + is_sm100_supported() + and is_no_spec_infer_or_topk_one(self) + and ( + self.speculative_algorithm is None + or self.speculative_eagle_topk is not None + ) + ): self.attention_backend = "trtllm_mha" elif is_hip(): self.attention_backend = "aiter"