Enable Enflame GCU Sharing
Introduction
HAMi now supports Enflame DRS hard partition scheduling, aligned with Enflame native scheduler behavior.
DRS is a hard-slice mode similar to NVIDIA MIG and Ascend VNPU templates.
Prerequisites
- Enflame gcushare-device-plugin >= 2.2.14 (please consult your device provider; only
gcushare-device-pluginis needed, do not installgcushare-scheduler-plugin) - driver version >= 1.8.7
- kubernetes >= 1.24
- enflame-container-toolkit >= 2.0.50
Enable Enflame DRS Scheduling
- Deploy
gcushare-device-pluginon Enflame nodes (please consult your device provider to acquire its package and documentation)
Install only gcushare-device-plugin. Do not install the gcushare-scheduler-plugin package.
Follow Online installation to deploy HAMi. Keep devices.enflame.enabled=true (the default). This registers the vendor resources with the bundled scheduler extender; the vendor plugin or toolkit must be installed separately. See the Chart values reference for devices.enflame.*.
The default resource names are:
enflame.com/drs-gcufor direct DRS slice requestsenflame.com/gcu-memoryfor memory requests (in MiB)enflame.com/gcu-corefor core requests (as a percentage)
Customize these names through devices.enflame.resourceNameDRSGCU, resourceNameGCUMemory, and resourceNameGCUCore in Helm values, keeping them consistent with the vendor plugin. Do not manually edit the global ConfigMap; see Global device configuration.
Running DRS Workloads
HAMi supports two request styles:
- Direct DRS slice request (
enflame.com/drs-gcu) - Unified memory/core request (
enflame.com/gcu-memory+enflame.com/gcu-core); HAMi converts it to a DRS profile internally.
Direct DRS slice request
apiVersion: v1
kind: Pod
metadata:
name: gcushare-pod-drs
namespace: kube-system
spec:
terminationGracePeriodSeconds: 0
containers:
- name: pod-gcu-example1
image: ubuntu:22.04
imagePullPolicy: IfNotPresent
command: ["sleep"]
args: ["100000"]
resources:
limits:
enflame.com/drs-gcu: 3
requests:
enflame.com/drs-gcu: 3
Request by memory/core (recommended unified API)
apiVersion: v1
kind: Pod
metadata:
name: gcushare-pod-by-spec
namespace: kube-system
spec:
terminationGracePeriodSeconds: 0
containers:
- name: pod-gcu-example1
image: ubuntu:22.04
imagePullPolicy: IfNotPresent
command: ["sleep"]
args: ["100000"]
resources:
limits:
enflame.com/gcu-memory: 20480 # MiB
enflame.com/gcu-core: 40 # percent
requests:
enflame.com/gcu-memory: 20480
enflame.com/gcu-core: 40
More examples are available in the examples/enflame folder.
Scheduling Annotations
During scheduling, HAMi writes DRS-compatible annotations such as:
assigned-containersenflame.com/gcu-assignedenflame.com/gcu-assigned-indexenflame.com/gcu-assigned-minorenflame.com/gcu-request-size
These annotations are consumed by the Enflame device plugin during the Allocate phase.