base

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: 13 Imported by: 0

Documentation

Overview

Package base is using for HuaWei Ascend pin affinity schedule.

Package base is using for HuaWei Ascend pin affinity schedule.

Package base is using for HuaWei Ascend pin affinity schedule.

Package base is using for HuaWei Ascend pin affinity schedule.

Index

Constants

View Source
const PluginName = "base"

PluginName plugin name

Variables

This section is empty.

Functions

func New

func New(name string) plugin.ISchedulerPlugin

New return npu plugin

Types

type AscendHandler

type AscendHandler interface {
	plugin.ISchedulerPlugin
	SetSchedulerAttr(util.SchedulerJobAttr)
	SetSchedulerEnv(plugin.ScheduleEnv)
	SetMaxNodeNPUNum(int)
	SetMaxCardNPUNum(int)
}

AscendHandler ascend npu event handler

type NPUHandler

type NPUHandler struct {
	plugin.SchedulerPlugin
	util.SchedulerJobAttr
	plugin.ScheduleEnv
	ReHandle      *rescheduling.ReScheduler
	MaxNodeNPUNum int
	MaxCardNPUNum int
}

NPUHandler base npu handler

func (*NPUHandler) CheckNodeNPUByTask

func (tp *NPUHandler) CheckNodeNPUByTask(task *api.TaskInfo, node plugin.NPUNode) error

CheckNodeNPUByTask check nod npu meet task req

func (*NPUHandler) GetCardNumGroupsFromTop

func (tp *NPUHandler) GetCardNumGroupsFromTop(nodeNPUTopology []int) [][]int

GetCardNumGroupsFromTop get the chip for each card from nodeTop

func (*NPUHandler) GetReHandle

func (tp *NPUHandler) GetReHandle() interface{}

GetReHandle do something after schedule

func (*NPUHandler) GetTaskReqNPUNum

func (tp *NPUHandler) GetTaskReqNPUNum(task *api.TaskInfo) (int, error)

GetTaskReqNPUNum get task require npu num

func (*NPUHandler) GetUsableTopFromNode

func (tp *NPUHandler) GetUsableTopFromNode(node plugin.NPUNode) ([]int, error)

GetUsableTopFromNode Get ascend node usable top.

func (*NPUHandler) InitMyJobPlugin

func (tp *NPUHandler) InitMyJobPlugin(attr util.SchedulerJobAttr, env plugin.ScheduleEnv) error

InitMyJobPlugin set attr and env for plugin

func (*NPUHandler) JudgeNodeAndTaskNPU

func (tp *NPUHandler) JudgeNodeAndTaskNPU(taskNPU int, nodeNPUTopology []int) error

JudgeNodeAndTaskNPU judge node and task npu num

func (*NPUHandler) PreStartAction

func (tp *NPUHandler) PreStartAction(_ interface{}, ssn *framework.Session) error

PreStartAction do something before schedule PreStartAction pre-processing actions for rescheduling

func (*NPUHandler) PreStopAction

func (tp *NPUHandler) PreStopAction(env *plugin.ScheduleEnv) error

PreStopAction post-processing actions for re-scheduling

func (*NPUHandler) ReleaseAnnotation

func (tp *NPUHandler) ReleaseAnnotation(_ *api.TaskInfo, _ plugin.NPUNode) *plugin.NPUNode

ReleaseAnnotation release annotation

func (*NPUHandler) ScoreBestNPUNodes

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

ScoreBestNPUNodes score node by calculate task req npu num and node npu top

func (*NPUHandler) SelectNPUFromNode

func (tp *NPUHandler) SelectNPUFromNode(task *api.TaskInfo, node plugin.NPUNode) ([]int, error)

SelectNPUFromNode select npu from node for task

func (*NPUHandler) SetMaxCardNPUNum

func (tp *NPUHandler) SetMaxCardNPUNum(num int)

SetMaxCardNPUNum set max npu num per card

func (*NPUHandler) SetMaxNodeNPUNum

func (tp *NPUHandler) SetMaxNodeNPUNum(num int)

SetMaxNodeNPUNum set max npu num per node

func (*NPUHandler) SetNPUTopologyToPodFn

func (tp *NPUHandler) SetNPUTopologyToPodFn(task *api.TaskInfo, top []int, node plugin.NPUNode)

SetNPUTopologyToPodFn set task select npu to pod annotation

func (*NPUHandler) SetSchedulerAttr

func (tp *NPUHandler) SetSchedulerAttr(attr util.SchedulerJobAttr)

SetSchedulerAttr set scheduler attribute for plugin

func (*NPUHandler) SetSchedulerEnv

func (tp *NPUHandler) SetSchedulerEnv(env plugin.ScheduleEnv)

SetSchedulerEnv set scheduler env for plugin

func (*NPUHandler) UpdateNodeInfo

func (tp *NPUHandler) UpdateNodeInfo(node plugin.NPUNode, usedTop []int) *plugin.NPUNode

UpdateNodeInfo update node info

func (*NPUHandler) UseAnnotation

func (tp *NPUHandler) UseAnnotation(task *api.TaskInfo, node plugin.NPUNode) *plugin.NPUNode

UseAnnotation select npu for task from node

func (*NPUHandler) ValidNPUJob

func (tp *NPUHandler) ValidNPUJob() *api.ValidateResult

ValidNPUJob check job req npu num

Jump to

Keyboard shortcuts

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