From 1775b963dbb9d182496c12b92eb5b0d3155db030 Mon Sep 17 00:00:00 2001 From: Mick Date: Fri, 3 Jan 2025 02:28:22 +0800 Subject: [PATCH 1/2] [Fix] fix incorrectly overwriting the port specified in ServerArgs (#2714) --- python/sglang/srt/server.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/sglang/srt/server.py b/python/sglang/srt/server.py index 35216bddbc..16460470a6 100644 --- a/python/sglang/srt/server.py +++ b/python/sglang/srt/server.py @@ -917,10 +917,9 @@ def __init__( atexit.register(self.shutdown) # Pre-allocate ports - for port in range(10000, 40000): + for port in range(self.server_args.port, 40000): if is_port_available(port): break - port += 1 self.server_args.port = port self.url = self.server_args.url() From 8c8779cd059d64827f148c9532645c641512a04d Mon Sep 17 00:00:00 2001 From: yukavio <67678385+yukavio@users.noreply.github.com> Date: Fri, 3 Jan 2025 02:28:39 +0800 Subject: [PATCH 2/2] [Fix] fix retract error in eagle speculative decoding (#2711) Co-authored-by: kavioyu --- python/sglang/srt/speculative/eagle_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/speculative/eagle_utils.py b/python/sglang/srt/speculative/eagle_utils.py index 9d1a73aba3..f76cca2d56 100644 --- a/python/sglang/srt/speculative/eagle_utils.py +++ b/python/sglang/srt/speculative/eagle_utils.py @@ -601,11 +601,11 @@ def verify(self, batch: ScheduleBatch, logits_output: torch.Tensor) -> torch.Ten req.check_finished() if req.finished(): draft_input.has_finished = True - finished_extend_len[req.rid] = verified_len + 1 else: new_accept_index.append(accept_index[low : low + verified_len + 1]) unfinished_index.append(i) low += verified_len + 1 + finished_extend_len[req.rid] = verified_len + 1 if len(new_accept_index) > 0: new_accept_index = torch.cat(new_accept_index, dim=0)