From 7c566a13f53de88213b252cbd01b5d1337c83584 Mon Sep 17 00:00:00 2001 From: houyuxi Date: Mon, 21 Jul 2025 11:49:10 +0800 Subject: [PATCH] updated usage example of hygon assigning tasks to specific DCUs Signed-off-by: houyuxi --- .../examples/specify-certain-cards.md | 24 ++++++++++++++++++ .../specify-device-uuid-to-use.md | 17 +++++++++++++ .../examples/specify-certain-cards.md | 25 +++++++++++++++++++ .../specify-device-uuid-to-use.md | 18 +++++++++++++ sidebars.js | 4 ++- 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 docs/userguide/Hygon-device/examples/specify-certain-cards.md create mode 100644 docs/userguide/Hygon-device/specify-device-uuid-to-use.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/examples/specify-certain-cards.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/specify-device-uuid-to-use.md diff --git a/docs/userguide/Hygon-device/examples/specify-certain-cards.md b/docs/userguide/Hygon-device/examples/specify-certain-cards.md new file mode 100644 index 00000000..56970eee --- /dev/null +++ b/docs/userguide/Hygon-device/examples/specify-certain-cards.md @@ -0,0 +1,24 @@ +--- +title: Assign task to certain DCU cards +--- + +## Assign task to certain DCU cards + +To assign a task to certain DCUs, you need only to assign the `hygon.com/use-gpuuuid` in annotations field. + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: gpu-pod + annotations: + hygon.com/use-gpuuuid: "DCU-123,DCU-456" # specify the DCU UUIDs, comma-separated +spec: + containers: + - name: ubuntu-container + image: ubuntu:18.04 + command: ["bash", "-c", "sleep 86400"] + resources: + limits: + hygon.com/dcunum: 1 # requesting DCU +``` \ No newline at end of file diff --git a/docs/userguide/Hygon-device/specify-device-uuid-to-use.md b/docs/userguide/Hygon-device/specify-device-uuid-to-use.md new file mode 100644 index 00000000..0253c5d3 --- /dev/null +++ b/docs/userguide/Hygon-device/specify-device-uuid-to-use.md @@ -0,0 +1,17 @@ +--- +title: Assign to certain device +--- + +## Assign to certain device type + +Sometimes a task may wish to run on a certain DCU, it can fill the `hygon.com/use-gpuuuid` field in pod annotation. HAMi scheduler will try to fit in device with that uuid. + +For example, a task with the following annotation will be assigned to the device with uuid `DCU-123456` + +```yaml +metadata: + annotations: + hygon.com/use-gpuuuid: "DCU-123456" +``` + +> **NOTICE:** *Each DCU UUID is unique in a cluster, so assign a certain UUID means assigning this task to certain node with that DCU* \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/examples/specify-certain-cards.md b/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/examples/specify-certain-cards.md new file mode 100644 index 00000000..afa0045b --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/examples/specify-certain-cards.md @@ -0,0 +1,25 @@ +--- +title: 将任务分配给特定的 DCU +translated: true +--- + +## 将任务分配给特定的 DCU + +要将任务分配给特定的 DCU,只需在注释字段中分配 `hygon.com/use-gpuuuid` + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: gpu-pod + annotations: + hygon.com/use-gpuuuid: "DCU-123,DCU-456" # 指定以逗号分隔的 DCU UUID +spec: + containers: + - name: ubuntu-container + image: ubuntu:18.04 + command: ["bash", "-c", "sleep 86400"] + resources: + limits: + hygon.com/dcunum: 1 # 请求两个 DCU 卡 +``` \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/specify-device-uuid-to-use.md b/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/specify-device-uuid-to-use.md new file mode 100644 index 00000000..1d4544ae --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/userguide/Hygon-device/specify-device-uuid-to-use.md @@ -0,0 +1,18 @@ +--- +title: 分配到特定设备 +translated: true +--- + +## 分配到特定设备类型 + +有时任务可能希望在某个特定的DCU上运行,可以在pod注释中填写`hygon.com/use-gpuuuid`字段。HAMi调度器将尝试匹配具有该UUID的设备。 + +例如,具有以下注释的任务将被分配到UUID为`DCU-123456`的设备上 + +```yaml +metadata: + annotations: + hygon.com/use-gpuuuid: "DCU-123456" +``` + +> **注意:** *每个DCU UUID在集群中是唯一的,因此分配某个UUID意味着将此任务分配到具有该DCU的特定节点上* \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 7a3d9e3e..fae85e09 100644 --- a/sidebars.js +++ b/sidebars.js @@ -100,12 +100,14 @@ module.exports = { "userguide/Hygon-device/enable-hygon-dcu-sharing", "userguide/Hygon-device/specify-device-memory-usage", "userguide/Hygon-device/specify-device-core-usage", + "userguide/Hygon-device/specify-device-uuid-to-use", { "type": "category", "label": "Examples", "items": [ "userguide/Hygon-device/examples/allocate-core-and-memory", - "userguide/Hygon-device/examples/allocate-exclusive" + "userguide/Hygon-device/examples/allocate-exclusive", + "userguide/Hygon-device/examples/specify-certain-cards", ] } ]