Switch Affinity Scheduling 2.0

Currently, only PyTorch supports switch affinity scheduling 2.0.

Instructions

Switch Affinity for Common Jobs

Switch Affinity for Foundation Model Jobs

Table 1 Node-based affinity policies

Affinity Scheduling Policy

Description

Exclusive switch scheduling policy

Occupy all nodes on the idle switch based on the number of available nodes in descending order until remaining N pods are not scheduled or the nodes on a single switch cannot be fully occupied.

The attribute of the idle switch with nodes fully occupied is changed to exclusive. The unscheduled N pods use the shared switch and comply with the shared switch scheduling policy.

Shared switch scheduling policy

Use the exclusive switch policy. If N pods are not scheduled after all nodes under the idle switch are occupied, use the shared switch scheduling policy.
  • When the number of shared switches that can be used by jobs in a cluster is 1:
    • The shared switch whose number of nodes is closest to N is selected for scheduling.
    • If no shared switch meets the requirement, the idle switch whose number of nodes is closest to N is selected for scheduling, and the attribute of the switch is changed to shared.
  • When the number of shared switches that can be used by jobs in a cluster is 2:
    • Select a shared switch whose number of available nodes or two shared switches whose sum of numbers of available nodes is closest to N for scheduling.
    • If the number of nodes in one switch is the same as that in two switches, the combination of two switches is preferred.
    • If no shared switch meets the requirement, the idle and exclusive switch whose number of nodes is closest to N is selected for scheduling, and the attribute of the switch is changed to shared.

Switch Affinity for Padding Jobs

Cross-switch scheduling is not allowed. Pods can be deployed only on a single switch. Preferentially select the nodes under the exclusive switch whose number of nodes is closest to the number of job pods, then the nodes under the shared switch, and finally the nodes under the idle switch.

Rescheduling Upon Faults

When the node where a job is located or Ascend AI processor is faulty, the job is rescheduled. Before rescheduling, pods of normal nodes will be scheduled to original nodes for training. Pods of faulty nodes will be rescheduled to other nodes. Preferentially select nodes on the exclusive switch used by the job before rescheduling, then other nodes on the shared switch, and finally nodes that are not used.