spec: size the speculative buffers from the bags, not the startup record (#35024)

This commit is contained in:
Cheng Wan
2026-08-17 16:16:56 -07:00
committed by GitHub
parent 3d7ec00179
commit d2bc697396
28 changed files with 216 additions and 179 deletions
@@ -88,13 +88,9 @@ patches:
- target: sglang.srt.mem_cache.allocation_sizing.get_req_to_token_extra_context_len
edits:
- match: |
if (
server_args.speculative_algorithm is not None
and server_args.page_size > 1
and (server_args.speculative_eagle_topk or 1) > 1
):
extra = max(extra, get_alloc_reserve_per_decode(server_args))
replacement: ""
extra = max(extra, get_alloc_reserve_per_decode() + page_size - 1)
replacement: |
pass
"""