From 2087760ea8fa3dc9b31a0539bcd843e797d08fb3 Mon Sep 17 00:00:00 2001 From: "minke.yu" Date: Tue, 20 Oct 2026 12:10:08 +0800 Subject: [PATCH] fix(v41): materialize CP request rows in select_compact_prefill PR #42922 covered prefill_requests but the compact-candidate consume path (DSpark draft consuming target candidates) still subscripted req_rows directly, crashing with TypeError under CP8+DSpark5 prefill when out_page_indices is set. Route through materialize_prefill_request_rows; non-CP behavior unchanged (returns req_rows as-is). --- .../sglang/srt/layers/attention/dsv4/v41_indexer/scoring.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/layers/attention/dsv4/v41_indexer/scoring.py b/python/sglang/srt/layers/attention/dsv4/v41_indexer/scoring.py index d9022d318c..fcd2f76c3a 100644 --- a/python/sglang/srt/layers/attention/dsv4/v41_indexer/scoring.py +++ b/python/sglang/srt/layers/attention/dsv4/v41_indexer/scoring.py @@ -578,7 +578,9 @@ def select_compact_prefill( indices, chunk.scores, chunk.lens, - inputs.req_rows[chunk.tok] if inputs.out_page_indices is not None else None, + materialize_prefill_request_rows(inputs)[chunk.tok] + if inputs.out_page_indices is not None + else None, req_to_token, inputs.out_page_indices, inputs.out_raw_indices,