Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

add 'enflame.com/dtu' to rest-server #5139

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions src/rest-server/src/models/v2/job/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ const generateTaskRole = (
'github.com/fuse': 1,
'nvidia.com/gpu':
config.taskRoles[taskRole].resourcePerInstance.gpu,
'enflame.com/dtu':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. we don't have such card to test or use
  2. this pr won't work and it will break all nodes

pls feel free to keep a fork to support your new card, and pls do test your code before submitting a pr

config.taskRoles[taskRole].resourcePerInstance.gpu,
Comment on lines +487 to +488
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for? could you include a clear and detailed description explaining the reasons for the changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enflame DTU(Deep Thinking Unit) is the AI process card from enflame.
With help of enflame k8s device plugin, the DTUs in worker nodes can be detected and allocated by K8S.
This commit adds the 'enflame.com/dtu' as another GPU resource to OpenPAI.

...(infinibandDevice && { 'rdma/hca': 1 }),
},
},
Expand Down
4 changes: 4 additions & 0 deletions src/rest-server/src/models/v2/virtual-cluster/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const getPodsInfo = async () => {
} else {
podInfo.resourcesUsed.gpu =
k8s.atoi(resourceRequest['nvidia.com/gpu']) +
k8s.atoi(resourceRequest['enflame.com/dtu']) +
k8s.atoi(resourceRequest['amd.com/gpu']);
}
return podInfo;
Expand Down Expand Up @@ -177,6 +178,7 @@ const getNodeResource = async () => {
const nodeName = node.metadata.name;
const gpuNumber =
k8s.atoi(node.status.capacity['nvidia.com/gpu']) +
k8s.atoi(node.status.capacity['enflame.com/dtu']) +
k8s.atoi(node.status.capacity['amd.com/gpu']);
nodeResource[nodeName] = {
gpuUsed: 0,
Expand Down Expand Up @@ -285,6 +287,7 @@ const getVcList = async () => {
(sum, node) =>
sum +
k8s.atoi(node.status.capacity['nvidia.com/gpu']) +
k8s.atoi(node.status.capacity['enflame.com/dtu']) +
k8s.atoi(node.status.capacity['amd.com/gpu']),
0,
),
Expand All @@ -304,6 +307,7 @@ const getVcList = async () => {
(sum, node) =>
sum +
k8s.atoi(node.status.capacity['nvidia.com/gpu']) +
k8s.atoi(node.status.capacity['enflame.com/dtu']) +
k8s.atoi(node.status.capacity['amd.com/gpu']),
0,
),
Expand Down