vllm.benchmarks.forward.shapes
¶
Exact batch shapes for vllm bench forward.
Classes:
Functions:
-
jitter_kv_lens–Draw each request's prefix uniformly within +-jitter of its value.
-
load_cases–Load cases from a JSON or YAML file.
-
parse_case–Parse
NAME=REQS, where REQS is a comma list of[N*]Q[@K][c][:D].
BenchRequest
dataclass
¶
Attributes:
Source code in vllm/benchmarks/forward/shapes.py
is_decode
property
¶
Decode or verify; otherwise a prefill.
jitter_kv_lens(case, jitter, max_kv_len, seed)
¶
Draw each request's prefix uniformly within +-jitter of its value.
Query lengths are kept, so a fresh prefill stays one and a non-empty
prefix stays non-empty. KV lengths are capped at max_kv_len. The draw
depends only on the seed and the case's name, not on the other cases.
Source code in vllm/benchmarks/forward/shapes.py
load_cases(path)
¶
Load cases from a JSON or YAML file.
Format: {"cases": [{"name": ..., "requests": [{"query_len": ...,
"kv_len": ..., "num_draft_tokens": ..., "chunked": ..., "count": ...}]}]}.
Source code in vllm/benchmarks/forward/shapes.py
parse_case(text)
¶
Parse NAME=REQS, where REQS is a comma list of [N*]Q[@K][c][:D].
Q is the query length, K the KV length including the query (default Q, a
fresh prefill), D the number of draft tokens (verify) and N the number of
such requests. A prefill's prefix is a prefix-cache hit unless c marks
it as a chunked prefill. For example, decode=32*1@8192,
verify=16*4@4096:3, prefill=8192, hit=8192@40960,
chunk=8192@40960c or mix=8192,32*1@8192.