sgl-project/sglang · error · ValueError
rids_to_check cannot be used in PP mode
Error message
rids_to_check cannot be used in PP mode
What it means
Companion guard to the PP consensus check: in PP mode (pp_size > 1), pop_preallocated rejects rids_to_check because request resolution must be driven by the pipeline-wide pp_good_rids/pp_bad_rids consensus, not a per-stage check list. Passing both is contradictory.
Source
Thrown at python/sglang/srt/disaggregation/decode.py:1082
prefetched[1].cancel()
self.pending_reqs = remaining
for decode_req, prefill_dp_rank in resolved:
decode_req.kv_receiver.init(prefill_dp_rank)
def pop_preallocated(
self,
rids_to_check: Optional[List[str]] = None,
pp_good_rids: Optional[List[str]] = None,
pp_bad_rids: Optional[List[str]] = None,
) -> Tuple[List[DecodeRequest], List[DecodeRequest]]:
"""Pop the preallocated requests from the pending queue (FIFO)."""
is_pp_mode = self.pp_size > 1
if is_pp_mode and (pp_good_rids is None or pp_bad_rids is None):
raise ValueError("PP consensus is required when pp_size > 1")
if is_pp_mode and rids_to_check is not None:
raise ValueError("rids_to_check cannot be used in PP mode")
self._resolve_pending_reqs()
self._update_handshake_waiters(rids_to_check, pp_good_rids, pp_bad_rids)
if is_pp_mode:
rids_to_check = set(pp_good_rids) | set(pp_bad_rids)
failed_reqs = []
preallocated_reqs = []
indices_to_remove = set()
# We need to make sure that the sum of inflight tokens and allocatable tokens is greater than maximum input+output length of each inflight request
# Otherwise it is possible for one request running decode out of memory, while all other requests are in the transfer queue that cannot be retracted.
retractable_tokens = sum(
len(r.origin_input_ids) + len(r.output_ids)
for r in self.scheduler.running_batch.reqs
)
uses_swa_tail_prealloc = self._uses_swa_tail_prealloc()View on GitHub (pinned to 0132848349)
Solutions
- Remove the rids_to_check argument and supply pp_good_rids/pp_bad_rids in PP mode
- Branch caller code on pp_size: use rids_to_check only when pp_size == 1
Example fix
# before
good, bad = queue.pop_preallocated(rids_to_check=rids, pp_good_rids=g, pp_bad_rids=b)
# after
if queue.pp_size > 1:
good, bad = queue.pop_preallocated(pp_good_rids=g, pp_bad_rids=b)
else:
good, bad = queue.pop_preallocated(rids_to_check=rids) Defensive patterns
Strategy: validation
Validate before calling
if queue.pp_size > 1:
assert rids_to_check is None, 'use pp_good_rids/pp_bad_rids in PP mode' Prevention
- Branch on pp_size at the call site instead of passing both styles
When it happens
Trigger: Calling pop_preallocated with pp_size > 1 and a non-None rids_to_check (alongside or instead of the consensus lists).
Common situations: Single-PP scheduler/test code reused on a PP deployment; upgrading a codebase where rids_to_check was the old API and the PP path was added later.
Related errors
- PP consensus is required when pp_size > 1
- Unexpected compressed-MLA dst_kv_ptrs length {len(dst_kv_ptr
- Destination MLA KV descriptors do not match prefill pp confi
- PD disagg: PP>1 not supported for MiniMax sparse index yet.
- Missing previous frame for delta payload
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/afbfb4ac05e3396a.
Report an issue: GitHub.