vllm.v1.spec_decode.dynamic.utils ¶
Functions:
-
build_dynamic_sd_schedule_lookup–Expand the configured schedule into a dense batch_size -> K lookup.
-
validate_and_normalize_dynamic_sd_schedule–Validate and normalize a Dynamic SD batch-size schedule.
build_dynamic_sd_schedule_lookup(num_speculative_tokens_per_batch_size, vllm_max_batch_size, vllm_num_speculative_tokens) ¶
Expand the configured schedule into a dense batch_size -> K lookup.
"dense_schedule" means a 1-indexed lookup table where index batch_size stores the exact K to use for that runtime batch size. This lets the scheduler do a simple array lookup instead of searching the configured ranges on every scheduling step.
Source code in vllm/v1/spec_decode/dynamic/utils.py
validate_and_normalize_dynamic_sd_schedule(num_speculative_tokens_per_batch_size) ¶
Validate and normalize a Dynamic SD batch-size schedule.
The schedule is expressed as a list of inclusive ranges:
[(range_start, range_end, num_speculative_tokens), ...]