Skip to content

vllm.v1.core.sched.prefill_utils

Classes:

WaitingPrefillEstimator

Estimates the tokens waiting requests have left to prefill, for scheduling policies that size their decisions from the prefill backlog. Prefix-cache lookups are memoized across steps.

Methods:

  • num_prefill_tokens –

    Estimated tokens left to prefill for a waiting request: those not

_num_cached_tokens(request)

get_num_cached_tokens, redone only when num_tokens changes (preemption) or more of the request's prefix has been cached since.

num_prefill_tokens(request)

Estimated tokens left to prefill for a waiting request: those not already computed (e.g. loaded by a KV connector), which the scheduler resumes from without a prefix-cache lookup, or else not prefix-cached.