Ascend Operator

  • Users who use full-NPU scheduling (training), static vNPU scheduling (training), resumable training, or elastic training must install Ascend Operator. If Volcano is used as the scheduler, it must be installed first; otherwise, Ascend Operator will fail to start.
  • Users who use full-NPU scheduling (inference) and scheduling upon inference card faults to submit distributed inference job of the AscendJob type must install Ascend Operator.
  • Users who only use containerization and resource monitoring, inference card fault recovery, or scheduling upon inference card faults (single-node jobs) do not need to install Ascend Operator. Please skip this chapter directly.
  • Before starting Ascend Operator, Volcano must be started first. Ascend Operator needs to perceive PodGroup resources.
  • The maximum number of replicas for a single AscendJob that Ascend Operator allows to create is 20,000.

Procedure

  1. Log in to the K8s management node as the root user and run the following command to check whether the Ascend Operator image and version number are correct.

    docker images | grep ascend-operator

    The following is an example of the output:

    ascend-operator                      v26.0.0              c532e9d0889c        About an hour ago         137MB
    • If correct, proceed to Step 2.
    • If not correct, see Preparing Images to complete image creation and distribution.
  2. Copy the YAML files from the extracted Ascend Operator software package directory to any directory on the K8s management node.

  3. If you do not modify the component startup parameters, you can skip this step. Otherwise, modify the Ascend Operator startup parameters in the YAML file based on the actual situation. For startup parameters, see Table 1. You can run ./ascend-operator -h to view parameter descriptions.

  4. (Optional) Use Ascend Operator to generate the collective communication configuration file (RankTable File, also known as the hccl.json) for training jobs under the PyTorch and MindSpore frameworks, to shorten the cluster communication link establishment time. Users of other frameworks can skip this step.

    1. The parent directory of the hccl.json file is already mounted by default in the startup YAML. Modify it based on the actual situation.

       ...
               - name: ranktable-dir
                 mountPath: /user/mindx-dl/ranktable        # Container path, cannot be modified
       ...
             volumes:
               - name: ascend-operator-log
                 hostPath:
                   path: /var/log/mindx-dl/ascend-operator
                   type: Directory
               - name: ranktable-dir
                 hostPath:
                   path: /user/mindx-dl/ranktable    # Host path. The root directory of the hccl.json file save path in the job YAML must be consistent with the host path.
                   type: DirectoryOrCreate                                      # Used to check whether the given folder exists. If it does not exist, an empty folder will be created.
       ...
      • The root directory path of the RankTable inside the container cannot be modified, but the host path can be modified. When deploying a job, the root directory of the hccl.json file save path in the job YAML must be consistent with the host path.
      • The permissions of the RankTable root directory folder must meet one of the following conditions:
        • The owning user and user group are hwMindX (the default running user of cluster scheduling components).
        • The permissions of the RankTable root directory folder are 777.
    2. Run the following command to create the specific mount path for the hccl.json file in the parent directory.

      mkdir -m 777 /user/mindx-dl/ranktable/{Mount path}
  5. In the path where the YAML file is located on the management node, run the following command to start Ascend Operator.

    kubectl apply -f ascend-operator-v{version}.yaml

    The following is a startup example:

    deployment.apps/ascend-operator-manager created
    serviceaccount/ascend-operator-manager created
    clusterrole.rbac.authorization.k8s.io/ascend-operator-manager-role created
    clusterrolebinding.rbac.authorization.k8s.io/ascend-operator-manager-rolebinding created
    customresourcedefinition.apiextensions.k8s.io/ascendjobs.mindxdl.gitee.com created
    ...
  6. Run the following command to check whether the component has started successfully.

    kubectl get pod -n mindx-dl

    The following is an example of the output. Running indicates that the component startup is successful.

    NAME                                         READY   STATUS    RESTARTS   AGE
    ...
    ascend-operator-7667495b6b-hwmjw      1/1    Running  0         11s

Parameter Description

Table 1 Ascend Operator startup parameters

Parameter

Type

Default Value

Description

-version

bool

false

Whether to query the Ascend Operator version.

  • true: Query.
  • false: Do not query.

-logLevel

int

0

The log level supports the following values:

  • Value -1: debug
  • Value 0: info
  • Value 1: warning
  • Value 2: error
  • Value 3: critical

-maxAge

int

7

Log backup time limit. The value range is 7 to 700, in days.

-logFile

string

/var/log/mindx-dl/ascend-operator/ascend-operator.log

Log file. When a single log file exceeds 20 MB, the automatic dump function is triggered. The maximum file size cannot be modified. The naming format of the dumped file is: ascend-operator-.log, for example: ascend-operator-2023-10-07T03-38-24.402.log.

-maxBackups

int

30

Maximum number of log files retained after dumping. The value range is 1 to 30, in units of file count.

-enableGangScheduling

bool

true

Whether to enable "gang" policy scheduling. It is enabled by default. When enabled, task scheduling is performed based on the scheduler specified by the task. For details about "gang" policy scheduling, see the open-source Volcano official documentation.

  • true: Enable "gang" policy scheduling.

    When using the job-level elastic scaling feature, the value of this field must be set to true.

  • false: Disable "gang" policy scheduling.

-isCompress

bool

false

Whether to compress and dump log files when the log file size reaches the dump threshold (this parameter will be deprecated later).

  • true: compress and dump.
  • false: do not compress and dump.

-kubeconfig

string

None

Path to kubeconfig. Must be configured when the program runs outside the cluster.

-kubeApiBurst

int

100

Burst traffic used when communicating with K8s. The value range is (0, 10000]. If the value is outside this range, the default value 100 is used.

-kubeApiQps

float32

50

QPS (queries per second) used for communication with K8s. The value range is (0,10000]. If the value is outside this range, the default value of 50 is used.

-h or -help

None

None

Displays help information.