Skip to content
Merged
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
4 changes: 2 additions & 2 deletions cmd/epp/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ func (r *Runner) initializeScheduler(datastore datastore.Datastore) (*scheduling
kvCacheScorerWeight := envutil.GetEnvInt("KV_CACHE_SCORE_WEIGHT", scorer.DefaultKVCacheScorerWeight, setupLog)

schedulerProfile := framework.NewSchedulerProfile().
WithScorers(framework.NewWeightedScorer(&scorer.QueueScorer{}, queueScorerWeight),
framework.NewWeightedScorer(&scorer.KVCacheScorer{}, kvCacheScorerWeight)).
WithScorers(framework.NewWeightedScorer(scorer.NewQueueScorer(), queueScorerWeight),
framework.NewWeightedScorer(scorer.NewKVCacheScorer(), kvCacheScorerWeight)).
WithPicker(picker.NewMaxScorePicker())

if prefixCacheScheduling {
Expand Down
5 changes: 5 additions & 0 deletions pkg/epp/scheduling/framework/plugins/scorer/kvcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const (
// compile-time type assertion
var _ framework.Scorer = &KVCacheScorer{}

// NewKVCacheScorer initializes a new KVCacheScorer and returns its pointer.
func NewKVCacheScorer() *KVCacheScorer {
return &KVCacheScorer{}
}

// KVCacheScorer scores list of candidate pods based on KV cache utilization.
type KVCacheScorer struct{}

Expand Down
5 changes: 5 additions & 0 deletions pkg/epp/scheduling/framework/plugins/scorer/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const (
// compile-time type assertion
var _ framework.Scorer = &QueueScorer{}

// NewQueueScorer initializes a new QueueScorer and returns its pointer.
func NewQueueScorer() *QueueScorer {
return &QueueScorer{}
}

// QueueScorer scores list of candidate pods based on the pod's waiting queue size.
// the less waiting queue size the pod has, the higher score it will get (since it's more available to serve new request).
type QueueScorer struct{}
Expand Down