Documentation
¶
Overview ¶
Package gpuallocator handles GPU allocation
Index ¶
- func RefreshGPUNodeCapacity(ctx context.Context, k8sClient client.Client, node *tfv1.GPUNode, ...) ([]string, error)
- type AllocRequest
- type CompactFirst
- type GpuAllocator
- func (s *GpuAllocator) Alloc(ctx context.Context, req AllocRequest) ([]*tfv1.GPU, error)
- func (s *GpuAllocator) Dealloc(ctx context.Context, workloadNameNamespace tfv1.NameNamespace, ...) error
- func (s *GpuAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) (<-chan struct{}, error)
- func (s *GpuAllocator) Stop()
- type LowLoadFirst
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllocRequest ¶ added in v1.34.0
type AllocRequest struct { // Name of the GPU pool to allocate from PoolName string // Namespace information for the workload WorkloadNameNamespace tfv1.NameNamespace // Resource requirements for the allocation Request tfv1.Resource // Number of GPUs to allocate Count uint // Specific GPU model to allocate, empty string means any model GPUModel string }
AllocRequest encapsulates all parameters needed for GPU allocation
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 ¶
SelectGPUs selects multiple GPUs from the same node with the least available resources (most packed)
type GpuAllocator ¶
func NewGpuAllocator ¶
func (*GpuAllocator) Alloc ¶
func (s *GpuAllocator) Alloc(ctx context.Context, req AllocRequest) ([]*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, workloadNameNamespace tfv1.NameNamespace, request tfv1.Resource, gpus []types.NamespacedName) error
Dealloc a request from gpu to release available resources on it.
func (*GpuAllocator) SetupWithManager ¶
func (s *GpuAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) (<-chan struct{}, error)
SetupWithManager sets up the GpuAllocator with the Manager.
type LowLoadFirst ¶
type LowLoadFirst struct{}
LowLoadFirst selects GPU with maximum available resources (least utilized) to distribute workloads more evenly across GPUs
func (LowLoadFirst) SelectGPUs ¶
SelectGPUs selects multiple GPUs from the same node with the most available resources (least loaded)