Skip to content

Commit ba5c543

Browse files
authored
Merge branch 'main' into failure-mode
Signed-off-by: Sergey Marunich <[email protected]>
2 parents 52edd56 + c1ba592 commit ba5c543

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,16 @@ For more details see the <a href="https://docs.vllm.ai/en/stable/getting_started
118118
- `min-tool-call-array-param-length`: the minimum possible length of array parameters in a tool call, optional, defaults to 1
119119
- `tool-call-not-required-param-probability`: the probability to add a parameter, that is not required, in a tool call, optional, defaults to 50
120120
- `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
121+
<!--
121122
- `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.
122123
- `kv-cache-size`: the maximum number of token blocks in kv cache
123124
- `block-size`: token block size for contiguous chunks of tokens, possible values: 8,16,32,64,128
124125
- `tokenizers-cache-dir`: the directory for caching tokenizers
125126
- `hash-seed`: seed for hash generation (if not set, is read from PYTHONHASHSEED environment variable)
126127
- `zmq-endpoint`: ZMQ address to publish events
128+
- `event-batch-size`: the maximum number of kv-cache events to be sent together, defaults to 16
127129
- `failure-injection-rate`: probability (0-100) of injecting failures, optional, default is 0
128130
- `failure-types`: list of specific failure types to inject (rate_limit, invalid_api_key, context_length, server_error, invalid_request, model_not_found), optional, if empty all types are used
129-
- `event-batch-size`: the maximum number of kv-cache events to be sent together, defaults to 16
130131
-->
131132
In addition, as we are using klog, the following parameters are available:
132133
- `add_dir_header`: if true, adds the file directory to the header of the log messages

pkg/common/config.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func (c *Configuration) validate() error {
314314
if c.EventBatchSize < 1 {
315315
return errors.New("event batch size cannot less than 1")
316316
}
317+
317318

318319
if c.FailureInjectionRate < 0 || c.FailureInjectionRate > 100 {
319320
return errors.New("failure injection rate should be between 0 and 100")
@@ -332,7 +333,6 @@ func (c *Configuration) validate() error {
332333
return fmt.Errorf("invalid failure type '%s', valid types are: rate_limit, invalid_api_key, context_length, server_error, invalid_request, model_not_found", failureType)
333334
}
334335
}
335-
336336
return nil
337337
}
338338

@@ -385,7 +385,7 @@ func ParseCommandParamsAndLoadConfig() (*Configuration, error) {
385385
f.StringVar(&config.HashSeed, "hash-seed", config.HashSeed, "Seed for hash generation (if not set, is read from PYTHONHASHSEED environment variable)")
386386
f.StringVar(&config.ZMQEndpoint, "zmq-endpoint", config.ZMQEndpoint, "ZMQ address to publish events")
387387
f.IntVar(&config.EventBatchSize, "event-batch-size", config.EventBatchSize, "Maximum number of kv-cache events to be sent together")
388-
388+
389389
f.IntVar(&config.FailureInjectionRate, "failure-injection-rate", config.FailureInjectionRate, "Probability (0-100) of injecting failures")
390390

391391
failureTypes := getParamValueFromArgs("failure-types")
@@ -443,6 +443,13 @@ func ParseCommandParamsAndLoadConfig() (*Configuration, error) {
443443
}
444444
}
445445

446+
if config.HashSeed == "" {
447+
hashSeed := os.Getenv("PYTHONHASHSEED")
448+
if hashSeed != "" {
449+
config.HashSeed = hashSeed
450+
}
451+
}
452+
446453
if err := config.validate(); err != nil {
447454
return nil, err
448455
}

0 commit comments

Comments
 (0)