Skip to content

Commit 9da55d3

Browse files
committed
Add doc for prefill-overhead and improve readme by adding sep lines among param explanation
Signed-off-by: Qifan Deng <[email protected]>
1 parent 679e6ff commit 9da55d3

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,33 @@ For more details see the <a href="https://docs.vllm.ai/en/stable/getting_started
9393
- `port`: the port the simulator listents on, default is 8000
9494
- `model`: the currently 'loaded' model, mandatory
9595
- `served-model-name`: model names exposed by the API (a list of space-separated strings)
96+
---
9697
- `lora-modules`: a list of LoRA adapters (a list of space-separated JSON strings): '{"name": "name", "path": "lora_path", "base_model_name": "id"}', optional, empty by default
9798
- `max-loras`: maximum number of LoRAs in a single batch, optional, default is one
9899
- `max-cpu-loras`: maximum number of LoRAs to store in CPU memory, optional, must be >= than max-loras, default is max-loras
100+
---
99101
- `max-model-len`: model's context window, maximum number of tokens in a single request including input and output, optional, default is 1024
100102
- `max-num-seqs`: maximum number of sequences per iteration (maximum number of inference requests that could be processed at the same time), default is 5
101103
- `mode`: the simulator mode, optional, by default `random`
102104
- `echo`: returns the same text that was sent in the request
103105
- `random`: returns a sentence chosen at random from a set of pre-defined sentences
106+
---
104107
- `time-to-first-token`: the time to the first token (in milliseconds), optional, by default zero
105108
- `time-to-first-token-std-dev`: standard deviation for time before the first token will be returned, in milliseconds, optional, default is 0, can't be more than 30% of `time-to-first-token`, will not cause the actual time to first token to differ by more than 70% from `time-to-first-token`
106109
- `inter-token-latency`: the time to 'generate' each additional token (in milliseconds), optional, by default zero
107110
- `inter-token-latency-std-dev`: standard deviation for time between generated tokens, in milliseconds, optional, default is 0, can't be more than 30% of `inter-token-latency`, will not cause the actual inter token latency to differ by more than 70% from `inter-token-latency`
108111
- `kv-cache-transfer-latency`: time for KV-cache transfer from a remote vLLM (in milliseconds), by default zero. Usually much shorter than `time-to-first-token`
109112
- `kv-cache-transfer-latency-std-dev`: standard deviation for time to "transfer" kv-cache from another vLLM instance in case P/D is activated, in milliseconds, optional, default is 0, can't be more than 30% of `kv-cache-transfer-latency`, will not cause the actual latency to differ by more than 70% from `kv-cache-transfer-latency`
113+
---
114+
- `prefill-overhead`: The base overhead in milliseconds for prefilling a single token. This value, in conjunction with `prefill-complexity` and `prefill-overhead-std-dev`, determines the overall time taken to prefill the entire context. It's an optional parameter with a default of `0` and is ignored if `time-to-first-token` is not `0`.
115+
- `prefill-complexity`: Defines how the prefill time scales with the number of prompt tokens. This is required if `prefill-overhead` is used. Options are `"n^2"` and `"nlog(n)"`, with a default of `"n^2"`.
116+
- `prefill-overhead-std-dev`: The standard deviation in milliseconds for the time taken before the first token is returned. This is required if `prefill-overhead` is used, with a default of `0`.
117+
- `kv-cache-transfer-overhead`: The base overhead in milliseconds for transferring the KV-cache of a single token from another vLLM instance when P/D is activated. Along with `kv-cache-transfer-complexity` and `kv-cache-transfer-overhead-std-dev`, it defines the total time for the KV-cache transfer of the entire context. This parameter is optional with a default of `0` and is ignored if `kv-cache-transfer-latency` is not `0`.
118+
- `kv-cache-transfer-complexity`: The complexity of the KV-cache transfer relative to the number of prompt tokens. This is required if `kv-cache-transfer-overhead` is used. Options are `"linear"` and `"in-place"`, with a default of `"linear"`.
119+
- `kv-cache-transfer-overhead-std-dev`: The standard deviation in milliseconds for the time taken to transfer the KV-cache. This is required if `kv-cache-transfer-overhead` is used, with a default of `0`.
120+
---
110121
- `seed`: random seed for operations (if not set, current Unix time in nanoseconds is used)
122+
---
111123
- `max-tool-call-integer-param`: the maximum possible value of integer parameters in a tool call, optional, defaults to 100
112124
- `min-tool-call-integer-param`: the minimum possible value of integer parameters in a tool call, optional, defaults to 0
113125
- `max-tool-call-number-param`: the maximum possible value of number (float) parameters in a tool call, optional, defaults to 100
@@ -116,6 +128,7 @@ For more details see the <a href="https://docs.vllm.ai/en/stable/getting_started
116128
- `min-tool-call-array-param-length`: the minimum possible length of array parameters in a tool call, optional, defaults to 1
117129
- `tool-call-not-required-param-probability`: the probability to add a parameter, that is not required, in a tool call, optional, defaults to 50
118130
- `object-tool-call-not-required-field-probability`: the probability to add a field, that is not required, in an object in a tool call, optional, defaults to 50
131+
---
119132
- `enable-kvcache`: if true, the KV cache support will be enabled in the simulator. In this case, the KV cache will be simulated, and ZQM events will be published when a KV cache block is added or evicted.
120133
- `kv-cache-size`: the maximum number of token blocks in kv cache
121134
- `block-size`: token block size for contiguous chunks of tokens, possible values: 8,16,32,64,128
@@ -124,6 +137,7 @@ For more details see the <a href="https://docs.vllm.ai/en/stable/getting_started
124137
- `zmq-endpoint`: ZMQ address to publish events
125138
- `zmq-max-connect-attempts`: the maximum number of ZMQ connection attempts, defaults to 0, maximum: 10
126139
- `event-batch-size`: the maximum number of kv-cache events to be sent together, defaults to 16
140+
---
127141
- `fake-metrics`: represents a predefined set of metrics to be sent to Prometheus as a substitute for the real metrics. When specified, only these fake metrics will be reported — real metrics and fake metrics will never be reported together. The set should include values for
128142
- `running-requests`
129143
- `waiting-requests`
@@ -174,9 +188,9 @@ To run the vLLM Simulator image under Docker, run:
174188
```bash
175189
docker run --rm --publish 8000:8000 ghcr.io/llm-d/llm-d-inference-sim:dev --port 8000 --model "Qwen/Qwen2.5-1.5B-Instruct" --lora-modules '{"name":"tweet-summary-0"}' '{"name":"tweet-summary-1"}'
176190
```
177-
**Note:** To run the vLLM Simulator with the latest release version, in the above docker command replace `dev` with the current release which can be found on [GitHub](https://github.com/llm-d/llm-d-inference-sim/pkgs/container/llm-d-inference-sim).
191+
Note: To run the vLLM Simulator with the latest release version, in the above docker command replace `dev` with the current release which can be found on [GitHub](https://github.com/llm-d/llm-d-inference-sim/pkgs/container/llm-d-inference-sim).
178192

179-
**Note:** The above command exposes the simulator on port 8000, and serves the Qwen/Qwen2.5-1.5B-Instruct model.
193+
Note: The above command exposes the simulator on port 8000, and serves the Qwen/Qwen2.5-1.5B-Instruct model.
180194

181195
## Standalone testing
182196

pkg/common/config.go

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ type Configuration struct {
6666
// cause the actual time to first token to differ by more than 70% from TimeToFirstToken
6767
TimeToFirstTokenStdDev int `yaml:"time-to-first-token-std-dev" json:"time-to-first-token-std-dev"`
6868

69-
// PrefillOverhead time taken to prefill the context, in milliseconds
70-
// PrefillOverhead along with PrefillComplexity defines the time taken to prefill the context
69+
// PrefillOverhead the base overhead for prefill of one token, in milliseconds
70+
// in conjunction with PrefillComplexity and PrefillOverheadStdDev
71+
// this value defines the time taken to prefill the whole context
7172
PrefillOverhead int `yaml:"prefill-overhead" json:"prefill-overhead"`
72-
// PrefillOverheadStdDev similar to TimeToFirstTokenStdDev
73-
PrefillOverheadStdDev int `yaml:"prefill-overhead-std-dev" json:"prefill-overhead-std-dev"`
74-
// options are "n^2" and "nlog(n)"
73+
// PrefillComplexity defines how prefill time scales with number of prompt tokens
74+
// options are "n^2" and "nlog(n)", default is "n^2"
7575
PrefillComplexity string `yaml:"prefill-complexity" json:"prefill-complexity"`
76+
// PrefillOverheadStdDev standard deviation for time before the first token will be returned
77+
// in milliseconds, required if PrefillOverhead is used, default is 0, the range is according to
78+
// the implementation of policy, see PrefillComplexity
79+
PrefillOverheadStdDev int `yaml:"prefill-overhead-std-dev" json:"prefill-overhead-std-dev"`
7680

7781
// InterTokenLatency time between generated tokens, in milliseconds
7882
InterTokenLatency int `yaml:"inter-token-latency" json:"inter-token-latency"`
@@ -89,14 +93,17 @@ type Configuration struct {
8993
// KVCacheTransferLatency
9094
KVCacheTransferLatencyStdDev int `yaml:"kv-cache-transfer-latency-std-dev" json:"kv-cache-transfer-latency-std-dev"`
9195

92-
// KVCacheTransfer overhead time taken to transfer kv-cache from another vLLM instance in case P/D is activated,
93-
// in milliseconds.
94-
// KVCacheTransferOverhead along with KVCacheTransferComplexity defines the time taken to transfer kv-cache.
96+
// KVCacheTransferOverhead time taken to transfer kv-cache from another vLLM instance in case P/D is activated, for one token
97+
// in milliseconds, in conjunction with KVCacheTransferComplexity and KVCacheTransferOverheadStdDev defines the time taken to transfer kv-cache for whole content
9598
KVCacheTransferOverhead int `yaml:"kv-cache-transfer-overhead" json:"kv-cache-transfer-overhead"`
96-
// KVCacheTransferOverheadStdDev similar to TimeToFirstTokenStdDev
97-
KVCacheTransferOverheadStdDev int `yaml:"kv-cache-transfer-overhead-std-dev" json:"kv-cache-transfer-overhead-std-dev"`
99+
// KVCacheTransferComplexity the complexity of kv cache transfer against number of prompt tokens
98100
// options are "linear" and "in-place", default is "linear"
99101
KVCacheTransferComplexity string `yaml:"kv-cache-transfer-complexity" json:"kv-cache-transfer-complexity"`
102+
// KVCacheTransferOverheadStdDev standard deviation for time taken to transfer kv-cache
103+
// from another vLLM instance in case P/D is activated, in milliseconds
104+
// required if KVCacheTransferOverhead is used, default is 0, the range is according to
105+
// the implementation of policy, see KVCacheTransferComplexity
106+
KVCacheTransferOverheadStdDev int `yaml:"kv-cache-transfer-overhead-std-dev" json:"kv-cache-transfer-overhead-std-dev"`
100107

101108
// Mode defines the simulator response generation mode, valid values: echo, random
102109
Mode string `yaml:"mode" json:"mode"`

0 commit comments

Comments
 (0)