Documentation
¶
Overview ¶
Package gpuallocator handles GPU allocation
Index ¶
- func RefreshGPUNodeCapacity(ctx context.Context, k8sClient client.Client, node *tfv1.GPUNode, ...) ([]string, error)
- type CompactFirst
- type GpuAllocator
- func (s *GpuAllocator) Alloc(ctx context.Context, poolName string, workloadNameNamespace tfv1.NameNamespace, ...) ([]*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 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, poolName string, workloadNameNamespace tfv1.NameNamespace, request tfv1.Resource, count uint, gpuModel string, ) ([]*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)