[RadixTree][9/N Refactor]: Support unified init_load_back params (#20590)

This commit is contained in:
hzh0425
2026-03-18 11:19:52 +08:00
committed by GitHub
parent f15b3338c9
commit c43d495dd5
5 changed files with 27 additions and 12 deletions
@@ -38,6 +38,7 @@ from sglang.srt.layers.attention.nsa.utils import is_nsa_prefill_cp_in_seq_split
from sglang.srt.managers.schedule_batch import Req, ScheduleBatch
from sglang.srt.mem_cache.base_prefix_cache import (
BasePrefixCache,
InitLoadBackParams,
InsertParams,
MatchPrefixParams,
)
@@ -769,7 +770,10 @@ class PrefillAdder:
if req.host_hit_length > 0:
new_indices, req.last_node = self.tree_cache.init_load_back(
req.last_host_node, req.host_hit_length
InitLoadBackParams(
last_host_node=req.last_host_node,
host_hit_length=req.host_hit_length,
)
)
req.prefix_indices = torch.cat([req.prefix_indices, new_indices])
req.set_extend_input_len(len(req.fill_ids) - len(req.prefix_indices))