Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const (
// - "PREFILL_ENABLE_" + pluginName Enables the named plugin for prefill processing
// - "PREFILL_" + pluginName + "_WEIGHT" The weight for a scorer in prefill processing

enablementKeyPrefix = "ENABLE_"
weightSuffix = "_WEIGHT"
prefillEnablementKeyPrefix = "PREFILL_ENABLE_"
prefillWeightPrefix = "PREFILL_"

// KVCacheScorerName name of the kv-cache scorer in configuration
KVCacheScorerName = "KVCACHE_AWARE_SCORER"
// LoadAwareScorerName name of the load aware scorer in configuration
Expand All @@ -41,8 +46,8 @@ const (
GIEKVCacheUtilizationScorerName = "GIE_KVCACHE_UTILIZATION_SCORER"
// GIEQueueScorerName name of the GIE queue scorer in configuration
GIEQueueScorerName = "GIE_QUEUE_SCORER"
// K8SPrefixScorerName name of the GIE prefix plugin in configuration
K8SPrefixScorerName = "GIE_PREFIX_SCORER"
// GIEPrefixScorerName name of the GIE prefix plugin in configuration
GIEPrefixScorerName = "GIE_PREFIX_SCORER"

pdEnabledEnvKey = "PD_ENABLED"
pdPromptLenThresholdEnvKey = "PD_PROMPT_LEN_THRESHOLD"
Expand Down Expand Up @@ -81,13 +86,13 @@ func (c *Config) LoadConfig() {
KVCacheScorerName, LoadAwareScorerName, PrefixScorerName, SessionAwareScorerName,
GIELeastKVCacheFilterName, GIELeastQueueFilterName, GIELoraAffinityFilterName,
GIELowQueueFilterName, GIESheddableCapacityFilterName,
GIEKVCacheUtilizationScorerName, GIEQueueScorerName, K8SPrefixScorerName)
GIEKVCacheUtilizationScorerName, GIEQueueScorerName, GIEPrefixScorerName)

c.loadPluginInfo(c.PrefillSchedulerPlugins, true,
KVCacheScorerName, LoadAwareScorerName, PrefixScorerName, SessionAwareScorerName,
GIELeastKVCacheFilterName, GIELeastQueueFilterName, GIELoraAffinityFilterName,
GIELowQueueFilterName, GIESheddableCapacityFilterName,
GIEKVCacheUtilizationScorerName, GIEQueueScorerName, K8SPrefixScorerName)
GIEKVCacheUtilizationScorerName, GIEQueueScorerName, GIEPrefixScorerName)

c.PDEnabled = env.GetEnvString(pdEnabledEnvKey, "false", c.logger) == "true"
c.PDThreshold = env.GetEnvInt(pdPromptLenThresholdEnvKey, pdPromptLenThresholdDefault, c.logger)
Expand All @@ -99,11 +104,11 @@ func (c *Config) loadPluginInfo(plugins map[string]int, prefill bool, pluginName
var enablementKey string
var weightKey string
if prefill {
enablementKey = "PREFILL_ENABLE_" + pluginName
weightKey = "PREFILL_" + pluginName + "_WEIGHT"
enablementKey = prefillEnablementKeyPrefix + pluginName
weightKey = prefillWeightPrefix + pluginName + weightSuffix
} else {
enablementKey = "ENABLE_" + pluginName
weightKey = pluginName + "_WEIGHT"
enablementKey = enablementKeyPrefix + pluginName
weightKey = pluginName + weightSuffix
}

if env.GetEnvString(enablementKey, "false", c.logger) != "true" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduling/pd/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *Scheduler) pluginsFromConfig(ctx context.Context, pluginsConfig map[str
plugins[k8sfilter.NewSheddableCapacityFilter()] = pluginWeight
case config.GIEKVCacheUtilizationScorerName:
plugins[&k8sscorer.KVCacheScorer{}] = pluginWeight
case config.K8SPrefixScorerName:
case config.GIEPrefixScorerName:
// For now use the default configuration
prefixConfig := prefix.Config{
HashBlockSize: envutil.GetEnvInt("PREFIX_CACHE_HASH_BLOCK_SIZE", prefix.DefaultHashBlockSize, logger),
Expand Down