From fa0d8f662909e12c762f166d2e3c08d29a488d44 Mon Sep 17 00:00:00 2001 From: ehuaa Date: Fri, 20 Mar 2026 10:37:29 +0800 Subject: [PATCH] perf: avoid unnecessary gpu-cpu sync in eagle_info (#20266) Co-authored-by: root --- python/sglang/srt/speculative/eagle_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/speculative/eagle_info.py b/python/sglang/srt/speculative/eagle_info.py index c2f90c378..572a76f6a 100644 --- a/python/sglang/srt/speculative/eagle_info.py +++ b/python/sglang/srt/speculative/eagle_info.py @@ -339,7 +339,7 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin): sampling_info.top_ks, self.draft_token_num, dim=0 ), ) # (bs * draft_token_num, vocab_size) - if not torch.all(sampling_info.top_ps == 1.0): + if sampling_info.need_top_p_sampling: target_probs = top_p_renorm_prob( target_probs, torch.repeat_interleave(