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
build_depth_lookup
build_depth_lookup()
max.pipelines.speculative.depth_schedule.build_depth_lookup(schedule, *, max_batch_size, max_depth)
Expands a schedule into a dense batch_size -> depth lookup.
Index 0 is unused so a runtime batch size indexes the list directly. Gaps
between configured ranges carry the previous range’s depth forward, as does
the tail past the final range, so the lookup is total over
1..max_batch_size.
-
Parameters:
-
- schedule (Sequence[tuple[int, int, int]]) – A schedule already through
normalize_depth_schedule(). - max_batch_size (int) – Largest decode batch size the lookup must cover.
- max_depth (int) – Ceiling applied to every entry. A schedule cannot ask to
verify more drafts than the step actually carries, which is the
configured
num_speculative_tokens.
- schedule (Sequence[tuple[int, int, int]]) – A schedule already through
-
Returns:
-
A list of length
max_batch_size + 1whose elementiis the number of drafts to verify at batch sizei. -
Raises:
-
ValueError – If
max_batch_sizeormax_depthis not positive. -
Return type: