scheduler

package
v1.26.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactFirst

type CompactFirst struct{}

CompactFirst selects GPU with minimum available resources (most utilized) to efficiently pack workloads and maximize GPU utilization

func (CompactFirst) SelectGPU

func (c CompactFirst) SelectGPU(gpus []tfv1.GPU) (*tfv1.GPU, error)

SelectGPU implements Strategy interface for CompactFirst strategy It selects the GPU with the least available resources (most packed)

type FilterRegistry

type FilterRegistry struct {
	// contains filtered or unexported fields
}

FilterRegistry provides an immutable collection of GPU filters with methods to create new instances with additional filters

func NewFilterRegistry

func NewFilterRegistry() *FilterRegistry

NewFilterRegistry creates a new empty filter registry

func (*FilterRegistry) Apply

func (fr *FilterRegistry) Apply(ctx context.Context, gpus []tfv1.GPU) ([]tfv1.GPU, error)

Apply applies the filters in this registry to the given GPU list Filters are applied in the order they were added (parent filters first)

func (*FilterRegistry) With

func (fr *FilterRegistry) With(filters ...GPUFilter) *FilterRegistry

With creates a new FilterRegistry with the provided filters added The original FilterRegistry is not modified

type GPUFilter

type GPUFilter interface {
	// Filter filters the list of GPUs and returns only those that pass the filter criteria
	// The implementation should not modify the input slice
	Filter(ctx context.Context, gpus []tfv1.GPU) ([]tfv1.GPU, error)
}

GPUFilter defines an interface for filtering GPU candidates

type LowLoadFirst

type LowLoadFirst struct{}

LowLoadFirst selects GPU with maximum available resources (least utilized) to distribute workloads more evenly across GPUs

func (LowLoadFirst) SelectGPU

func (l LowLoadFirst) SelectGPU(gpus []tfv1.GPU) (*tfv1.GPU, error)

SelectGPU implements Strategy interface for LowLoadFirst strategy It selects the GPU with the most available resources (least loaded)

type PhaseFilter

type PhaseFilter struct {
	// contains filtered or unexported fields
}

PhaseFilter filters GPUs based on their operational phase

func NewPhaseFilter

func NewPhaseFilter(allowedPhases ...tfv1.TensorFusionGPUPhase) *PhaseFilter

NewPhaseFilter creates a new PhaseFilter with the specified allowed phases

func (*PhaseFilter) Filter

func (f *PhaseFilter) Filter(_ context.Context, gpus []tfv1.GPU) ([]tfv1.GPU, error)

Filter implements GPUFilter.Filter

type ResourceFilter

type ResourceFilter struct {
	// contains filtered or unexported fields
}

ResourceFilter filters GPUs based on available resources

func NewResourceFilter

func NewResourceFilter(required tfv1.Resource) *ResourceFilter

NewResourceFilter creates a new ResourceFilter with the specified resource requirements

func (*ResourceFilter) Filter

func (f *ResourceFilter) Filter(_ context.Context, gpus []tfv1.GPU) ([]tfv1.GPU, error)

Filter implements GPUFilter.Filter

type Scheduler

type Scheduler struct {
	client.Client
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(client client.Client) Scheduler

func (*Scheduler) Release

func (s *Scheduler) Release(ctx context.Context, request tfv1.Resource, gpu *tfv1.GPU) error

Release releases a request from a gpu.

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(ctx context.Context, poolName string, request tfv1.Resource) (*tfv1.GPU, error)

Schedule schedules a request to a gpu.

type Strategy

type Strategy interface {
	SelectGPU(gpus []tfv1.GPU) (*tfv1.GPU, error)
}

func NewStrategy

func NewStrategy(placementMode tfv1.PlacementMode) Strategy

NewStrategy creates a strategy based on the placement mode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL