Documentation
¶
Overview ¶
Package scheduling implements request scheduling algorithms.
Index ¶
- type Scheduler
- type SchedulerConfig
- type SchedulerProfile
- func (p *SchedulerProfile) AddPlugins(pluginObjects ...plugin.Plugin) error
- func (p *SchedulerProfile) Run(ctx context.Context, request *fwksched.InferenceRequest, ...) (*fwksched.ProfileRunResult, error)
- func (p *SchedulerProfile) String() string
- func (p *SchedulerProfile) WithFilters(filters ...fwksched.Filter) *SchedulerProfile
- func (p *SchedulerProfile) WithPicker(picker fwksched.Picker) *SchedulerProfile
- func (p *SchedulerProfile) WithScorers(scorers ...*WeightedScorer) *SchedulerProfile
- type WeightedScorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewSchedulerWithConfig ¶
func NewSchedulerWithConfig(config *SchedulerConfig) *Scheduler
NewSchedulerWithConfig returns a new scheduler with the given scheduler plugins configuration.
type SchedulerConfig ¶
type SchedulerConfig struct {
// contains filtered or unexported fields
}
SchedulerConfig provides a configuration for the scheduler which influence routing decisions.
func NewSchedulerConfig ¶
func NewSchedulerConfig(profileHandler fwksched.ProfileHandler, profiles map[string]fwksched.SchedulerProfile) *SchedulerConfig
NewSchedulerConfig creates a new SchedulerConfig object and returns its pointer.
func (*SchedulerConfig) String ¶
func (c *SchedulerConfig) String() string
type SchedulerProfile ¶
type SchedulerProfile struct {
// contains filtered or unexported fields
}
SchedulerProfile provides a profile configuration for the scheduler which influence routing decisions.
func NewSchedulerProfile ¶
func NewSchedulerProfile() *SchedulerProfile
NewSchedulerProfile creates a new SchedulerProfile object and returns its pointer.
func (*SchedulerProfile) AddPlugins ¶
func (p *SchedulerProfile) AddPlugins(pluginObjects ...plugin.Plugin) error
AddPlugins adds the given plugins to all scheduler plugins according to the interfaces each plugin implements. A plugin may implement more than one scheduler plugin interface. Special Case: In order to add a scorer, one must use the scorer.NewWeightedScorer function in order to provide a weight. if a scorer implements more than one interface, supplying a WeightedScorer is sufficient. The function will take the internal scorer object and register it to all interfaces it implements.
func (*SchedulerProfile) Run ¶
func (p *SchedulerProfile) Run(ctx context.Context, request *fwksched.InferenceRequest, candidateEndpoints []fwksched.Endpoint) (*fwksched.ProfileRunResult, error)
Run runs a SchedulerProfile. It invokes all the SchedulerProfile plugins for the given request in this order - Filters, Scorers, Picker. After completing all, it returns the result.
func (*SchedulerProfile) String ¶
func (p *SchedulerProfile) String() string
func (*SchedulerProfile) WithFilters ¶
func (p *SchedulerProfile) WithFilters(filters ...fwksched.Filter) *SchedulerProfile
WithFilters sets the given filter plugins as the Filter plugins. if the SchedulerProfile has Filter plugins, this call replaces the existing plugins with the given ones.
func (*SchedulerProfile) WithPicker ¶
func (p *SchedulerProfile) WithPicker(picker fwksched.Picker) *SchedulerProfile
WithPicker sets the given picker plugins as the Picker plugin. if the SchedulerProfile has Picker plugin, this call replaces the existing plugin with the given one.
func (*SchedulerProfile) WithScorers ¶
func (p *SchedulerProfile) WithScorers(scorers ...*WeightedScorer) *SchedulerProfile
WithScorers sets the given scorer plugins as the Scorer plugins. if the SchedulerProfile has Scorer plugins, this call replaces the existing plugins with the given ones.
type WeightedScorer ¶
WeightedScorer is a struct that encapsulates a scorer with its weight.
func NewWeightedScorer ¶
func NewWeightedScorer(scorer fwksched.Scorer, weight float64) *WeightedScorer
NewWeightedScorer initializes a new WeightedScorer and returns its pointer.
func (*WeightedScorer) Weight ¶
func (s *WeightedScorer) Weight() float64
Weight returns the weight of the scorer.