For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
accepted_lengths
accepted_lengths()β
max.pipelines.speculative.gated_delta_rollback.accepted_lengths(merged_offsets, num_accepted, num_draft_tokens)
Returns the [batch] rows of the verify window each request keeps.
This is the prompt length on a prefill and 1 + num_accepted on a
decode.
-
Parameters:
-
- merged_offsets (TensorValue) β
[batch + 1]offsets of the verified sequence. - num_accepted (TensorValue) β
[batch]accepted draft tokens per request. - num_draft_tokens (TensorValue) β Scalar
K, zero on a prefill.
- merged_offsets (TensorValue) β
-
Returns:
-
[batch]int64 accepted row counts. -
Return type: