Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TKE qGPU resource #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/apis/types/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ const (
UserNameIdLabel = "arena.kubeflow.org/uid"
UserNameNameLabel = "arena.kubeflow.org/username"
)

const (
QGPUCoreResourceName = "tke.cloud.tencent.com/qgpu-core"
QGPUMemoryResourceName = "tke.cloud.tencent.com/qgpu-memory"
QGPUAllocationLabel = "tke.cloud.tencent.com/qgpu"
QGPUNodeLabels = "qgpu-device-enable=enable"
QGPUIndexPrefix = "tke.cloud.tencent.com/qgpu-pgpu-"
)
29 changes: 29 additions & 0 deletions pkg/apis/types/gpunode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type NodeType string

const (
GPUShareNode NodeType = "GPUShare"
QGPUNode NodeType = "QGPU"
GPUExclusiveNode NodeType = "GPUExclusive"
GPUTopologyNode NodeType = "GPUTopology"
NormalNode NodeType = "Normal"
Expand Down Expand Up @@ -38,6 +39,11 @@ var NodeTypeSlice = []NodeTypeInfo{
Alias: "share",
Shorthand: "s",
},
{
Name: QGPUNode,
Alias: "qgpu",
Shorthand: "q",
},
}

type CommonNodeInfo struct {
Expand Down Expand Up @@ -148,3 +154,26 @@ type GPUTopologyNodeDevice struct {
Healthy bool `json:"healthy" yaml:"healthy"`
Status string `json:"status" yaml:"status"`
}

type QGPUNodeInfo struct {
PodInfos []QGPUPodInfo `json:"instances" yaml:"instances"`
TotalGPUMemory float64 `json:"totalGPUMemory" yaml:"totalGPUMemory"`
AllocatedGPUMemory float64 `json:"allocatedGPUMemory" yaml:"allocatedGPUMemory"`
Devices []QGPUNodeDevice `json:"devices" yaml:"devices"`
CommonGPUNodeInfo `yaml:",inline" json:",inline"`
CommonNodeInfo `yaml:",inline" json:",inline"`
}

type QGPUPodInfo struct {
Name string `json:"name" yaml:"name"`
Namespace string `json:"namespace" yaml:"namespace"`
Status string `json:"status" yaml:"status"`
RequestMemory float64 `json:"requestGPUMemory" yaml:"requestGPUMemory"`
Allocation map[string]float64 `json:"allocation" yaml:"allocation"`
}

type QGPUNodeDevice struct {
Id string `json:"id" yaml:"id"`
TotalGPUMemory float64 `json:"totalGPUMemory" yaml:"totalGPUMemory"`
AllocatedGPUMemory float64 `json:"allocatedGPUMemory" yaml:"allocatedGPUMemory"`
}
1 change: 1 addition & 0 deletions pkg/topnode/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (b *baseNode) Type() types.NodeType {
// NewNormalNodeProcesser must be placed at last,it will match all unknown nodes
func GetSupportedNodePorcessers() []NodeProcesser {
return []NodeProcesser{
NewQGPUNodeProcesser(),
NewGPUShareNodeProcesser(),
NewGPUTopologyNodeProcesser(),
NewGPUExclusiveNodeProcesser(),
Expand Down
Loading