sgl-project/sglang · error · ValueError

{self.transport_name} acknowledgements support one consumer

Error message

{self.transport_name} acknowledgements support one consumer or the complete consumer group, got {consumer_count}/{self.total_consumer_count}

What it means

Transport acknowledgement supports exactly two modes: acknowledge a single consumer slot (consumer_rank set) or the whole group (all total_consumer_count slots). Any partial multi-rank set that is neither size 1 nor size total_consumer_count raises ValueError, since slot accounting would leak ready/ack generations.

Source

Thrown at python/sglang/srt/multimodal/transport/memory_pool.py:129

        base_address: int,
        device_id: int,
        consumer_count: int,
        consumer_rank: Optional[int] = None,
    ) -> None:
        if self._consumer_acknowledged:
            return
        if consumer_count == self.total_consumer_count:
            consumer_ranks = range(self.total_consumer_count)
        elif consumer_count == 1:
            consumer_ranks = (
                resolve_consumer_rank(
                    self.total_consumer_count,
                    consumer_rank,
                    self.transport_name,
                ),
            )
        else:
            raise ValueError(
                f"{self.transport_name} acknowledgements support one consumer "
                "or the complete consumer group, got "
                f"{consumer_count}/{self.total_consumer_count}"
            )

        for rank in consumer_ranks:
            stream_write_value32(
                device_id,
                base_address + self.ack_byte_offset + rank * CONTROL_WORD_BYTES,
                self.generation,
                self.transport_name,
            )
        self._consumer_acknowledged = True


@dataclass(frozen=True)
class PoolLease:
    start: int

View on GitHub (pinned to 0132848349)

Solutions

  1. Acknowledge one consumer at a time (single rank), or
  2. Acknowledge the entire group (omit rank / pass full set)
  3. Don't attempt partial-group acknowledgement — the protocol doesn't support it

Example fix

# before
ack(consumer_ranks=[0, 1])  # 2 of 4 -> error
# after
for r in [0, 1]:
    ack(consumer_rank=r)
Defensive patterns

Strategy: validation

Validate before calling

assert consumer_rank is None or isinstance(consumer_rank, int), 'single rank or full group only'

Prevention

When it happens

Trigger: Calling acknowledge_consumption with a subset of ranks (e.g. 2 of 4 consumers) — consumer_count is neither 1 nor total_consumer_count — reproduced by test_complete_group_acknowledges_each_consumer_slot.

Common situations: Custom schedulers acknowledging per-subgroup; retry logic that re-acks a few ranks; passing a rank list where the API expects a single rank or None.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/7426574ba0e14d51. Report an issue: GitHub.