Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion pkg/epp/scheduling/framework/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
// and the previously executed SchedluderProfile cycles along with their results.
type ProfilePicker interface {
plugins.Plugin
Pick(request *types.LLMRequest, profiles map[string]*SchedulerProfile, executionResults map[string]*types.Result) map[string]*SchedulerProfile
Pick(ctx context.Context, request *types.LLMRequest, profiles map[string]*SchedulerProfile, executionResults map[string]*types.Result) map[string]*SchedulerProfile
}

// Filter defines the interface for filtering a list of pods based on context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package profilepicker

import (
"context"

"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types"
)
Expand All @@ -39,7 +41,8 @@ func (p *AllProfilesPicker) Name() string {

// Pick selects the SchedulingProfiles to run from the list of candidate profiles, while taking into consideration the request properties and the
// previously executed cycles along with their results.
func (p *AllProfilesPicker) Pick(request *types.LLMRequest, profiles map[string]*framework.SchedulerProfile, executionResults map[string]*types.Result) map[string]*framework.SchedulerProfile {
func (p *AllProfilesPicker) Pick(ctx context.Context, request *types.LLMRequest, profiles map[string]*framework.SchedulerProfile,
executionResults map[string]*types.Result) map[string]*framework.SchedulerProfile {
if len(profiles) == len(executionResults) { // all profiles have been executed already in previous call
return map[string]*framework.SchedulerProfile{}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/epp/scheduling/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *Scheduler) Schedule(ctx context.Context, request *types.LLMRequest) (ma

for { // get the next set of profiles to run iteratively based on the request and the previous execution results
before := time.Now()
profiles := s.profilePicker.Pick(request, s.profiles, profileExecutionResults)
profiles := s.profilePicker.Pick(ctx, request, s.profiles, profileExecutionResults)
metrics.RecordSchedulerPluginProcessingLatency(framework.ProfilePickerType, s.profilePicker.Name(), time.Since(before))
if len(profiles) == 0 { // profile picker didn't pick any profile to run
break
Expand Down