IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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)

source

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.

Returns:

[batch] int64 accepted row counts.

Return type:

TensorValue