Topology Model
Background
When implementing communication operators, you need to provide topology query APIs on the control plane due to the following reasons:
- The operator control plane needs to create a channel for the data plane. Whether different ranks are interconnected and which endpoints are used for interconnection are mandatory information for creating a channel. Therefore, topology query APIs must be provided on the control plane.
- The connection relationship may vary with the cluster. The operator performance is closely related to the topology connection. To adapt operators to different topologies and achieve good performance, the topology connection relationship needs to be detected.
Therefore, HCCL models the topology of the connection relationship between different ranks in the communicator. The generated topology is called a rank graph. HCCL also provides control plane APIs for querying the connection relationship. For details, see Topology Information Query.
Topology Model
HCCL uses the traditional graph expression mode of nodes and edges to model the topology. A large-scale AI cluster is usually built hierarchically. For example, a server contains multiple interconnected NPUs, and multiple servers form a rack or a SuperPoD. Therefore, HCCL adds abstraction of topology layers based on the graph expression.
The following figure shows a topology model example. The concepts in the topology model are described as follows:
- Node: node in a graph. There are two types of nodes:
- Communication object: entity identified by a rank ID in a communicator.
- Fabric: abstraction of network switching/routing.
- A fabric can be connected only to a communication object.
- A fabric can be a switch or a set of network facilities consisting of multiple switches.
- A network facility that is abstracted as a fabric node must meet the following condition: Any two communication objects connected to the fabric node can communicate with each other through the fabric node.
- Endpoint: logical port of a node. A node can contain one or more endpoints.
- Edge: edge in a graph, which indicates the connection between different nodes. The two ends of an edge are the endpoints of two nodes.
- Link: information about the link that can be established between two communication objects, including the endpoints at both ends.
- Topology layer: The actual network topology is hierarchical. As shown in the following figure, the topology is divided into layer 0 and layer 1, which contains two layer 0 topologies. The network topology at each layer has its own topology type, such as full mesh and Clos.