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

ring_accepted_lengths

ring_accepted_lengths()​

max.pipelines.speculative.gated_delta_rollback.ring_accepted_lengths(window_lengths, num_accepted, num_draft_tokens)

source

Returns accepted_lengths(), zero for a row the verify committed.

A row longer than the verify window was committed by the verify itself at its last real token, so the rollback neither replays nor folds any of it.

Parameters:

  • window_lengths (TensorValue) – [batch] row lengths of the verified sequence, from _window_lengths().
  • num_accepted (TensorValue) – [batch] accepted draft tokens per request.
  • num_draft_tokens (TensorValue) – Scalar K, zero on a prefill.

Returns:

[batch] int64 row counts the rollback applies.

Return type:

TensorValue