vnpu

package
v6.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Package vnpu is using for HuaWei Ascend pin vnpu allocation.

Index

Constants

View Source
const (
	// PodEventMsgNoResourceFailed dp pod segment failed msg for not enough resource.
	PodEventMsgNoResourceFailed = "NoNPUResource"
	// PodEventMsgDyCutFailed dp pod segment failed msg for DCMI failed.
	PodEventMsgDyCutFailed = "NPUSegmentFailed"
	// PodEventReasonAllocateFailed dp pod segment failed reason
	PodEventReasonAllocateFailed = "UnexpectedAdmissionError"
	// DyCutFailedError for device-plugin cut failed error.
	DyCutFailedError = "chipDyCutErr"
	// PodEventTypeAllocateFailed dp pod segment failed type
	PodEventTypeAllocateFailed = "Warning"

	// Ascend310PCard test name of Ascend310P
	Ascend310PCard = "Ascend310P-8"
)

Variables

This section is empty.

Functions

func GetSegmentFailureTaskIDs

func GetSegmentFailureTaskIDs(ssn *framework.Session, namespace string) []api.TaskID

GetSegmentFailureTaskIDs get segmentation failed pod from pod event

Types

type Action

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

Action vnpu actions

type DynamicVNPU

type DynamicVNPU struct {
	DowngradeCache map[string][]string // taskName: nodes
	// for Concurrent task. not same core request task only has one on a node in same time.
	// nodeName: templateName:taskUID
	ConCache map[string]map[string]map[api.TaskID]struct{}
	// contains filtered or unexported fields
}

DynamicVNPU dynamic VNPU struct.

func (*DynamicVNPU) GetTemplateByResReq

func (tp *DynamicVNPU) GetTemplateByResReq(taskResReq util.VResource, vt VTemplate) (string, error)

GetTemplateByResReq get template by resource request.

func (*DynamicVNPU) ReleaseAnnotation

func (tp *DynamicVNPU) ReleaseAnnotation(task *api.TaskInfo, node plugin.NPUNode) *plugin.NPUNode

ReleaseAnnotation release Annotation, in dy is release ConCache.

func (*DynamicVNPU) ScoreBestNPUNodes

func (tp *DynamicVNPU) ScoreBestNPUNodes(task *api.TaskInfo, nodes []*api.NodeInfo, scoreMap map[string]float64) error

ScoreBestNPUNodes node with the least free resource would be sorted to higher rank

func (*DynamicVNPU) SetNPUTopologyToPodFn

func (tp *DynamicVNPU) SetNPUTopologyToPodFn(task *api.TaskInfo, node plugin.NPUNode, taskResReq util.VResource,
	allocChipID string, chipVTemplate VTemplate)

SetNPUTopologyToPodFn write chip to pod annotation AscendNPUCore

func (*DynamicVNPU) UpdateNodeInfo

func (tp *DynamicVNPU) UpdateNodeInfo(node plugin.NPUNode, allocChipID string,
	taskResReq util.VResource) *plugin.NPUNode

UpdateNodeInfo vnpu update npuNode after allocation

func (*DynamicVNPU) UpdateNodeInfoSegment

func (tp *DynamicVNPU) UpdateNodeInfoSegment(node plugin.NPUNode, allocChipID string,
	taskResReq util.VResource) *plugin.NPUNode

UpdateNodeInfoSegment vnpu update npuNode after allocation for segmentation tasks

func (*DynamicVNPU) UpdateNodeInfoWhole

func (tp *DynamicVNPU) UpdateNodeInfoWhole(node plugin.NPUNode, allocChipIDs string) *plugin.NPUNode

UpdateNodeInfoWhole vnpu update npuNode after allocation for whole card tasks

func (*DynamicVNPU) UseAnnotation

func (tp *DynamicVNPU) UseAnnotation(task *api.TaskInfo, node plugin.NPUNode, taskResReq util.VResource,
	chipVTemplate VTemplate) *plugin.NPUNode

UseAnnotation write task use vnpu to pod annotation

type StaticVNPU

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

StaticVNPU Static VNPU struct.

func (*StaticVNPU) CheckNodeNPUByTask

func (tp *StaticVNPU) CheckNodeNPUByTask(task *api.TaskInfo, node plugin.NPUNode, _ util.VResource) error

CheckNodeNPUByTask pass for static

func (*StaticVNPU) ScoreBestNPUNodes

func (tp *StaticVNPU) ScoreBestNPUNodes(task *api.TaskInfo, _ []*api.NodeInfo, scoreMap map[string]float64) error

ScoreBestNPUNodes pass for static

func (*StaticVNPU) UseAnnotation

func (tp *StaticVNPU) UseAnnotation(task *api.TaskInfo, node plugin.NPUNode, _ util.VResource,
	_ VTemplate) *plugin.NPUNode

UseAnnotation pass for static

type VTemplate

type VTemplate struct {
	Data map[string]util.VResource
	Temp string
}

VTemplate vNPU template

type VirtualNPU

type VirtualNPU struct {
	StaticByConf bool
	VT           VTemplate
	StaticVNPU
	DynamicVNPU
}

VirtualNPU vnpu struct

func (*VirtualNPU) CheckNodeNPUByDyTask

func (tp *VirtualNPU) CheckNodeNPUByDyTask(task *api.TaskInfo, node plugin.NPUNode, taskResReq util.VResource) error

CheckNodeNPUByDyTask check chip on node has enough resource, fault chips are not in list, unstable excluded

func (*VirtualNPU) GetTaskResource

func (tp *VirtualNPU) GetTaskResource(task *api.TaskInfo, node plugin.NPUNode) (util.VResource, error)

GetTaskResource get vTask used resource.

func (*VirtualNPU) IsNodeHasDifferentUnFinishedTask

func (tp *VirtualNPU) IsNodeHasDifferentUnFinishedTask(taskInfo *api.TaskInfo, nodeInf plugin.NPUNode,
	taskResReq util.VResource) error

IsNodeHasDifferentUnFinishedTask judge the node wither has the different template unfinished job.

Jump to

Keyboard shortcuts

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