# US 2022/0292399 A1 · Processing of reduction and broadcast operations on large datasets with mutli-dimensional hardware accelerators

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0292399 A1
- Document ID: US20220292399A1
- Status: Published application
- Kind: A1
- Application number: 17/637,200
- Filed: 2020-09-04
- Published: 2022-09-15
- Earliest claimed: 2019-09-06
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Bjarke Hammersholt Roune; Sameer Kumar
- Web page: https://patentgrep.com/patent/US20220292399A1

## CPC

- G06N 3/08: Learning methods
- G06N 20/00: Machine learning
- G06F 18/2137: based on criteria of topology preservation, e.g. multidimensional scaling or self-organising maps
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06N 3/045: Combinations of networks
- G06N 3/09: Supervised learning
- G06N 3/098: Distributed learning, e.g. federated learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and apparatus, including instructions encoded on storage media, for performing reduction of gradient vectors and similarly structured data that are generated in parallel, for example, on nodes organized in a mesh or torus topology defined by connections in at least two dimension between the nodes. The methods provide parallel computation and communication between nodes in the topology.

## Claims

### Claim at position 1

1-12. (canceled)

### Claim 13

A method for processing training data using processing hardware, the method comprising:
training a respective replica of a machine learning model on each node of a plurality of nodes organized in a multi-dimensional topology comprising rows and columns of nodes, wherein each node is trained on a respective batch of training data in parallel, whereby after the training each node holds a respective gradient vector resulting from the training; and
combining the respective gradient vectors in the nodes to generate a final gradient vector by performing operations comprising:
performing, by code executing on the nodes, a first phase of a circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each node of the row different combined data for a portion of the final gradient vector;
performing, by code executing on the nodes, a second portion of the first phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each node of the column a different column result comprising a portion of the combined data from each of the rows;
performing, by code executing on the nodes, a first portion of a second phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each column a portion of the final gradient vector comprising each column result; and
performing, by code executing on the nodes, a second portion of the second phase of the circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each row the final gradient vector comprising each portion of the final gradient vector from each of the columns.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
determining a type of the multi-dimensional topology of the plurality of nodes;
based on the type, mapping the first portion of the first phase to a first set of nodes and a first set of links between the first set of nodes; and
mapping the second portion of the first phase to a second set of nodes and a second set of links between the nodes, the first set of links being different from the second set of links.

### Claim 15 (depends on 13)

The method of claim 13, further comprising:
determining that the multi-dimensional topology of the plurality of nodes comprises wrap-around links; and
configuring each row and column of the multi-dimensional topology to execute the circle algorithm using the wrap-around links.

### Claim 16 (depends on 13)

The method of claim 13, wherein each node of the multi-dimensional topology comprises at least two sub-nodes.

### Claim 17 (depends on 16)

The method of claim 16, wherein the multi-dimensional topology comprises a torus topology, and wherein the sub-nodes of each node are configured to be neighboring nodes of the circle algorithm for each row and for each column.

### Claim 18 (depends on 16)

The method of claim 16, wherein the multi-dimensional topology comprises a mesh topology, and wherein the sub-nodes of edge nodes of the mesh are configured to be neighboring nodes of the circle algorithm for each row and for each column.

### Claim 19 (depends on 13)

The method of claim 13, wherein the multi-dimensional topology includes a set of nodes in a third dimension in addition to the rows and the columns, wherein the method further comprises:
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate in each node of the column a different third dimensional result comprising a portion of the column result from each of the columns; and
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate the final gradient vector from each of the columns in each node of the set of the nodes in the third dimension.

### Claim 20 (depends on 13)

The method of claim 13, further comprising pipelining data transfer between each of the nodes with the execution of the code on each of the nodes during performing of the first phase of the circle algorithm and performing the second phase of the circle algorithm.

### Claim 21 (depends on 13)

The method of claim 13, wherein the circle algorithm comprises a rotated pincer algorithm, wherein the first phase comprises a reduce-scatter phase of the rotated pincer algorithm, and wherein the second phase comprises a global gather phase of the rotated pincer algorithm.

### Claim 22 (depends on 13)

The method of claim 13, wherein the combined data for the portion of the final gradient vector comprises summed data from two or more nodes of the row, and wherein the portion of the combined data from each of the rows comprises summed data comprises the combined data from two or more nodes of the column.

### Claim 23

A data processing apparatus comprising a plurality of processing units, each processing unit corresponding to a respective node, wherein the data processing apparatus is configured to perform operations, the operations comprising:
training a respective replica of a machine learning model on each node of a plurality of nodes organized in a multi-dimensional topology comprising rows and columns of nodes, wherein each node is trained on a respective batch of training data in parallel, whereby after the training each node holds a respective gradient vector resulting from the training; and
combining the respective gradient vectors in the nodes to generate a final gradient vector by performing operations comprising:
performing, by code executing on the nodes, a first phase of a circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each node of the row different combined data for a portion of the final gradient vector;
performing, by code executing on the nodes, a second portion of the first phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each node of the column a different column result comprising a portion of the combined data from each of the rows;
performing, by code executing on the nodes, a first portion of a second phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each column a portion of the final gradient vector comprising each column result; and
performing, by code executing on the nodes, a second portion of the second phase of the circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each row the final gradient vector comprising each portion of the final gradient vector from each of the columns.

### Claim 24 (depends on 23)

The data processing apparatus of claim 23, wherein the operations further comprise:
determining a type of the multi-dimensional topology of the plurality of nodes;
based on the type, mapping the first portion of the first phase to a first set of nodes and a first set of links between the first set of nodes; and
mapping the second portion of the first phase to a second set of nodes and a second set of links between the nodes, the first set of links being different from the second set of links.

### Claim 25 (depends on 23)

The data processing apparatus of claim 23, wherein the operations further comprise:
determining that the multi-dimensional topology of the plurality of nodes comprises wrap-around links; and
configuring each row and column of the multi-dimensional topology to execute the circle algorithm using the wrap-around links.

### Claim 26 (depends on 23)

The data processing apparatus of claim 23, wherein the multi-dimensional topology includes a set of nodes in a third dimension in addition to the rows and the columns, wherein the operations further comprise:
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate in each node of the column a different third dimensional result comprising a portion of the column result from each of the columns; and
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate the final gradient vector from each of the columns in each node of the set of the nodes in the third dimension.

### Claim 27 (depends on 23)

The data processing apparatus of claim 23, wherein the operations further comprise pipelining data transfer between each of the nodes with the execution of the code on each of the nodes during performing of the first phase of the circle algorithm and performing the second phase of the circle algorithm.

### Claim 28

One or more non-transitory computer-readable storage media encoded with instructions which when executed by processing hardware cause the processing hardware to perform operations, wherein the operations comprise:
training a respective replica of a machine learning model on each node of a plurality of nodes organized in a multi-dimensional topology comprising rows and columns of nodes, wherein each node is trained on a respective batch of training data in parallel, whereby after the training each node holds a respective gradient vector resulting from the training; and
combining the respective gradient vectors in the nodes to generate a final gradient vector by performing operations comprising:
performing, by code executing on the nodes, a first phase of a circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each node of the row different combined data for a portion of the final gradient vector;
performing, by code executing on the nodes, a second portion of the first phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each node of the column a different column result comprising a portion of the combined data from each of the rows;
performing, by code executing on the nodes, a first portion of a second phase of the circle algorithm for each of the columns of the multi-dimensional topology in parallel to generate in each column a portion of the final gradient vector comprising each column result; and
performing, by code executing on the nodes, a second portion of the second phase of the circle algorithm for each of the rows of the multi-dimensional topology in parallel to generate in each row the final gradient vector comprising each portion of the final gradient vector from each of the columns.

### Claim 29 (depends on 28)

The computer-readable storage media of claim 28, wherein the operations further comprise:
determining a type of the multi-dimensional topology of the plurality of nodes;
based on the type, mapping the first portion of the first phase to a first set of nodes and a first set of links between the first set of nodes; and
mapping the second portion of the first phase to a second set of nodes and a second set of links between the nodes, the first set of links being different from the second set of links.

### Claim 30 (depends on 28)

The computer-readable storage media of claim 28, wherein the operations further comprise:
determining that the multi-dimensional topology of the plurality of nodes comprises wrap-around links; and
configuring each row and column of the multi-dimensional topology to execute the circle algorithm using the wrap-around links.

### Claim 31 (depends on 28)

The computer-readable storage media of claim 28, wherein the multi-dimensional topology includes a set of nodes in a third dimension in addition to the rows and the columns, wherein the operations further comprise:
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate in each node of the column a different third dimensional result comprising a portion of the column result from each of the columns; and
performing, by code executing on the set of nodes in the third dimension, a third portion of the first phase of the circle algorithm in parallel to generate the final gradient vector from each of the columns in each node of the set of the nodes in the third dimension.

### Claim 32 (depends on 28)

The computer-readable storage media of claim 28, wherein the operations further comprise pipelining data transfer between each of the nodes with the execution of the code on each of the nodes during performing of the first phase of the circle algorithm and performing the second phase of the circle algorithm.
