v1alpha1

package
v0.0.0-...-da6b835 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupName = "gpu.nvidia.com"
	Version   = "v1alpha1"

	GpuConfigKind         = "GpuConfig"
	MigDeviceConfigKind   = "MigDeviceConfig"
	ImexChannelConfigKind = "ImexChannelConfig"
)
View Source
const (
	TimeSlicingStrategy = "TimeSlicing"
	MpsStrategy         = "MPS"
)

These constants represent the different Sharing strategies.

Variables

Decoder implements a decoder for objects in this API group.

View Source
var ErrInvalidDeviceSelector error = errors.New("invalid device")

ErrInvalidDeviceSelector indicates that a device index or UUID was invalid.

View Source
var ErrInvalidLimit error = errors.New("invalid limit")

ErrInvalidLimit indicates that a limit was invalid.

Functions

This section is empty.

Types

type GpuConfig

type GpuConfig struct {
	metav1.TypeMeta `json:",inline"`
	Sharing         *GpuSharing `json:"sharing,omitempty"`
}

GpuConfig holds the set of parameters for configuring a GPU.

func DefaultGpuConfig

func DefaultGpuConfig() *GpuConfig

DefaultGpuConfig provides the default GPU configuration.

func (*GpuConfig) DeepCopy

func (in *GpuConfig) DeepCopy() *GpuConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GpuConfig.

func (*GpuConfig) DeepCopyInto

func (in *GpuConfig) DeepCopyInto(out *GpuConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GpuConfig) DeepCopyObject

func (in *GpuConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GpuConfig) Normalize

func (c *GpuConfig) Normalize() error

Normalize updates a GpuConfig config with implied default values based on other settings.

func (*GpuConfig) Validate

func (c *GpuConfig) Validate() error

Validate ensures that GpuConfig has a valid set of values.

type GpuSharing

type GpuSharing struct {
	Strategy          GpuSharingStrategy `json:"strategy"`
	TimeSlicingConfig *TimeSlicingConfig `json:"timeSlicingConfig,omitempty"`
	MpsConfig         *MpsConfig         `json:"mpsConfig,omitempty"`
}

GpuSharing holds the current sharing strategy for GPUs and its settings.

func (*GpuSharing) DeepCopy

func (in *GpuSharing) DeepCopy() *GpuSharing

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GpuSharing.

func (*GpuSharing) DeepCopyInto

func (in *GpuSharing) DeepCopyInto(out *GpuSharing)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GpuSharing) GetMpsConfig

func (s *GpuSharing) GetMpsConfig() (*MpsConfig, error)

GetMpsConfig returns the MPS config that applies to the given strategy.

func (*GpuSharing) GetTimeSlicingConfig

func (s *GpuSharing) GetTimeSlicingConfig() (*TimeSlicingConfig, error)

GetTimeSlicingConfig returns the timeslicing config that applies to the given strategy.

func (*GpuSharing) IsMps

func (s *GpuSharing) IsMps() bool

IsMps checks if the MPS strategy is applied.

func (*GpuSharing) IsTimeSlicing

func (s *GpuSharing) IsTimeSlicing() bool

IsTimeSlicing checks if the TimeSlicing strategy is applied.

func (*GpuSharing) Validate

func (s *GpuSharing) Validate() error

Validate ensures that GpuSharing has a valid set of values.

type GpuSharingStrategy

type GpuSharingStrategy string

GpuSharingStrategy encodes the valid Sharing strategies as a string.

func (GpuSharingStrategy) Validate

func (s GpuSharingStrategy) Validate() error

Validate ensures that GpuSharingStrategy has a valid set of values.

type ImexChannelConfig

type ImexChannelConfig struct {
	metav1.TypeMeta `json:",inline"`
}

ImexChannelConfig holds the set of parameters for configuring an ImexChannel.

func DefaultImexChannelConfig

func DefaultImexChannelConfig() *ImexChannelConfig

DefaultImexChannelConfig provides the default ImexChannel configuration.

func (*ImexChannelConfig) DeepCopy

func (in *ImexChannelConfig) DeepCopy() *ImexChannelConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImexChannelConfig.

func (*ImexChannelConfig) DeepCopyInto

func (in *ImexChannelConfig) DeepCopyInto(out *ImexChannelConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImexChannelConfig) DeepCopyObject

func (in *ImexChannelConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ImexChannelConfig) Normalize

func (c *ImexChannelConfig) Normalize() error

Normalize updates a ImexChannelConfig config with implied default values based on other settings.

func (*ImexChannelConfig) Validate

func (c *ImexChannelConfig) Validate() error

Validate ensures that ImexChannelConfig has a valid set of values.

type Interface

type Interface interface {
	Normalize() error
	Validate() error
}

Interface defines the set of common APIs for all configs +k8s:deepcopy-gen=false

type MigDeviceConfig

type MigDeviceConfig struct {
	metav1.TypeMeta `json:",inline"`
	Sharing         *MigDeviceSharing `json:"sharing,omitempty"`
}

MigDeviceConfig holds the set of parameters for configuring a MIG device.

func DefaultMigDeviceConfig

func DefaultMigDeviceConfig() *MigDeviceConfig

DefaultMigDeviceConfig provides the default Mig Device configuration.

func (*MigDeviceConfig) DeepCopy

func (in *MigDeviceConfig) DeepCopy() *MigDeviceConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigDeviceConfig.

func (*MigDeviceConfig) DeepCopyInto

func (in *MigDeviceConfig) DeepCopyInto(out *MigDeviceConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MigDeviceConfig) DeepCopyObject

func (in *MigDeviceConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MigDeviceConfig) Normalize

func (c *MigDeviceConfig) Normalize() error

Normalize updates a MigDeviceConfig config with implied default values based on other settings.

func (*MigDeviceConfig) Validate

func (c *MigDeviceConfig) Validate() error

Validate ensures that MigDeviceConfig has a valid set of values.

type MigDeviceSharing

type MigDeviceSharing struct {
	Strategy  GpuSharingStrategy `json:"strategy"`
	MpsConfig *MpsConfig         `json:"mpsConfig,omitempty"`
}

MigDeviceSharing holds the current sharing strategy for MIG Devices and its settings.

func (*MigDeviceSharing) DeepCopy

func (in *MigDeviceSharing) DeepCopy() *MigDeviceSharing

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigDeviceSharing.

func (*MigDeviceSharing) DeepCopyInto

func (in *MigDeviceSharing) DeepCopyInto(out *MigDeviceSharing)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MigDeviceSharing) GetMpsConfig

func (s *MigDeviceSharing) GetMpsConfig() (*MpsConfig, error)

GetMpsConfig returns the MPS config that applies to the given strategy.

func (*MigDeviceSharing) GetTimeSlicingConfig

func (s *MigDeviceSharing) GetTimeSlicingConfig() (*TimeSlicingConfig, error)

GetTimeSlicingConfig returns the timeslicing config that applies to the given strategy.

func (*MigDeviceSharing) IsMps

func (s *MigDeviceSharing) IsMps() bool

IsMps checks if the MPS strategy is applied.

func (*MigDeviceSharing) IsTimeSlicing

func (s *MigDeviceSharing) IsTimeSlicing() bool

IsTimeSlicing checks if the TimeSlicing strategy is applied.

func (*MigDeviceSharing) Validate

func (s *MigDeviceSharing) Validate() error

Validate ensures that MigDeviceSharing has a valid set of values.

type MigDeviceSharingStrategy

type MigDeviceSharingStrategy string

MigDeviceSharingStrategy encodes the valid Sharing strategies as a string.

func (MigDeviceSharingStrategy) Validate

func (s MigDeviceSharingStrategy) Validate() error

Validate ensures that MigDeviceSharingStrategy has a valid set of values.

type MpsConfig

type MpsConfig struct {
	DefaultActiveThreadPercentage *int `json:"defaultActiveThreadPercentage,omitempty"`
	// DefaultPinnedDeviceMemoryLimit represents the pinned memory limit to be applied for all devices.
	// This can be overridden for specific devices by specifying an associated entry DefaultPerDevicePinnedMemoryLimit for the device.
	DefaultPinnedDeviceMemoryLimit *resource.Quantity `json:"defaultPinnedDeviceMemoryLimit,omitempty"`
	// DefaultPerDevicePinnedMemoryLimit represents the pinned memory limit per device associated with an MPS daemon.
	// This is defined as a map of device index or UUI to a memory limit and overrides a setting applied using DefaultPinnedDeviceMemoryLimit.
	DefaultPerDevicePinnedMemoryLimit MpsPerDevicePinnedMemoryLimit `json:"defaultPerDevicePinnedMemoryLimit,omitempty"`
}

MpsConfig provides the configuring for an MPS control daemon.

func (*MpsConfig) DeepCopy

func (in *MpsConfig) DeepCopy() *MpsConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MpsConfig.

func (*MpsConfig) DeepCopyInto

func (in *MpsConfig) DeepCopyInto(out *MpsConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MpsConfig) Validate

func (c *MpsConfig) Validate() error

Validate ensures that MpsConfig has a valid set of values.

type MpsPerDevicePinnedMemoryLimit

type MpsPerDevicePinnedMemoryLimit map[string]resource.Quantity

MpsPerDevicePinnedMemoryLimit holds the string representation of the limits across multiple devices.

func (MpsPerDevicePinnedMemoryLimit) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MpsPerDevicePinnedMemoryLimit.

func (MpsPerDevicePinnedMemoryLimit) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (MpsPerDevicePinnedMemoryLimit) Normalize

func (m MpsPerDevicePinnedMemoryLimit) Normalize(uuids []string, defaultPinnedDeviceMemoryLimit *resource.Quantity) (map[string]string, error)

Normalize converts the specified per-device pinned memory limits to limits for the devices that are to be allocated. If provided, the defaultPinnedDeviceMemoryLimit is applied to each device before being overridden by specific values.

type Sharing

type Sharing interface {
	IsTimeSlicing() bool
	IsMps() bool
	GetTimeSlicingConfig() (*TimeSlicingConfig, error)
	GetMpsConfig() (*MpsConfig, error)
}

Sharing provides methods to check if a given sharing strategy is selected and grab its configuration. +k8s:deepcopy-gen=false

type TimeSliceInterval

type TimeSliceInterval string

TimeSliceInterval encodes the valid timeslice duration as a string.

const (
	DefaultTimeSlice TimeSliceInterval = "Default"
	ShortTimeSlice   TimeSliceInterval = "Short"
	MediumTimeSlice  TimeSliceInterval = "Medium"
	LongTimeSlice    TimeSliceInterval = "Long"
)

These constants represent the different TimeSlicing configurations.

func (TimeSliceInterval) Int

func (t TimeSliceInterval) Int() int

Int returns the integer representations of a timeslice duration.

func (TimeSliceInterval) Validate

func (t TimeSliceInterval) Validate() error

Validate ensures that TimeSliceInterval has a valid set of values.

type TimeSlicingConfig

type TimeSlicingConfig struct {
	Interval *TimeSliceInterval `json:"interval,omitempty"`
}

TimeSlicingSettings provides the settings for CUDA time-slicing.

func (*TimeSlicingConfig) DeepCopy

func (in *TimeSlicingConfig) DeepCopy() *TimeSlicingConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeSlicingConfig.

func (*TimeSlicingConfig) DeepCopyInto

func (in *TimeSlicingConfig) DeepCopyInto(out *TimeSlicingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TimeSlicingConfig) Validate

func (c *TimeSlicingConfig) Validate() error

Validate ensures that TimeSlicingConfig has a valid set of values.

Jump to

Keyboard shortcuts

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