Skip to content

Commit 6cae9b1

Browse files
mouxinqqmouxin
andauthored
[Feature] Config eviction_duration (PaddlePaddle#7125)
* [Feature] Config eviction_duration * [Feature] Config eviction_duration * [Feature] Config eviction_duration * [Feature] Config eviction_duration --------- Co-authored-by: mouxin <mouxin@baidu.com>
1 parent c29e86f commit 6cae9b1

8 files changed

Lines changed: 427 additions & 5 deletions

File tree

docs/online_serving/router.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ scheduler:
195195
prefill-policy: "cache_aware" # Prefill scheduling policy in PD mode
196196
decode-policy: "request_num" # Decode scheduling policy in PD mode
197197
eviction-interval-secs: 60 # Cache eviction interval for CacheAware scheduling
198+
eviction-duration-mins: 30 # Eviction duration for cache-aware radix tree nodes (minutes); default: 30
198199
balance-abs-threshold: 1 # Absolute threshold for CacheAware balancing
199200
balance-rel-threshold: 0.2 # Relative threshold for CacheAware balancing
200201
hit-ratio-weight: 1.0 # Cache hit ratio weight

docs/zh/online_serving/router.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ scheduler:
195195
prefill-policy: "cache_aware" # pd分离模式下prefill节点调度策略; 默认: process_tokens
196196
decode-policy: "request_num" # pd分离模式下decode节点调度策略; 默认: request_num
197197
eviction-interval-secs: 60 # cache-aware策略清理过期cache的间隔时间
198+
eviction-duration-mins: 30 # cache-aware策略radix tree节点驱逐时间(分钟); 默认: 30
198199
balance-abs-threshold: 1 # cache-aware策略绝对阈值
199200
balance-rel-threshold: 0.2 # cache-aware策略相对阈值
200201
hit-ratio-weight: 1.0 # cache-aware策略命中率权重

fastdeploy/golang_router/examples/run_with_config/config/config.example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ scheduler:
99
prefill-policy: "cache_aware"
1010
decode-policy: "request_num"
1111
eviction-interval-secs: 60
12+
eviction-duration-mins: 30 # eviction duration for cache-aware radix tree nodes (minutes); default: 30
1213
balance-abs-threshold: 1
1314
balance-rel-threshold: 0.2
1415
hit-ratio-weight: 1.0

fastdeploy/golang_router/examples/run_with_default_workers/config/config.example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ scheduler:
99
prefill-policy: "cache_aware"
1010
decode-policy: "request_num"
1111
eviction-interval-secs: 60
12+
eviction-duration-mins: 30 # eviction duration for cache-aware radix tree nodes (minutes); default: 30
1213
balance-abs-threshold: 1
1314
balance-rel-threshold: 0.2
1415
hit-ratio-weight: 1.0

fastdeploy/golang_router/internal/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type SchedulerConfig struct {
3636
PrefillPolicy string `yaml:"prefill-policy"`
3737
DecodePolicy string `yaml:"decode-policy"`
3838
EvictionIntervalSecs float64 `yaml:"eviction-interval-secs"`
39+
EvictionDurationMins float64 `yaml:"eviction-duration-mins"`
3940
CacheBlockSize int `yaml:"cache-block-size"`
4041
TokenizerURL string `yaml:"tokenizer-url"`
4142
TokenizerTimeoutSecs float64 `yaml:"tokenizer-timeout-secs"`
@@ -98,6 +99,9 @@ func Load(configPath, listenPort string, isSplitwise bool) (*Config, error) {
9899
if cfg.Scheduler.EvictionIntervalSecs == 0 {
99100
cfg.Scheduler.EvictionIntervalSecs = 60
100101
}
102+
if cfg.Scheduler.EvictionDurationMins == 0 {
103+
cfg.Scheduler.EvictionDurationMins = 30
104+
}
101105
if cfg.Scheduler.CacheBlockSize == 0 {
102106
cfg.Scheduler.CacheBlockSize = 64
103107
}

0 commit comments

Comments
 (0)