Networked computers with multiple embedded rings
By adopting a specific multi-layer configuration topology in the processing nodes, the problem of low data exchange efficiency in the total reduction aggregate is solved, efficient data transmission and bandwidth utilization are achieved, and it is suitable for full reduction operations in machine learning.
Patent Information
- Application Number
- CN202080024478.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-03-27
- Filing Date
- 2020-03-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-03-26
Smart Images

Figure CN113632070B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to data exchange between connected processing nodes in a computer, particularly but not exclusively for optimizing data exchange in machine learning / artificial intelligence applications. Background Art
[0002] Collectives are routines commonly used when processing data in a computer. They are routines that enable data to be shared and processed across multiple different processes, which may be running on the same processing node or different processing nodes. For example, if a process reads data from a data store, it can use a "broadcast" process to share the data with other processes. Another example is when the result of a particular function is needed by multiple processes. "Reduction" is a result that requires applying a computational function to data values from each of multiple processes. "Gather" and "Scatter" collectives process more than one data item. Certain collectives have become increasingly important in processing machine learning applications.
[0003] MPI (Message Passing Interface) is a message passing standard that can be applied to a variety of parallel computing architectures. MPI defines many collectives suitable for machine learning. One such collective is called "Allreduce". The all-reduce operation enables the results of a computational function acting on multiple data values from different source processes to be provided at the receiving process. Note that the receiving process can be one of the source processes or there can be multiple receiving processes. The all-reduce collective reduces data values from multiple source processes and distributes the results to all source processes (which serve as receiving processes for the reduction results). According to the MPI standard, the all-reduce collective is implemented in the following way: data values from all source processes are reduced in a reduction collective (for example, at one of the multiple processes), and then the results are broadcast to each source process.
[0004] Figure 1 1 is a schematic block diagram of a distributed architecture for training a neural network. A training data source 100 is provided. This may be a database or any other type of data store capable of retaining training data suitable for the neural network model being trained. The processing itself according to the neural network model is distributed across a plurality of processing units 110a, 110b, 110c, etc. Figure 1Only three units are shown, but it will be readily appreciated that any number of processing units may be used. Each processing unit 110a, b, c receives batches of training data from a training data source 100. Each processing unit 110a, b, c retains a set of parameters 112a, 112b, 112c that define the model. The incoming batch of training data is processed with the current set of parameters in a calculation function 114, and the result of the calculation function is used to generate a so-called delta, which represents the difference between the original parameters and the new parameters as a result of applying the calculation function to the batch of training data and the current set of parameters. In many neural networks, these parameters are called "weights", and so the incremental values are called "delta weights". In Figure 1 In the example of FIG. 1 , the weights are labeled 112a, b, c, and the incremental weights are labeled 116a, b, c. It should be understood that in practice, the weights and incremental weights are stored in a suitable memory accessible to the processing unit. If the weights and incremental weights can be kept in local memory, this will make the training process more efficient.
[0005] Figure 1 The architecture is not designed to train three separate models, but rather to train a single model in a distributed manner. Therefore, the goal is to have the model parameters (or weights) converge to a single common set in each processing unit. Obviously, starting from any particular set of weights, and assuming that the batch of training data received at each processing unit is different, the incremental weights produced by each computation function in each processing unit will be different. Therefore, a method is needed to distribute the incremental weights across the processing units after each iteration of the batch of training data. This is done in Figure 1 , wherein a combination function 118 receives incremental weights from each processing unit and performs a mathematical function (such as an average function) that reduces the incremental weights. The output of the combination function 118 is then fed back to the combination circuits 120a, 120b, and 120c in each processing unit, respectively. Thus, a new set of weights is generated, which is a combination of the original weights and the combined outputs from the combination function 118, and the new weights 118a, 118b, and 118c are stored back in the local memory. Then, the next batch of training data is provided to each processing unit, and the process is repeated multiple times. Obviously, if the starting weights of the processing units are the same, then after each iteration, they will be reset to the same new value again. It is easy to see that the above is an example of a particularly useful full reduction function. The incremental weights are provided to the combination function 118, where they are reduced, and then these incremental weights are provided back to each processing unit in their reduced form, where they can be combined with the original weights.
[0006] Figure 1Ais a schematic diagram for illustrating how to implement an all-reduce aggregate in a line connection topology of five processing nodes N0...N5. These processing nodes may correspond to Figure 1 The processing nodes are shown connected in a row configuration, where each processing node is connected via a "forward" link L F and the "backward" link L B to its neighbors. As shown in the figure, and as the directional word implies, the forward link will process the node in Figure 1A Connecting from left to right in the , the backward link will process the node in Figure 1A 200 and memory capacity. The processing nodes may be connected from right to left in FIG. Each processing node has processing capability, designated 200, and memory capacity, designated 202. The processing capability and memory capacity may be implemented in any of a wide variety of ways. In one particular representation, a processing node may include a plurality of tiles, each individual tile having its own processing capability and associated memory capacity. Each processing node also has one or more link interfaces to enable it to communicate with each other via link L F / L B Connect to its neighboring nodes.
[0007] To understand the implementation of the full-reduce collective, assume that the first node N0 has generated a partial vector labeled Δ0. A "partial" can be a data structure that includes an array of incremental weights (such as a vector or tensor). A partial vector is an array of multiple partials. Each "partial" corresponds to a calculation on a processing node. Each "partial" can be a set of incremental weights. This is stored in storage capacity 202 ready to be exchanged in the full-reduce collective. In a simple "streaming" row full-reduce algorithm, the forward link is used for "reduction" and the backward link is used for "broadcasting". The algorithm starts at a processing node ( Figure 1A The left node in (in) sends its local Δ0 to its neighboring node N1. At this node, the incoming local (in this case Δ0) is reduced with the corresponding local (Δ1) that has been generated by the computing power 200 at processing node N1. This reduction is then Figure 1A The result after the ADD function is sent from processing node N1 to the next connected node N2. As further mentioned herein, the ADD function can be replaced by any combinatorial function that can be used to reduce the local. This process occurs at each processing node until the final processing node (at Figure 1A At N5), the local reduction is completed. At this time, the backward link L B, the reduction (sum Δ) is sent back to each processing node. It is received at each node and stored in the memory capacity at that node, and then also transmitted to the next node. In this way, each processing node eventually ends up with the result of the reduction.
[0008] Figure 1B shows the timing diagram of the reduction and broadcast phases. Note that a processing node does not send the reduced result to the next node until it has received the incoming data from the previous node. Therefore, there is an inherent delay marked as Δ for each outgoing transmission on the forward link.
[0009] Furthermore, the backward links are not used for broadcasting until the fully reduced result has been obtained at the end node. However, if the local vectors are large, due to pipeline effects, the leading data item of the result will be returned to the starting node before the starting node has finished sending its local data item, so there may be substantial overlap in activity on all forward and backward links.
[0010] In a modification of this algorithm (which represents a small improvement), the processing nodes at each end of the row can begin transmitting their locals to the central node where the reduction is done. In this case, the results are broadcast back to the end nodes. Note that in this scenario, there will be reversals in the direction of movement, such as between nodes N2 and N3 and between nodes N3 and N4 on both the forward and reverse links. If a row is closed into a loop (by connecting the last node N5 to the first node N0 on both the reverse and forward links), the pipeline algorithm can serialize the reductions and broadcasts in the same direction so that the two logical loops formed by the bidirectional links can each operate independently on half of the data. That is, each local vector is divided into two halves, and the first half ΔA is reduced on the forward link (such as Figure 1A The other half of the vector ΔB is reduced on the backward link and then broadcast on the connection ring of the backward link.
[0011] Figure 1D The corresponding timing diagrams for the forward and reverse links are shown.
[0012] A. Figure 1A and Figure 1C The principles of the one-dimensional ring shown in can be extended to two-dimensional rings, such as in a torus or ring-connected computer.
[0013] Using a two-dimensional ring, an alternative approach is to use a reduce-scatter collective followed by an allgather collective to implement all-reduce. The paper by Jain and Sabharwal, titled "Optimal Bucket Algorithms for large MPI collectives on torus interconnects" (ICS'10, June 2-4, Tsukuba), proposes bucket-based algorithms for allgather, reduce-scatter, and all-reduce collectives assuming bidirectional links between processing nodes in a torus interconnect processor. The method operates on the basis that there are multiple data values (fragments) to be processed in each step. In a reduce-scatter collective, each process starts with an initial local vector. It is assumed that the reference to a process here refers to a process executed on a processing node. A local vector can be divided into multiple elements or fragments. The corresponding elements of all processes are reduced and then distributed across these processes. In an allgather collective, each process receives all elements from all other processes. The reduce-scatter ensemble performs reductions on all locals and stores each reduction on the corresponding node - see Figure 2 The all-reduce collective operation can be implemented by performing a reduce-scatter collective followed by an all-gather collective operation.
[0014] As discussed in Jain's paper, the torus interconnect is an attractive interconnect architecture for distributed memory supercomputers. In the above discussion, collectives have been explained in the context of communication between processes. In a distributed supercomputer, processing nodes are interconnected, and each processing node may be responsible for one or more processes (in the context of a collective). The torus interconnect is a type of mesh interconnect in which processing nodes are arranged in an N-dimensional array, each node is connected to its nearest neighbor, and corresponding nodes on opposite edges in the array are also connected. There are bidirectional communication links between the interconnected processing nodes.
[0015] The algorithm for implementing the collective discussed in the above-mentioned paper by Jain and Sabharwal is applied to a torus connection architecture. This allows the collective to process different fragments of a vector in torus of different dimensions simultaneously, making the processing bandwidth efficient. Indeed, Jain and Sabthawal present their technique as the best choice for asymmetric torus, and it has been recognized in the art that this is the case.
[0016] An object of the present disclosure is to propose an improved topology and method for implementing a full-reduction function, particularly but not exclusively for processing functions in machine learning.
[0017] While the topologies and configurations described in this article are particularly effective for efficient implementations of all-reduce, they can also be used to advantage in other machine learning ensembles and other types of parallel programs. Summary of the invention
[0018] According to one aspect of the invention, there is provided a computer comprising a plurality of interconnected processing nodes arranged in a configuration having a plurality of stacked layers, each layer comprising three processing nodes connected by respective links between the processing nodes, wherein:
[0019] At the end level of the stack, three processing nodes are interconnected by two links suitable for simultaneous operation;
[0020] At the center level of the stack, three processing nodes are interconnected by a single link; and
[0021] The processing nodes of each layer are connected to the corresponding counterpart nodes in each adjacent layer by two links suitable for simultaneous operation.
[0022] The processing nodes in this configuration can be programmed to transfer data along three embedded one-dimensional logic rings, each of which uses a set of processing nodes in the configuration in a manner that the three embedded one-dimensional logic rings operate simultaneously.
[0023] This configuration can be used to implement all-reduce collectives in the manner described herein.
[0024] According to another aspect of the invention, there is provided a computer comprising a plurality of interconnected processing nodes arranged in a configuration having a plurality of stacked layers, each layer comprising four processing nodes connected by respective links between the processing nodes, wherein:
[0025] At the end level of the stack, four processing nodes are interconnected in a ring fashion by two links between the nodes, which are suitable for simultaneous operation;
[0026] The processing nodes in the plurality of stacked layers provide four faces, each face including a plurality of layers, each layer including a pair of processing nodes;
[0027] Therein, processing nodes are programmed into an operational configuration to transfer data along embedded one-dimensional rings, each ring being formed by processing nodes in two opposing faces.
[0028] In summary, aspects of the invention provide configurations of interconnected processing nodes where faces of the configuration are formed by stacked layers of node pairs and where one-dimensional rings can be embedded in the faces. There is a single face in a ladder configuration, three faces in a triangle configuration, and four faces in a box-and-tube configuration.
[0029] Each processing node may include a memory configured to store an array of data items to be exchanged in the reduce-scatter phase, wherein each data item is located in the array, wherein corresponding data items are located at corresponding positions in arrays of other processing nodes, respectively. The array may be "local" (a vector of local results) or "result" (a vector of locals after full reduction).
[0030] Each processing node can be programmed to transfer a data item in the forward direction to its neighboring processing nodes in each ring during the reduce-scatter phase. The data item that can be transferred in each step is called a "fragment". A fragment is a piece of a vector - as described herein, a vector is divided into fragments to exploit the logical loop formed in the embedded ring.
[0031] Each array may represent at least a portion of a vector of local increments, each local increment representing an adjustment to a value stored at each processing node. Each processing node may be programmed to generate a vector of local increments in a computation step. Each processing node may be programmed to divide its vector into two sub-arrays to utilize two embedded rings, respectively.
[0032] Another aspect of the invention provides a computer comprising a plurality of interconnected processing nodes arranged in a configuration of a plurality of stacked layers of processing nodes, the plurality of stacked layers forming a multi-faceted prism;
[0033] wherein each face of the prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein corresponding processing nodes are connected by respective inter-layer links to form respective edges of the configuration; and
[0034] wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring;
[0035] wherein the plurality of stacked layers include a first endmost layer and a second endmost layer, and at least one intermediate layer,
[0036] wherein the processing nodes are programmed to operate the configuration to transmit data along each of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer and a second portion provided between the second end-most layer and the first end-most layer, the first portion using all processing nodes in one of the faces of the configuration only once, and the second portion including one of the edges of the configuration.
[0037] In one embodiment, the multi-faceted prism has three processing nodes in each layer, thereby providing three corresponding faces for the first portion of the corresponding one-dimensional path.
[0038] In some embodiments, in at least one intermediate layer, each processing node is connected to its neighboring processing nodes through two inter-layer links.
[0039] In the first and second end-most layers, each processing node may be connected to its neighboring processing nodes through three inter-layer links to enable data to be transmitted simultaneously on three one-dimensional paths in the configuration.
[0040] The computer can be configured according to a multi-faceted prism comprising a set of stacked layers, wherein processing nodes of each stacked layer have inter-layer links to corresponding processing nodes in an adjacent stacked layer and inter-layer links between adjacent processing nodes in the layer, and intra-layer links are provided by disconnecting each inter-layer link in a specified stacked layer and connecting it to an adjacent processing node in the specified stacked layer, thereby forming one of a first end-most layer and a second end-most layer.
[0041] Each processing node can be programmed to identify one of the inter-layer links and intra-layer links they use to transfer data in order to determine a one-dimensional path for that data. This can be accomplished by a local node-level program containing appropriate instructions for defining the data transfer phases.
[0042] Each processing node may be programmed to deactivate any of its inter-layer links and intra-layer links that are not used during the data transmission step.
[0043] Each processing node may be programmed to partition the node's corresponding local vector into segments and to transfer data in the form of consecutive segments around each one-dimensional path.
[0044] The computer may be programmed to operate each path as a set of logical rings, wherein consecutive segments are transmitted along each logical ring in simultaneous transmission steps.
[0045] Each processing node may be configured to output a corresponding segment simultaneously on each of the two links.
[0046] Each processing node may be configured to reduce a plurality (eg, two) of incoming segments to a plurality (eg, two) of corresponding locally stored corresponding segments.
[0047] Each processing node may be configured to transmit the fully reduced segments simultaneously on each of the two links during the all-gather phase of the all-reduce ensemble.
[0048] In some embodiments, some or all of the links are bidirectional, ie, they can transmit data in both directions (optionally, simultaneously) through the link.
[0049] Another aspect of the invention provides a method of generating a set of programs to be executed in parallel on a computer comprising a plurality of processing nodes connected in a configuration comprising a multi-faceted prism;
[0050] wherein each face of the prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected to each other by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein the corresponding processing nodes are connected by respective inter-layer links to form respective edges of the configuration; and
[0051] wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring;
[0052] Wherein, the plurality of stacked layers include a first endmost layer and a second endmost layer, and at least one intermediate layer, and the method includes:
[0053] generating at least one data transfer instruction for each program to define a data transfer phase in which data is transferred from a processing node executing the program, wherein the data transfer instruction includes a link identifier that defines an outgoing link over which data is to be transferred in the data transfer phase; and
[0054] The link identifier is determined so that data is transmitted along each one-dimensional path of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer and a second portion provided between the second end-most layer and the first end-most layer, the first portion using all processing nodes in one of the faces of the configuration only once, and the second portion including one of the edges of the configuration.
[0055] In some embodiments, each program includes one or more instructions to deactivate any unused inter-layer links and intra-layer links in the data transmission step.
[0056] In some embodiments, each program includes one or more instructions to divide a local vector corresponding to a processing node on which the program is executed into segments and to transmit data in the form of consecutive segments over respectively defined links.
[0057] In some embodiments, each program includes one or more instructions to output the corresponding fragments simultaneously on each of the two links.
[0058] In some embodiments, each program includes one or more instructions to reduce a plurality (eg, two) of incoming segments to a plurality (eg, two) of corresponding locally stored corresponding segments.
[0059] In some embodiments, each program includes one or more instructions to transmit the fully reduced segments simultaneously on each of the two links during an all-gather phase of the all-reduce aggregate.
[0060] Another aspect of the invention provides a method of executing a set of programs in parallel on a computer comprising a plurality of processing nodes connected in a configuration comprising a multi-faceted prism;
[0061] wherein each face of the prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected to each other by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein the corresponding processing nodes are connected by respective inter-layer links to form respective edges of the configuration; and
[0062] wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring;
[0063] Wherein, the plurality of stacked layers include a first endmost layer and a second endmost layer, and at least one intermediate layer, and the method includes:
[0064] executing at least one data transfer instruction in each program to define a data transfer phase in which data is transferred from a processing node executing the program, wherein the data transfer instruction includes a link identifier that defines an outgoing link over which data is to be transferred in the data transfer phase;
[0065] The link identifier has been determined so as to transmit data along each one-dimensional path of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer and a second portion provided between the second end-most layer and the first end-most layer, the first portion using all processing nodes in one of the faces of the configuration only once, and the second portion including one of the edges of the configuration.
[0066] In some embodiments, the program is executed to operate each path as a set of logical rings, wherein consecutive segments of the local vector provided at each processing node are transmitted around each logical ring in a simultaneous transmission step. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] For a better understanding of the invention and to show how the invention may be put into practice, reference will now be made to the accompanying drawings, by way of example.
[0068] Figure 1 is a diagram illustrating distributed training in a neural network.
[0069] Figure 1A is a schematic diagram showing a row of processing nodes for implementing a simple "streaming" row all-reduce algorithm.
[0070] Figure 1B is a timing diagram of the "streaming" row all-reduce algorithm.
[0071] Figure 1C is a schematic diagram of a line with end nodes connected into a ring.
[0072] Figure 1D It is the timing diagram of the ring all-reduce algorithm.
[0073] Figure 2 is a schematic diagram illustrating the implementation of an all-reduce function by a reduce-scatter followed by an all-gather step.
[0074] Figure 3A and Figure 3B Figure 1 illustrates the bucket-based all-reduce algorithm.
[0075] Figure 4A and Figure 4B is a schematic diagram of a processing node configuration in which two rings are embedded.
[0076] Figure 5A and Figure 5B is a schematic diagram of an alternative ("triangular") configuration of processing nodes in which three rings are embedded.
[0077] Figure 6 is a schematic diagram illustrating a ring embedded in the structure of FIG. 5 .
[0078] Figure 7 is a schematic diagram of another alternative ("box and tube") configuration in which four rings are embedded.
[0079] Fig. 8A A 3×8 triangular prism is shown with a 1:2 bandwidth asymmetry.
[0080] Figure 8B Three isomorphic embedded rings are shown that can be looped concurrently on the graph, each using B / 6 per link.
[0081] Figure 8C is a 3D view showing one of the three embedded rings. DETAILED DESCRIPTION
[0082] Aspects of the present invention have been developed in the context of a multi-tile processor designed to act as an accelerator for machine learning workloads. The accelerator comprises a plurality of interconnected processing nodes. Each processing node may be a single multi-tile chip, a package of multiple chips, or a rack of multiple packages. The goal of this paper is to design a machine that is efficient in deterministic (repeatable) computation. The processing nodes are interconnected in a manner that enables efficient implementation of aggregates, particularly broadcasts and all-reduces.
[0083] One particular application is updating the model when training a neural network using distributed processing. In this context, distributed processing utilizes multiple processing nodes located in different physical entities (such as chips or packages or racks). That is, data transmission between processing nodes requires exchanging messages over physical links.
[0084] The challenges in developing topologies specialized for machine learning differ from the general area of high-performance computing (HPC) networks. HPC networks typically emphasize on-demand asynchronous all-to-all personalized communication, so dynamic routing and bandwidth overprovisioning are normal. Excess bandwidth can be provisioned in HPC networks with the goal of reducing latency rather than providing bandwidth. Overprovisioning of active communication links wastes power that could contribute to computing performance. The most common type of link used in computing today consumes power when it is active, regardless of whether it is being used to transmit data.
[0085] The inventors have developed a machine topology that is particularly suitable for MI workloads and addresses the following properties of MI workloads.
[0086] In MI workloads, inter-chip communication is currently dominated by broadcast and all-reduce collectives. Broadcast collectives can be implemented by scatter collectives followed by all-gather collectives, and all-reduce collectives can be implemented by reduce-scatter collectives followed by all-gather collectives. In this context, the term "inter-chip" refers to any communication between processing nodes connected via external communication links. As mentioned earlier, these processing nodes can be chips, packages, or chassis.
[0087] Note that the communication link can be between chips on one printed circuit board or between chips on different printed circuit boards.
[0088] Workloads can be compiled so that within a single intelligence processing unit (IPU) machine, all-to-all communications are primarily inter-chip.
[0089] The all-reduction aggregate has been described above and is illustrated in Figure 2 middle. Figure 2 A set of local values or "local" vectors P0, P1, P2, P3 on each of the four nodes in the starting state S1 is shown. In this context, a node is a processing node in a processing node network. Note that each node N0, N1, N2, N3 has four "corresponding" locals, which are labeled accordingly (diamond-shaped large grid, diagonally downward wide stripes, square-shaped large grid, diagonally upward wide stripes). That is, each local has a position in its local vector, so that the position of P0(n) in its vector on node n is the same as the position of P0(n+1) in its vector on node n+1. The suffix (n) is used to indicate the node where the local is located - therefore, P0(0) is the local P0 on node N0. In the reduce-scatter pass, the corresponding local is reduced, and the reduction is provided to one of the nodes. For example, local P0(0), P0(1), P0(2), P0(3) are reduced (reduced to r0) and placed on node N0. Similarly, locals P1(0), P1(1), P1(2), and P1(3) are reduced (reduced to r1) and placed on node N1. And so on, so that: in the intermediate state S2, each node has one of the reductions r0, r1, r2, and r3. As explained, the reduction can be done by any combination of functions , which may include independent operators (e.g., max) or associative operators = P1(0)*P1(1)*P1(2)*P1(3). Then, in an all-gather pass, each reduction is provided to all nodes to activate state S3, where each node now holds all four reductions. Note that in S1, the "corresponding" locals (e.g., P0(0), P0(1), P0(2), and P0(3)) may all be different, whereas in state S3, each reduction (e.g., r0) is the same at all nodes, where r i=f{(P i (0),P i (1),P i (2),P i (3))}. In machine learning, a set of locals P0, P1, P2, P3 is a vector. Each pass through the model during training produces a local vector (e.g., updated weights). In state S3, the reduction r0, r1, r2, r3 on the diamond grid, diagonal downward stripes, square grid, diagonal upward stripes of each node is a fully reduced vector, that is, the "result" or vector of the local after the full reduction. In the context of machine learning, each local can be an updated increment of a parameter in the model. Alternatively (in an arrangement not further described in this document), it can be an updated parameter.
[0090] Figure 3A and Figure 3B The diagram shows a bucket-based algorithm for reduce-scatter / all-gather, which assumes six "virtual" rings. These rings are also referred to herein as "logical" rings. Figure 3A FIG. 1 is a schematic diagram illustrating the reduction of a local region in multiple virtual rings. Each local region is divided into six fragments. Figure 3A In , the capital letters R, Y, G, B, P, and L each represent a different fragment stored locally at each node, represented by a shaded diamond grid, diagonal upward stripes, a square grid, horizontal stripes, diagonal downward stripes, and vertical stripes. The letters represent corresponding fragments to be reduced together, and define a "virtual" ring or "logical" ring for these fragments. See Figure 3A , the “R” segments in each local P0, P1, P2, P3, and P4 are reduced to a single segment in the result vector The same is true for the Y, G, B, P and L segments.
[0091] Figure 3B A timing diagram is shown, where the time on the horizontal axis represents the data exchange and computation in each step of the all-reduce process. Figure 3A and 3B In , the full reduction process is completed through a reduce-scatter phase followed by a full gather phase. Figure 3B In the figure, each segment is represented by the following different shading: R-diamond grid, Y-diagonal upward stripes, G-square grid, B-horizontal stripes, P-diagonal downward stripes, L-vertical stripes.
[0092] Figure 3A and Figure 3BThe representation in is as follows. Each local is denoted as P0, P1, P2, P3, P4, P5. At the beginning of the process, each local is stored on the corresponding node N0, N1, N2, N3, N4, N5. Each fragment is labeled according to its fragment number and its position in the virtual ring, and the fragment is considered to be reduced in the virtual ring. For example, RA0 represents the R fragment in the local P0, because this is the first fragment in the virtual ring formed by nodes N0-N1-N2-N3-N4-N0. RA1 represents the R fragment at the node N1, which is located in the second position in its virtual ring. YA0 represents the Y fragment at the node N1. The "0" suffix indicates that it is the first fragment in its virtual ring, and the Y ring is N1-N2-N3-N4-N0-N1. Note in particular that the suffix of A reflects the virtual ring and does not correspond to a physical node (or local). Note that, Figure 3A Only the virtual ring on the forward link is shown. Figure 3B An equivalent process is shown occurring on the reverse link, where segment denoted as B.
[0093] In step one, the first fragment (A0) in each virtual ring is transmitted from its node to the next adjacent node, where the first fragment is reduced with the corresponding fragment at the adjacent node. That is, RA0 moves from N0 to N1, where RA0 is reduced to R(A0+A1) at N1. Again, the "+" sign is used here as an abbreviation for any combinatorial function. Note that in the same step, the A0 fragment of each virtual ring will be transmitted simultaneously. That is, the link between N1 and N2 is used to transmit YA0, the link between N2 and N3 is used to transmit GA0, and so on. In the next step, the corresponding reduced fragments are transmitted to their next adjacent node via the forward link. For example, R(A0+A1) is transmitted from N1 to N2, and Y(A0+A1) is transmitted from N2 to N3. Note that for clarity, Figure 3A Not all segments are numbered, nor are all transfers numbered. The complete set of segments and numbers is shown in Figure 3B As shown. This process is carried out in five steps. After five steps, all fragments on each node are reduced. At the end of the fifth step, the reduction is on the last node of each corresponding ring for the fragment. For example, R is reduced on node N5.
[0094] The starting point of the full gathering phase is the transmission from the last node to the first node in each virtual ring. Therefore, the final reduction of the R segment ends on node N5, thus preparing for the first step of the full gathering phase. The final reduction of the Y segment ends on node N0 accordingly. In the next step of the full gathering phase, the reduced segments are transmitted again to their next adjacent node. Therefore, the fully reduced R segment is now also at N2, the fully reduced Y segment is now also at N3, and so on. In this way, at the end of the full gathering phase, each node ends up with all the fully reduced segments R, Y, G, B, P, L of the local vector.
[0095] The implementation of this algorithm is optimal if the computation required for the reduction can be hidden behind pipeline delays. Note that when a suitable ring is formed in the computer to implement the full reduction, a tour of the ring must visit each node in the ring only once. Therefore, the rows with bidirectional links ( Figure 1A ) is not the most efficient ring.
[0096] An improved topology for an interconnect network of processing nodes will now be described that allows efficient exchange of local sum results between processing nodes to implement an all-reduce collective.
[0097] Figure 4A FIG. 1 is a schematic diagram showing the connection topology of multiple processing nodes. Figure 4A In the example, there are eight processing nodes in a ladder configuration, but it should be understood that the principle can be extended to any number of processing node pairs arranged in a ladder configuration. Each processing node is shown as a circle and labeled with a number for ease of reference. In the following description, the prefix N will be inserted when referring to a node. For example, N0 means Figure 4A The circle in the figure represents node N0. The processing nodes are connected by links in a manner to be described. Each link can be bidirectional, i.e., it can transmit data in both directions through the link. Note that there is physical interconnectivity and logical connectivity. The logical connectivity is used to form two embedded continuous rings, each with two directions. First, the physical connectivity will be described. Each processing node in the Y direction is connected to its neighboring node by a single bidirectional link. Facing processing nodes are connected by two bidirectional links. For example, (see Figure 4A4 ), N0 is connected to N2 via a single bidirectional link (shown as two opposite-facing arrows in Figure 4 ). Similarly, N2 is connected to N4, N4 is connected to N6, and N6 is connected back to N0. Horizontally, node N0 is connected to N1 via two bidirectional links (one of which is shown as an opposite arrow in black and small dashed lines, and the other is shown as an opposite arrow in gray and large dashed lines). Similarly, N2 is connected to N3, N4 is connected to N5, and N6 is connected to N7. This physical connection allows two logically embedded rings (each bidirectional) to be embedded into the structure. The first ring (shown as gray and large dashed lines) extends from N0 to N1, N1 to N3, N3 to N2, N2 to N4, N4 to N5, N5 to N7, N7 to N6, and then back to N0. The second logical ring (shown as black and small dashed lines) extends from N0 to N2, N2 to N3, N3 to N5, N5 to N4, N4 to N6, N6 to N7, N7 to N1, and then from N1 back to N0. Each ring includes all eight processing nodes. Note also that both rings can be used simultaneously because there are no conflicts on any single path.
[0098] consider Figure 4A and Figure 4B Node N0 in. The node N0 has two links connecting it to the node N1, which is called its opposite node. These links are labeled L011 and L012. Label L01 represents the link connecting nodes 0 and 1. Label 1 indicates that it is the first link between nodes 0 and 1, and label 2 indicates that it is the second link between nodes N0 and N1. Note that in this embodiment, each link is bidirectional. Node N0 also has a third bidirectional link labeled L02. The link L02 is connected to the corresponding node N2 in the next adjacent pair in the ladder configuration. Therefore, link L02 is called a ladder connection link. Node N0 has a fourth link labeled L06. This link connects the corresponding nodes N0 and N6 in the end pair of the ladder configuration. In Figure 4A and Figure 4B In FIG. 6 , the first end pair is the facing node pair N0 and N1, and the second end pair is the facing nodes N6 and N7. Note that the processing nodes N6, N7 in the facing pair are similarly connected by two bidirectional links L671, L672.
[0099] The link L06 extending between the corresponding nodes of the end pair (N0 and N6), and the link L17 extending between nodes N1 and N7 correspondingly, are called ladder return links. These links complete each embedded ring in the ladder configuration into a one-dimensional ring.
[0100] The ladder configuration in the embodiment of Figure 4 includes two intermediate facing pairs, N2 / N3 and N4 / N5. The facing nodes in each pair are connected by corresponding links L231, L232; L451, L452.
[0101] The corresponding nodes in the opposite pairs are connected by ladder-like connection links. For example, the node N1 in the first end pair is connected to the node N3 and its adjacent middle pair by link L13. Figure 4A and Figure 4B In the embodiment, each link is represented by two bidirectional arrows. However, these links can be contained in a single physical link structure and represent a bidirectional communication path on the physical link structure. In an alternative embodiment, each direction of the link structure can be a separate physical manifestation.
[0102] exist Figure 4A and Figure 4B In the embodiment of, four pairs of opposite pairs of eight nodes in total form ladder configuration.It is easy to understand that ladder configuration can be simply expanded to include more opposite pairs.This can be done by changing the connectivity of the link on the node in the end pair.For example, in order to add another opposite pair to ladder configuration, link L06 is disconnected from node N0 and connected to another node N8 (shown with dotted lines).This node N8 has its own physical link, and then the physical link is connected to node N0 as a ladder return link.Similarly, link L17 extending from node N7 to node N1 is disconnected from node N1 and connected to new node N9 (shown with dotted lines).Then the physical link from N9 is connected to node N1 as a ladder return link.Nodes N8 and N9 are connected together by physical links N891 and N892.
[0103] More node pairs can be added to the ladder configuration as needed to expand the processing power of the computer. Note that when adding new nodes, there is no need to disrupt the existing connections of other node pairs in the ladder configuration, except for the end pairs. This greatly simplifies the expansion of the ladder configuration to include additional processing nodes as needed.
[0104] like Figure 4B As shown, due to the appearance of the embedded rings in the ladder configuration, the embedded rings in the ladder configuration can be regarded as "barley twist" rings and are labeled VR1, VR2. It should be emphasized that Figure 4B The rings shown in are virtual data transmission rings embedded in a ladder configuration. These rings can operate simultaneously because no link is used twice in different conflicting rings.
[0105] To use this structure, the part (or fragment) to be transmitted is divided into two parts at each node and the above reference is used. Figure 3A and Figure 3BThe one-dimensional ring algorithm described in performs a complete reduction of each part around one of the rings.
[0106] The size of the fragments output by each node Where N is the number of nodes, and V is the size of the data structure being reduce-scattered or all-gathered at a particular stage. At the beginning, V is the size of the local vector. The number of fragments is equal to the number of nodes in the ring before each step around the ring. Note that in contrast to the structure described in the Jain paper, the ring passes through all nodes and all links are always used. This paper assumes that each processing node can output its data on two links simultaneously, and can receive and process data simultaneously. Each ring is one-dimensional - the ring is a branchless chain of processing nodes.
[0107] According to another configuration of the embedded one-dimensional rings, a configuration having a plurality of stacked layers is provided. Figure 5A and Figure 5B One configuration is shown as a three-dimensional view, and Figure 6 is an expanded diagram showing connectivity. There is physical connectivity and logical connectivity, both of which will be described below. Figure 6 ), the configuration includes multiple stacked layers - the stacking is shown from left to right (rather than in a vertical direction) in the figure. The direction of the stacking is not important, but it should be noted that in actual configurations where the processing units can be arranged in a server rack, it can be useful to stack them in a vertical configuration corresponding to the server rack.
[0108] Each layer consists of three processing nodes, which are Figure 6 The leftmost layer of the stack is shown as N61, N62 and N63. These processing nodes are connected in a ring, where each processing node is connected to its adjacent processing node by two links L1, L2. Each of these links can be bidirectional. The rightmost layer of the stack is also connected together by two links between the nodes. However, the central layer of the stack is only connected by a single link. Connectivity achieved by a link means here that the link is active and can transmit data. There may be other inactive connections between processing nodes, which do not form part of the operation of the configuration.
[0109] The configuration is operated to provide three embedded one-dimensional rings that can operate either or both simultaneously. Figure 5BThe configuration is shown schematically, with the rings labeled R1, R2, and R3. R1 is shown in solid lines, R2 is shown in dotted lines, and R3 is shown in dashed lines. The configuration is viewed as a cylinder of triangular cross-section, with each plane of the cylinder containing a one-dimensional embedded ring. For example, ring R1 is formed by the following: nodes N51, N52 (in the last layer), the link between N52 and N55 (between layers), the link between N55 and N54 (in the next layer), the link between N54 and N57 (between layers), the link between N57 and N58 (in the next layer), the link between N58 and N511 (between layers), the link between N511 and N510 (in the right-hand-most layer), the link between N510 and N512, and the return link between N512 and N53, and then back to N51.
[0110] Corresponding embedded rings can be found in each of the other two phases. Thus, each ring is formed by connecting the links within each layer to the links between layers, and so on, until the ring is complete. Figure 5A The loops (or paths) are described in more detail below.
[0111] In the first embedded path, node N51 is connected to node N53 along a side of the first most end layer by the link between nodes N51 and N53. This is an intralayer link along a side of the first most end layer. The path continues to node N52 along the next side of the first most end layer. Then, the path proceeds to node N56 from node N52 via an interlayer link. Then, the path continues to N55 from node N56 via another intralayer link on the same face as nodes N52 and N56 of the configuration. The path extends from node N55 to node N58 along the face, and then crosses the face along the intralayer link to node N59. The path proceeds to node N511 from node N59 along the interlayer link and then proceeds to node N512 from node N511 along the intralayer link, and from then on proceeds to node N510 of the second most end layer along the intralayer link from N512. The intra-layer links between nodes N511, N512 and N510 are edges of the second most end layer. The path then proceeds from node N510 to node N51 of the first most end layer along the return portion. Figure 5A The small dotted line in FIG.
[0112] A second embedded path starting at node N51 can also be shown, which is shown as a solid black line. Figure 5AThe first portion of the "bottom" side of the configuration shown extends from node N51 to node N53, from node N53 to node N55, from node N55 to node N54, from node N54 to N57, from node N57 to N58, from node N58 to N512, from node N512 to node N511. The second return portion of the path is provided by the interconnection link between node N511 of the second end-most layer and N52 of the first end-most layer.
[0113] A third embedded path can be shown starting at node N53 and extending along the intra-layer link to node N52; the third embedded path is shown as a large dotted line. The path then follows Figure 5A The back side of the configuration shown, from node N52 proceeds to N51, from N51 proceeds to N54, from N54 proceeds to N56, from node N56 proceeds to N59, from node N59 proceeds to N57, from node N57 proceeds to N510, from node N510 proceeds to node N511, and from node N511 proceeds to N512. The path has a return portion from node N512 to N53.
[0114] Note that each path has a first portion that uses each node in a face of the configuration only once, and two "legs" for each end-most layer. Each path also has a return portion that passes directly between end-most layers along opposite edges of the configuration, using all of the processing nodes in the return portion.
[0115] Three embedded rings can operate simultaneously. If all links are capable of bidirectional operation simultaneously, there can be six embedded rings operating simultaneously.
[0116] The capacity of a computer can be expanded by adding new layers of processing nodes. To do this, the interconnectivity of the processing nodes is changed. For example, consider the second-most layer ( Figure 5A An additional layer is added to the right layer in the configuration). One of the links from node N511 is disconnected and connected to the corresponding processing node in the additional layer, the processing node shown is labeled EPN1 (additional processing node 1). Similarly, one of the links from each of nodes N512 and N511 is disconnected from the node to which it is currently connected and connected to the corresponding additional processing nodes labeled EPN2 and EPN3, respectively. Nodes EPN1, EPN2, and EPN3 are then themselves connected in a ring with the corresponding link structures in the other layers in the configuration. Note that the connectivity of the rest of the configuration remains unchanged. Layers can be added to either end of the configuration stack in this way.
[0117] Note that the path taken around each layer (set of three nodes) in the triangular prism configuration is such that the extended triangular prism of the layers of three processing nodes can be partitioned into different lengths so that each partition can operate in a self-contained manner. This can be done by deactivating the links between the layers of the individual partitions. This will be discussed in more detail below. Note that although in Figure 5B In the example, the return portion is shown as a loop back, but this is for illustration only. In one implementation, each existing link between processing nodes along the edge is used as part of the return portion, wherein the data value passes through each processing node without further processing until it reaches the end processing node.
[0118] In some embodiments, references to "operating as a ring" refer to implementations of the one-dimensional algorithm as described above to implement an all-reduce collective. Figure 5A , Figure 5B and Figure 6 In the structure, all three rings can operate simultaneously, so that the local vector at each node can be divided into three parts for simultaneous processing on the three rings in the structure.
[0119] Fig. 8A An embodiment is illustrated in which 24 processing nodes are arranged in a 3x8 triangular prism with 1 :2 bandwidth asymmetry. Bandwidth utilization is noted on the link. Fig. 8A The connectivity is shown in the figure, which shows the allocation of the total node bandwidth B to each link. Note that the bandwidth of the intra-layer links is B / 6 and the bandwidth of the inter-layer links is B / 3.
[0120] Figure 8B Three isomorphic embedded rings are illustrated, which can be looped concurrently in the structure. Each ring has a bandwidth utilization of B / 6 per link.
[0121] Figure 8C is a three-dimensional view showing one of the three embedded rings. Figure 8C Ring R1 is shown in FIG. Note that the other two rings R2 and R3 are also rotated 120 degrees around the major axis.
[0122] According to another configuration, it is possible to provide Figure 7 The "box tube" structure shown. Back Figure 4A and Figure 4B The "ladder" configuration of the present invention provides a return portion of each path in a direction perpendicular to the pair (or run) of ladders. Figure 7 In the box-and-tube configuration shown, the return portion of each path can be realized by a ladder-like configuration on the rear face of the rectangular prism. That is, in the box-and-tube configuration, the front face can be used as Figure 4A and Figure 4B The rear face can be used as a ladder Figure 4A and Figure 4B The ladder-like operation enables the embedding of four rings, such as Figure 7 Notice that the path taken around each layer (a set of four nodes) of the box structure is such that the extended "tube" of the 2×2 layers of processing nodes can be partitioned into different lengths, so that each partition can operate in a self-contained manner. This can be done by deactivating the links between the layers of the individual partitions.
[0123] exist Figure 7 Four virtual rings can be seen in the "box-and-tube" configuration shown. They are labeled BVR1, BVR2, BVR3, BVR4 (for box-and-tube virtual rings). Note that this terminology is used to distinguish between the rings in the ladder configuration (VR) and the virtual rings in the triangle configuration (R). However, the function and operation of the embedded rings are the same in all three configurations.
[0124] The first embedded ring BVR1 is from Figure 7 The operation starts from the node N71 at the upper left corner of the structure shown. It starts from the first end layer of four nodes (in Figure 7) in the box structure shown in the figure. Virtual ring BVR1 extends around the three nodes N73, N74 and N72 of this layer. It then extends to a node (node N76) in the next layer of four nodes. It passes down to one side of the layer to node N77, and then extends to the adjacent node N81 in the next layer on the face. The ring then continues upward to node N80 on one side of the layer, and from there to node N83 of the next layer in the structure (the last layer in this case). Ring BVR1 then passes around the three sides of the last layer through nodes N85, N84 and N82, and then returns in the return portion along the other side of the box tube structure via nodes N79, N82, N78, N75, and then returns to N71. Note that the ring has been described as starting from node N71 and described in a specific direction. In fact, the ring can operate simultaneously in two directions using a bidirectional link that can operate simultaneously in both directions. Furthermore, the "starting node" of the loop can be any node on the loop, in particular for the different fragments of data already described. Note that, in general, the loop passes through the three sides of each end face of the box-tube structure and proceeds along each side of the box-tube structure in an alternating manner, thereby visiting only all nodes on that face. Note that the configuration of the virtual loop on each side of the box structure is similar to that of a ladder structure. As already mentioned, the box-tube structure can be considered a type of ladder structure, but in each case with a return path extending through the end face of the box structure and the opposite side of the box structure.
[0125] Three more virtual loops are formed in the box-tube structure. The second loop BVR2 passes from node N71 to N72 to N74 to N73 (three sides of the end face). From there it passes along the "bottom" face of the box-tube structure via nodes N78, N77, N81, N82 and N84 in an alternating manner. It passes around the three sides of the end face via nodes N85, N83 and N82, then returns along the top face of the box structure via N79, N80, N76, N75 back to N71 in an alternating manner.
[0126] The third loop is more easily explained by starting at node N73, as it passes through nodes N71, N72, and N74 using the three sides of the end face, then passes in an alternating manner via nodes N77, N76, N80, N81, N85, and N83. From there it passes via N82 and N84 to the return face of the box-tube structure, where it passes in an alternating manner via nodes N82, N79, N75, N78 and returns to N73.
[0127] It can be considered that the fourth virtual ring BVR4 starts at node N74 and travels around the three sides of the end face via nodes N73, N71 and N72. It then passes through the top face of the box-tube structure in an alternating manner via N76, N74, N79, N80, N83 and N82. It then passes through the end face via N84 and N85, and then returns along the bottom face of the box-tube structure via nodes N81, N82, N78, N77 and N74.
[0128] Each node is capable of implementing a processing or computing function. Each node can be implemented as a single processor. However, it is more likely that each node will be implemented as a single chip or chip package, where each chip includes multiple processors. There are many possible different manifestations of each individual node. In one example, the node can be composed of an intelligent processing unit of the type described in the British application (publication number GB2569843; GB2569430; GB2569275); its content is incorporated herein by reference. However, the technology described herein can be used on any type of processor that constitutes a node. This article outlines a method for exchanging data in an efficient manner to implement a specific exchange mode, which is useful in machine learning models. In addition, the link can be expressed in any suitable manner. It is advantageous that these links are bidirectional, and preferably, these links can operate simultaneously in both directions, although this is not a necessary requirement. A specific class of communication links is a SERDES link, whose power requirements are independent of the amount of data transmitted through the link or the time it takes to transmit the data. SERDES is an acronym for Serializer / DeSerializer, and such links are known. In order to transmit a signal on the line of such a link, power needs to be applied to the line to change the voltage to generate the signal. SERDES links have the following characteristics: power is continuously applied to the line to keep it at a certain voltage level so that the signal can be conveyed by changes in this voltage level (rather than by changes between 0 and the applied voltage level). Therefore, the bandwidth capacity on the SERDES link has a fixed power regardless of whether it is used. SERDES links are implemented at each end by circuits that connect link layer devices to a physical link (such as a copper wire). This circuit is sometimes called a PHY (physical layer). PCIe (Peripheral Component Interconnect Express) is an interface standard for connecting high-speed computers.
[0129] It is possible that the links can be dynamically deactivated to effectively consume no power when not in use. However, the activation times and non-deterministic nature of machine learning applications often make dynamic activation during program execution problematic. Therefore, the inventors have determined that it may be better to exploit the fact that for any particular configuration, the power consumption of the chip-to-chip link is essentially constant, so the best optimization is to maximize the use of the physical link by keeping chip-to-chip traffic as concurrent as possible with IPU activity.
[0130] The SERDES PHY is full-duplex (i.e., 16 Gbit / s, the PHY supports 16 Gbit / s in each direction simultaneously), so full link bandwidth utilization means balanced bidirectional traffic. Also note that using direct chip-to-chip communication has significant advantages over indirect communication such as via a switch. Direct chip-to-chip communication is more power efficient than switched communication.
[0131] Another factor to consider is the bandwidth requirements between nodes. One goal is to have enough bandwidth to hide the inter-node communication behind the computations performed on each node for distributed machine learning.
[0132] When optimizing machine architectures for machine learning, all-reduce ensembles can be used as a criterion for required bandwidth. An example of an all-reduce ensemble has been given above in the treatment of parameter updates for model averaging. Other examples include gradient averaging and computing norms.
[0133] As an example, consider the all-reduce requirement for residual learning networks. Residual learning networks are a class of deep convolutional neural networks. In deep convolutional neural networks, multiple layers are used to learn corresponding features within each layer. In residual learning, instead of learning features, residuals can be learned. A specific residual learning network called ResNet implements direct connections between different layers of the network. It has been shown that in some cases, training such residual networks can be easier than traditional deep convolutional neural networks.
[0134] ResNet 50 is a 50-layer residual network. ResNet 50 has 25M weights, so a full reduction of all weight gradients in single-position floating point format F16 involves 50 megabytes of local memory. To illustrate the bandwidth requirements, assume that a full full reduction is required for each full batch. This is likely (but not necessarily) a full reduction on gradients. To achieve this, each node must output 100 megabits per full reduction. ResNet 50 requires 250 Gigaflops (billion floating point operations per second) per image for training. If the subbatch size per processing node is 16 images, each processor performs 400 Gigaflops for each full reduction ensemble. If the processor reaches 100 Teraflops (one trillion floating point operations per second), about 25 gigabits per second are needed between all links to maintain concurrency of computation and full reduction communication. For sub-batches of 8 images per processor, the required bandwidth nominally doubles, which is partially mitigated by reducing the achievable Teraflops per second to process smaller batches.
[0135] Implementing an all-reduce collective between p processors, each starting with a local of size m megabytes (equal to the reduction size), requires that at least 2m.(p-1) megabytes be sent over the links. So if each processor has l links on which it can send simultaneously, the asymptotic minimum reduction time is 2m.(p-1)(p-1) divided by (p1).
[0136] The above-described concepts and techniques can be used in a number of different examples.
[0137] In one example, a fixed configuration is provided for use as a computer. In this example, the processing nodes are interconnected as described and illustrated in the various embodiments discussed above. In such an arrangement, only necessary intra-layer links and inter-layer links are placed between the processing nodes. In embodiments with end faces (e.g., box tube prisms and triangular prisms), there may be more inter-layer links between adjacent processing nodes in the endmost layer constituting the end faces than in the middle layers. Note that the term "face" is not only used to define an elongated face, but can also refer to the end face of a prism. However, as described above, the end faces of the prism constitute a ring of processing nodes in the corresponding endmost layer in each case.
[0138] A fixed configuration can be constructed from a precise number of processing nodes of the configuration. Alternatively, it can be provided by partitioning it from a larger structure. That is, a set of processing nodes can be provided that form a multi-faceted prism with a set of stacked layers. The processing nodes in each stacked layer can have: inter-layer links to corresponding processing nodes in an adjacent stacked layer; and intra-links between adjacent processing nodes in the layer. In this regard, the multi-faceted prism is similar to the configuration described and illustrated in the figure of the multi-faceted structure.
[0139] A fixed configuration of a desired number of stacked layers may be provided by disconnecting each inter-layer link in a specified stacked layer in the original set of stacked layers and connecting it to an adjacent processing node in the specified stacked layer to provide an intra-layer link. In this manner, a specified stacked layer in the original set of stacked layers may be made to form one of the first and second most end layers of a structure. Note that the layers of the original set may be partitioned into more than one fixed configuration structure in this manner.
[0140] The inter-layer links and intra-layer links are physical links provided by the above-mentioned appropriate buses or lines. In one form of expression, each processing node has a set of lines extending from it for connecting it to another processing node. This can be done, for example, by one or more interfaces of each processing node, which have one or more ports connected to the physical lines.
[0141] In another representation, the links may be made of on-board wiring. For example, a single board may support a group of chips, such as four chips. Each chip has an interface with ports that can be connected to other chips. Connections between chips may be made by soldering wiring to the board according to a predetermined method. Note that the concepts and techniques described herein are particularly useful in this context because they maximize the use of links between chips that are already pre-soldered on a printed circuit board.
[0142] The concepts and techniques described herein are particularly useful because they enable optimized use of non-switchable links. Configurations can be constructed by connecting the processing nodes described herein using fixed non-switchable links between the nodes. In some manifestations, if the additional links will not be used, there is no need to provide these additional links between the processing nodes. For example, in the middle layers of the configuration, there are fewer links between the processing nodes than in the last layers. Alternatively, links can be provided between the processing nodes, but in some configurations the links can be permanently deactivated.
[0143] In order to use the configuration, a set of parallel programs is generated. The set of parallel programs contains node-level programs, that is, programs that are specified to work on a specific processing node in the configuration. A set of parallel programs to operate on a specific configuration can be generated by a compiler. The compiler has the responsibility to generate node-level programs that correctly define the links to be used for each data transfer step for certain data. These programs include one or more instructions for implementing data transfer effects in a data transfer phase, which use link identifiers to identify the links to be used for that transfer phase. For example, a processing node may have two or three active links at any time (doubled if the links are also bidirectional). The link identifier enables the correct link to be selected for the data item in that transfer phase. Note that each processing node may not be aware of the actions of its neighboring nodes - the exchange activities are precompiled for each exchange phase.
[0144] Note also that the link does not necessarily have to be switched - the data item does not need to be actively routed while it is being transmitted, nor does the connectivity of the link need to be changed.
[0145] As mentioned above, the configuration of the computer network described herein is to enhance parallelism in computing. In this context, parallelism is achieved by loading node-level programs into processing nodes of a configuration intended to be executed in parallel, for example, training an artificial intelligence model in a distributed manner as described above. However, it will be easily understood that this is only one application of the parallelism achieved by the configuration described herein. A scheme for achieving parallelism is called "batch synchronous parallel" (BSP) computing. According to the BSP protocol, each processing node performs a calculation phase and an exchange phase after the calculation phase. During the calculation phase, each processing node performs its calculation task locally, but does not exchange its calculation results with other processing nodes. In the exchange phase, each processing node is allowed to exchange the calculation results of the previous calculation phase with other processing nodes in the configuration. Before the exchange phase of the configuration is completed, a new calculation phase will not be started. In this form of the BSP protocol, at the moment (juncture) of transitioning from the calculation phase to the exchange phase, or from the exchange phase to the calculation phase, or both, a barrier is placed for synchronization.
[0146] In this embodiment, when the exchange phase is initiated, each processing node uses the link identifier determined by the compiler for the exchange phase to execute instructions for exchanging data with its neighboring nodes. The nature of the exchange phase can be determined by using the aforementioned MPI message passing standard. For example, a collective, such as an all-reduce collective, can be called from a library. In this way, the compiler has a pre-compiled node-level program that controls the links on which local vectors (or corresponding fragments of local vectors) are transmitted.
[0147] Obviously other synchronization protocols can be used.
[0148] While particular embodiments have been described, other applications and variations of the disclosed technology may become apparent to those skilled in the art once given the disclosure herein.The scope of the present disclosure is not limited by the described embodiments but only by the appended claims.
Claims
1. A computer comprising a plurality of interconnected processing nodes, wherein the plurality of interconnected processing nodes are arranged in a configuration of a plurality of stacked layers, the plurality of stacked layers comprising a first end-most layer and a second end-most layer, and at least one intermediate layer, the plurality of stacked layers forming a multi-faceted prism; in, Each face of the multi-faceted prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein corresponding processing nodes of the first end-most layer, the at least one intermediate layer, and the second end-most layer are connected by respective inter-layer links to form respective edges of the configuration; wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring; wherein the processing nodes are programmed to operate the configuration to transmit data around each of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer via the at least one intermediate layer using only all processing nodes in one of the faces of the configuration once, and a second portion provided between the second end-most layer and the first end-most layer, and the second portion includes one of the edges of the configuration.
2. The computer according to claim 1, wherein: The multi-faceted prism has three processing nodes in each layer, thereby providing three corresponding faces for the first portion of the corresponding one-dimensional path.
3. The computer according to claim 1, wherein: In the at least one intermediate layer, each processing node is connected to its neighboring processing nodes through two intra-layer links.
4. The computer according to claim 1, wherein: In the first and second end-most layers, each processing node is connected to its neighboring processing nodes by three intra-layer links to enable data to be transferred simultaneously on three one-dimensional paths in the configuration.
5. A computer as described in claim 1, wherein the computer has been configured according to a multi-faceted prism comprising a set of stacked layers, and the processing nodes of each stacked layer have inter-layer links to corresponding processing nodes in an adjacent stacked layer and intra-layer links between adjacent processing nodes in the layer, and the intra-layer links are provided by disconnecting each inter-layer link in a specified stacked layer and connecting it to an adjacent processing node in the specified stacked layer, thereby the specified stacked layer forms one of a first end-most layer and a second end-most layer.
6. The computer according to claim 1, wherein: Each of the processing nodes is programmed to identify one of its inter-layer links and intra-layer links for transmitting data so as to determine the one-dimensional path for the data.
7. The computer according to claim 1, wherein: Each of the processing nodes is programmed to deactivate any link among its inter-layer links and intra-layer links that is not used in the data transmission step.
8. The computer according to claim 1, wherein: Each processing node is programmed to partition the node's corresponding local vector into segments and to transfer data in the form of consecutive segments around each one-dimensional path.
9. The computer of claim 8, programmed to operate each path as a set of logical rings, wherein: The consecutive segments are transmitted around each logical ring in a simultaneous transmission step.
10. The computer according to claim 8, wherein: Each processing node is configured to output a corresponding segment on each of the two links simultaneously.
11. The computer according to claim 8, wherein: Each processing node is configured to reduce two incoming segments to two corresponding locally stored corresponding segments.
12. The computer of claim 11, wherein: Each processing node is configured to transmit fully reduced segments simultaneously on each of the two links during the all-gather phase of the all-reduce ensemble.
13. The computer of claim 1, wherein: Each link is bidirectional.
14. A method of generating a set of programs to be executed in parallel on a computer, the computer comprising a plurality of processing nodes, wherein the plurality of processing nodes are arranged in a configuration of a plurality of stacked layers, the plurality of stacked layers comprising a first end-most layer and a second end-most layer, and at least one intermediate layer, the plurality of stacked layers forming a multi-faceted prism; in, each face of the multi-faceted prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected to each other by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein corresponding processing nodes of the first end-most layer, the at least one intermediate layer, and the second end-most layer are connected by respective inter-layer links to form respective edges of the configuration; and wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring; Wherein, the method comprises: generating at least one data transfer instruction for each program to define a data transfer phase in which data is transferred from a processing node executing the program, wherein the data transfer instruction includes a link identifier defining an outgoing link over which data is to be transferred in the data transfer phase; and The link identifiers are determined so as to transmit data around each of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer via the at least one intermediate layer using all processing nodes in one of the faces of the configuration only once, and a second portion provided between the second end-most layer and the first end-most layer, and the second portion includes one of the edges of the configuration.
15. The method of claim 14, wherein: Each program includes one or more instructions for deactivating any link among its inter-layer links and intra-layer links that is not used in the data transmission step.
16. The method of claim 14, wherein: Each program includes one or more instructions for dividing a local vector corresponding to a processing node on which the program is executed into segments and transmitting data in the form of consecutive segments via respectively defined links.
17. The method of claim 16, wherein: Each program includes one or more instructions for outputting a corresponding segment on each of two links simultaneously.
18. The method of claim 16, wherein: Each program includes one or more instructions for reducing two incoming segments to two corresponding locally stored corresponding segments.
19. The method of claim 18, wherein: Each program includes one or more instructions for transmitting fully reduced fragments simultaneously on each of two links during the all-gather phase of the all-reduce ensemble.
20. A method of executing a set of programs in parallel on a computer, the computer comprising a plurality of processing nodes, wherein the plurality of processing nodes are arranged in a configuration of a plurality of stacked layers, the plurality of stacked layers comprising a first end-most layer and a second end-most layer, and at least one intermediate layer, the plurality of stacked layers forming a multi-faceted prism; in, each face of the multi-faceted prism comprises a plurality of stacked pairs of processing nodes, wherein the processing nodes of each pair are connected to each other by at least two intra-layer links, and the processing nodes of each pair are connected to corresponding processing nodes in an adjacent pair by at least one inter-layer link, wherein corresponding processing nodes of the first end-most layer, the at least one intermediate layer, and the second end-most layer are connected by respective inter-layer links to form respective edges of the configuration; and wherein each pair of processing nodes forms part of one of the layers of the configuration, each layer comprising a plurality of processing nodes, each processing node being connected to its adjacent processing node in the layer by at least one intra-layer link to form a ring; Wherein, the method comprises: executing at least one data transfer instruction in each program to define a data transfer phase in which data is transferred from a processing node executing the program, wherein the data transfer instruction includes a link identifier defining an outgoing link over which data is to be transferred in the data transfer phase; The link identifiers have been determined so as to transmit data around each of a plurality of one-dimensional paths formed by corresponding sets of processing nodes and links, each one-dimensional path having a first portion between a first end-most layer and a second end-most layer via the at least one intermediate layer using all processing nodes in one of the faces of the configuration only once, and a second portion provided between the second end-most layer and the first end-most layer, and the second portion includes one of the edges of the configuration.
21. The method of claim 20, comprising executing the program to operate each path as a set of logical rings, wherein: Successive segments of the local vector provided at each processing node are transmitted around each logical ring in a simultaneous transmission step.
