gpuallocator

package
v1.28.0 Latest Latest
Warning

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

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

Documentation

Overview

Package gpuallocator handles GPU allocation

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) SelectGPUs

func (c CompactFirst) SelectGPUs(gpus []tfv1.GPU, count uint) ([]*tfv1.GPU, error)

SelectGPUs selects multiple GPUs from the same node with the least available resources (most packed)

type GpuAllocator

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

func NewGpuAllocator

func NewGpuAllocator(ctx context.Context, client client.Client, syncInterval time.Duration) *GpuAllocator

func (*GpuAllocator) Alloc

func (s *GpuAllocator) Alloc(
	ctx context.Context,
	poolName string,
	request tfv1.Resource,
	count uint,
) ([]*tfv1.GPU, error)

Alloc allocates a request to a gpu or multiple gpus from the same node.

func (*GpuAllocator) Dealloc

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

Dealloc deallocates a request from a gpu.

func (*GpuAllocator) SetupWithManager

func (s *GpuAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) (<-chan struct{}, error)

SetupWithManager sets up the GpuAllocator with the Manager.

func (*GpuAllocator) Stop

func (s *GpuAllocator) Stop()

Stop stops all background goroutines

type LowLoadFirst

type LowLoadFirst struct{}

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

func (LowLoadFirst) SelectGPUs

func (l LowLoadFirst) SelectGPUs(gpus []tfv1.GPU, count uint) ([]*tfv1.GPU, error)

SelectGPUs selects multiple GPUs from the same node with the most available resources (least loaded)

type Strategy

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

func NewStrategy

func NewStrategy(placementMode tfv1.PlacementMode) Strategy

NewStrategy creates a strategy based on the placement mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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