指定设备 UUID

要将任务分配到特定的 Ascend 设备,请在 pod 注解中设置 hami.io/use-<CommonWord>-uuid

例如,如果工作负载请求 huawei.com/Ascend910B4,请使用 hami.io/use-Ascend910B4-uuid

apiVersion: v1
kind: Pod
metadata:
  name: ascend-pod
  annotations:
    hami.io/use-Ascend910B4-uuid: "79A12A6C-012049B3-214CD433-808080E0-104301E3"
spec:
  containers:
    - name: ubuntu-container
      image: ascendai/pytorch:ubuntu-python3.8-cann8.0.rc1.beta1-pytorch2.1.0
      command: ["bash", "-c", "sleep 86400"]
      resources:
        limits:
          huawei.com/Ascend910B4: 1
          huawei.com/Ascend910B4-memory: 8192

要排除某些 Ascend 设备,请设置 hami.io/no-use-<CommonWord>-uuid

apiVersion: v1
kind: Pod
metadata:
  name: ascend-pod-exclude
  annotations:
    hami.io/no-use-Ascend910B4-uuid: "79A12A6C-012049B3-214CD433-808080E0-104301E3"
spec:
  containers:
    - name: ubuntu-container
      image: ascendai/pytorch:ubuntu-python3.8-cann8.0.rc1.beta1-pytorch2.1.0
      command: ["bash", "-c", "sleep 86400"]
      resources:
        limits:
          huawei.com/Ascend910B4: 1
          huawei.com/Ascend910B4-memory: 8192

注意: 注解后缀必须与请求的资源类型匹配。例如,huawei.com/Ascend910B4 使用 hami.io/use-Ascend910B4-uuidhami.io/no-use-Ascend910B4-uuid

注意: 这些 UUID 由 HAMi 发布在节点注解中,例如 hami.io/node-register-Ascend910B4。它们可能不会出现在 npu-smi info 输出中。