Programmable tensor processing unit for performing tensor computations
The TPU enables flexible tensor computations by allowing users to configure dataflows through control packet generation and PRN packet processing, addressing the limitations of fixed dataflows in existing systems.
Patent Information
- Application Number
- PCT/IN2026/050864
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-21
- Filing Date
- 2026-05-20
- Publication Date
- 2026-11-26
AI Technical Summary
Existing tensor computation systems are limited by fixed dataflows and lack flexibility, restricting users from designing their own dataflows, leading to a need for a highly versatile and reconfigurable computing architecture.
A tensor processing unit (TPU) with control packet generators, controllers, and a PRN mesh that allows users to configure dataflows, enabling flexible tensor computations through control packet generation and PRN packet processing.
The TPU provides high flexibility in designing dataflows for various tensor computations, enhancing computational versatility and efficiency.
Smart Images

Figure IN2026050864_26112026_PF_FP_ABST
Abstract
Description
PROGRAMMABLE TENSOR PROCESSING UNIT FOR PERFORMING TENSOR COMPUTATIONS TECHNICAL FIELD
[0001] The present disclosure relates to tensor processing unit (TPU) for performing tensor computations, and particularly, relates to a highly programmable and configurable TPU for performing tensor computations based on configuration input provided to the TPU.BACKGROUND
[0002] There exist several technologies and approaches related to performing tensor computations based on reconfigurable computing systems having technologies such as software-based compute graphs executed on reconfigurable data flow processor etc. However, such systems are based on abstraction of compute graphs and nodes in software, and the hardware is designed to satisfy those abstractions. So, the hardware architecture has a low degree of flexibility. In other technologies, the processor can only support a few dataflows, and the user must implement all computation using these dataflows only.
[0003] There arises a need for computing architectures that are less dependent or restricted to a single software abstraction or has fixed dataflows and gives the user the tools to design their own dataflows on the hardware. This would be a platform which could support tensor computations with highest level of versatility. Hence, there is a need for a reconfigurable dataflow processor design which gives the user a high degree of flexibility in terms of designing their own dataflows for performing widely different types of tensor computations.SUMMARY OF THE INVENTION
[0004] In general, embodiments of the present disclosure herein provide a system and method for migration of actions between software applications. Other implementations will be, or will become, apparent to one with skill in the art upon examination of the following figures and detailed description. It is intended that all such additional implementations be included within this description be within the scope of the disclosure and be protected within the scope of the following claims.
[0005] In accordance with an embodiment of the present disclosure, a tensor processing unit (TPU) for performing tensor computations is provided. The TPU comprises one or more control packet generators, wherein each control packet generator comprises at least one control packet sequence generator and one control packet buffer. The TPU also comprises one or more control interfaces, wherein each control interface is associated with a specific control packet generator and is constituted by one or more controllers connected in a chain formation, wherein the controllers of each control interface are connected to a set of PRNs (Processing and Routing Nodes) constituting a boundary of a PRN mesh and to a buffer module such that the control interface constitutes an interface between the buffer module and the PRN mesh.
[0006] The TPU is configured to receive an input, wherein the input includes configuration parameters associated with at least one control packet generator and generate, using the at least one control packet generator, one or more control packets based on the associated configuration parameters. The TPU is further configured to provide, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface and generate, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, wherein each PRN packet comprises a data word and routing information of the PRN packet.
[0007] Thereafter, the TPU is further configured to provide, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller, wherein the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh, perform, by the PRN mesh, computations based on the received PRN packets, wherein the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packets and provide as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.
[0008] In one aspect, each controller of the one or more control interfaces of the TPU is configured to receive PRN packets from a connected PRN of the set of PRNs constituting a boundary of the PRN mesh adjacent to the control interface of the controller. Further, the buffer module of the TPU comprises one or more arrays of addressable memory, and the data words are written in the arrays by a load module of the TPU before they are retrieved by one or more control interfaces. The data words stored in the one or more arrays of the buffer module areretrieved from a main memory by the load module, where the operations of the load module are configured by the user input. The data words stored in the one or more arrays of the buffer module are written into the main memory by a store module on completion of the tensor computation, where the operations of the store module are configured by the user input. The data words stored in the one or more arrays of the buffer module are provided back into the PRN mesh as packets when required for the next step of tensor computations.
[0009] In another aspect, the packets provided as output from the mesh are received by at least one controller of the one or more control interfaces, based on control packets received by the one or more controllers from the associated control packet generator. Herein, the data words contained in the packets provided as outputs are written in one or more arrays of the buffer module by the one or more controllers based on the control packets received from the control packet generator, where the control packets include a location of array in which output data words are to be stored.
[0010] In one aspect, the controllers are configured to receive the PRN packets from a connected PRN of the PRN mesh based on control packets provided by the associated control packet generator. Further, the PRN packets received include at least one of transformed data words and data words to be transferred from one control interface the other.
[0011] In one aspect, each control packet generated by a packet generator is pushed through a first controller of the control interface and moves sequentially to all controllers, and only controllers for which the control packet is designated is activated on receipt of the control packet.
[0012] In one aspect, the tensor computation is performed by the TPU over one or more steps of computations, wherein subsequent steps may utilize results of previous steps stored as data words in the buffer module.
[0013] In one aspect, the inputs received by the TPU include configurations relating to delay of operations of controllers, changing state of operation of controller, and initiating production of control packets, instructions relating to load and store operations, and values on which computation is to be performed. The operations of the TPU is configured based on inputreceived, and operations of the TPU are configured by configuring-the load module, store module, and the one or more control packet generators.
[0014] In one aspect, the PRN mesh of the TPU is a two-dimensional arrangement of interconnected PRNs, wherein at least one boundary of the PRN mesh is connected to a control interface. Further, in one aspect the control packet buffer is used for storing at least one control packet provided by a user.
[0015] In one aspect, the configuration parameters corresponding to a control packet generator includes parameters for configuring operations of at least one of the control packet sequence generators.
[0016] In one embodiment, a method of performing tensor computations using a TPU is provided. The method comprises receiving an input, where the input includes configuration parameters associated with at least one control packet generator and generating, using the at least one control packet generator, one or more control packets based on the associated configuration parameters. The method further comprises providing, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface and generating, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, wherein each PRN packet comprises data words and routing information of the PRN packet.
[0017] The method further comprises providing, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller where the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh, and performing, by the PRN mesh, computations based on the received PRN packets, wherein the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packet. Finally, the method comprises providing as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.
[0018] In another embodiment, a system for performing tensor computations using a TPU is provided. The system comprises a processor and a memory, where the memory stores program instructions which, when executed by the processor, causes the processor to receivean input, where the input includes configuration parameters associated with at least one control packet generator, generate, using the at least one control packet generator, one or more control packets based on the associated configuration parameters, and provide, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface.
[0019] The execution of the program instructions further causes the processor to generate, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, where each PRN packet comprises a data word and routing information of the PRN packet, and provide, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller, where the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh. Lastly, the execution of the program instructions causes the processor to perform, by the PRN mesh, computations based on the received PRN packets, where the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packets, and provide as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings constitute a part of the description and are used to provide further understanding of the present disclosure. Such accompanying drawings illustrate the embodiments of the present disclosure which are used to describe the principles of the present disclosure. The embodiments are illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and they mean at least one. In the drawings:
[0021] Fig. 1 illustrates an exemplary embodiment of the proposed TPU, in accordance with an embodiment of the present invention;
[0022] Fig. 2 illustrates the internal components of PRN nodes, in accordance with an embodiment of the present invention;
[0023] Fig. 3 illustrates the interfacing of PRN nodes within a PRN mesh, in accordance with an embodiment of the present invention;
[0024] Fig. 4 illustrates the sides of a 4*4 PRN mesh, and the different directions of movement of PRN packets in the PRN mesh, in accordance with an embodiment of the present invention;
[0025] Fig. 5 illustrates the internal architecture of a CPG of the proposed TPU 100, in accordance with an embodiment of the present invention;
[0026] Fig. 6 illustrates the pushing of control packets by the control packet generators into associated controllers, in accordance with an embodiment of the present invention;
[0027] Figs. 7(a) to 7(d) illustrates how a control packet generated by a CPG is pushed through a first controller, and sequential movement of the control packet through all the controllers in the chain of controllers, in accordance with an embodiment of the present invention;
[0028] Fig. 8 illustrates the different types of operations that may be performed by a controller on configuration based on a received control packet, in accordance with an embodiment of the present invention;
[0029] Figs. 9(a) to 9(c) illustrate the activation of select controllers based on receipt of activating control packet, in accordance with an embodiment of the present invention;
[0030] Fig. 10(a) to 10(d) illustrate movement of a multiple control packets with time through multiple controllers, in accordance with an embodiment of the present invention;
[0031] Figs. 11(a) to 11(c) illustrate the activation of controllers on receipt of the control packets, in accordance with an embodiment of the present application;
[0032] Fig. 12 illustrates an exemplary implementation where only a single control interface is programmed, in accordance with an embodiment of the present invention;
[0033] Fig. 13 illustrates the different wires that are used for providing inputs to the TPU for configuring its operations, in accordance with an embodiment of the present invention;
[0034] Fig. 14 illustrates a system in which the TPU may be implemented, in accordance with an embodiment of the present invention; and
[0035] Fig.15 illustrates a method implemented by components of the TPU for performing tensor computations, in accordance with an embodiment of the present invention.
[0036] Fig. 16 illustrates a first implementation of the proposed TPU, in accordance with an embodiment of the present invention.
[0037] Figs. 17(a)-(i) illustrates the computation of a transpose of a matrix based on the first implementation, in accordance with an embodiment of the present invention.
[0038] Fig. 18 illustrates a second implementation of the proposed TPU, in accordance with an embodiment of the present invention.
[0039] Fig. 19 illustrates the execution of a 2D convolution in the second implementation of TPU, in accordance with an embodiment of the present invention.
[0040] Fig.20 illustrates a third implementation of the proposed TPU, in accordance with an embodiment of the present invention.
[0041] Fig. 21(a) illustrates representative development board containing a chip with a general-purpose processor which can work with any devices connected on the USB port, and Fig. 21(b) illustrates a small USB device containing the TPU chip, in accordance with an embodiment of the present invention.
[0042] Fig. 22 illustrated a fourth implementation of the proposed TPU, in accordance with an embodiment of the present invention.
[0043] Fig.23 illustrated a fifth implementation of the proposed TPU, in accordance with an embodiment of the present inventionDETAILED DESCRIPTION OF THE INVENTION
[0044] The description that follows describes, illustrates and exemplifies one or more particular embodiments of the invention in accordance with its principles. This description is not provided to limit the invention to the embodiments described herein, but rather to explain and teach the principles of the invention in such a way that enables one of ordinary skill in the art to understand these principles and, with that understanding, be able to apply them to practice not only the embodiments described herein, but also other embodiments that may come to mind in accordance with these principles. The scope of the invention is intended to cover all such embodiments that may fall within the scope of the appended claims, either literally or under the doctrine of equivalents.
[0045] It should be noted that in the description and drawings, like or substantially similar elements may be labelled with the same reference numerals. However, sometimes these elements may be labelled with differing numerals, such as, for example, in cases where such labelling facilitates a clearer description. Additionally, the drawings set forth herein are not necessarily drawn to scale, and in some instances, proportions may have been exaggerated to more clearly depict certain features. Such labelling and drawing practices do not necessarily implicate an underlying substantive purpose. As stated above, the specification is intended to be taken as a whole and interpreted in accordance with the principles of the invention as taught herein and understood to one of ordinary skill in the art.
[0046] With respect to the exemplary systems, components and architecture described and illustrated herein, it should also be understood that the embodiments may be embodied by, or employed in, numerous configurations and components, including one or more systems, hardware, software, or firmware configurations or components, or any combination thereof, as understood by one of ordinary skill in the art. Accordingly, while the drawings illustrate exemplary systems including components for one or more of the embodiments contemplated herein, it should be understood that with respect to each embodiment, one or more components may not be present or necessary in the system.
[0047] As used herein, the term “comprising” means including but not limited to and should be interpreted in the manner it is typically used in the patent context. Use of broaderterms such as comprises, includes, and having should be understood to provide support for narrower terms such as consisting of, consisting essentially of, and comprised substantially of.
[0048] The phrases “in one embodiment,” “according to one embodiment,” “in some embodiments,” and the like generally mean that the particular feature, structure, or characteristic following the phrase may be included in at least one embodiment of the present disclosure, and may be included in more than one embodiment of the present disclosure (importantly, such phrases do not necessarily refer to the same embodiment).
[0049] The word “example” or “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any implementation described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other implementations.
[0050] The present disclosure relates to a highly configurable TPU for performing tensor computations based on configuration parameters provided by users, where the users include programmers responsible for configuring the TPU for performing various types of tensor computations, and individuals who wish to perform tensor computations using the proposed TPU. The present disclosure also relates to a method of performing tensor computations using the proposed TPU, and systems for performing tensor computations, where the systems comprise the proposed TPU.
[0051] Fig. 1 illustrates an exemplary embodiment of the proposed TPU, in accordance with an embodiment of the present invention. The TPU 100 comprises one or more control packet generators (CPGs) (collectively labelled 102) and one or more control interfaces (collectively labelled 104), where each control interface is connected to a control packet generator 102 and is constituted by one or more controllers (collectively labelled 106). While the exemplary embodiment illustrated in Fig. 1 comprises 3 CPGs (CPGA 102-A, CPGB 102-B, and CPGC 102-C) and 3 control interfaces (control interface A 104-A, control interface B 104-B, and control interface C 104-C) having 4 controllers each, other embodiments of the proposed TPU may have varying number of CPGs, control interfaces and controllers.
[0052] The TPU 100 further comprises a PRN mesh 108, a buffer module 110, a load module 112, and a store module 114. The control packet generators 102, the load module 112, and the store module 114 constitute the configurable components of the proposed TPU 100,wherein the configuration of the components is based on an input received from a user such as a programmer, or based an input provided based on some automated functionality implemented in a computing system or device which uses the proposed TPU 100 for performing tensor computations.
[0053] The tensor computations are performed by the PRN mesh 108, where the PRN mesh 108 is comprised of a plurality of PRNs (Processing and Routing nodes) connected to each other in a systolic array arrangement. A PRN is used for movement of data through it, and also supports computations of types:1) Unary: a -> f ( a )2) Binary : (a,b) -> g ( a, b )3) Ternary : ( a , b , c ) -> h ( a, b, c ).
[0054] The above-mentioned types of computations performed by a PRN are based on its internal components, as illustrated in Fig. 2. Each PRN 200 used in the proposed TPU comprises a router 202, a compute unit 204 for performing the above-mentioned different types of computations, and registers 206. Further, the boundary of each PRN 200 comprises 8 FIFOs (collectively labelled 208) for synchronizing incoming and outgoing of data through it in all 4 directions, where the data moves as packets. The plurality of PRNs constituting the 2D PRN mesh are connected and interfaced to each other as illustrated in Fig. 3. The interfacing of PRNs within the PRN mesh, as illustrated in Fig.3, enables movement of PRN packets between the PRNs of the PRN mesh. Fig. 4 illustrates the sides of a 4*4 PRN mesh, and the different directions of movement of PRN packets in the PRN mesh 400.
[0055] The PRN mesh 108 of the TPU 100 performs tensor computations based on PRN packets received from the controllers 106 of the TPU 100. PRN packets are packets used for transfer of data words between the PRNs, and each PRN packet comprises a data word, and the routing information of the PRN packet. The routing information of a PRN packet include the distance, direction and type of the packet movement. Herein, the type means whether the packet is moving data from one edge of the mesh to another edge, or whether the data that it is carrying has to be used as operands in some computation happening at one of the PRNs, or whether the data word is to be stored (persisted) in one of the PRN registers.
[0056] The PRN packets are generated by controllers 106 based on control packets provided to the controllers 106 by CPGs 102, and each PRN packet has specific destinations or destination PRNs for which it is generated, wherein the destination PRNs perform computations based on the received PRN packet. In addition to generating PRN packets, the controllers 106 are also configured to receive PRN packets from the PRN mesh.
[0057] In certain embodiments, PRN packets may be generated by a source controller for the purpose of moving data words to a destination controller and thereafter to a location in the buffer module 110. In such embodiments, the routing information of the PRN packets comprise information relating to the destination, and the PRN packets are passed from the generating controller to the PRN mesh 108, and received by the destination controller. The PRN packets received by a controller may be a PRN packet as generated by the source controller, or may be a transformed PRN packet obtained corresponding to tensor computations performed in the PRN mesh 108 with respect to an original PRN packet.
[0058] The PRN packets are generated by the controllers 106 corresponding to data words on which computations are to be performed, and such data words are obtained from the buffer module 110 of the TPU 100. The buffer module 110 of the TPU 100 is used for storing data words, where the data words are stored in one or more arrays of addressable memory within the buffer module 110. The arrays of the buffer module 110 can be implemented using registers, SRAM cells, or any similar suitable technology. The arrays can have single or multiple RD / WR ports. The buffer module 110 can have a single or a group of multiple blocks of arrays, and the blocks can have word arrays that are either single or multi-ported. The arrays of the buffer module 110 support both reading and writing operations from and to the arrays.
[0059] The data words stored in the buffer module 110 may be data words loaded into the buffer module 110 by load module 112, where the data words relate to data on which tensor computations are to be performed. Such data words are accessed from a main memory and thereafter stored into the buffer module 110 by the load module 112. Further, the data words stored in the buffer module 110 may also include data words relating to results of the computations performed in the PRN mesh 108, which may be stored in the buffer module 110 for future use or reference in future computations.
[0060] Each controller has connection to one or more array of words within the buffer module 114, which it can access using an addressing logic. A controller will only access data from one array at a time. The switching of the connections of the controller with the multiple arrays that it is associated with is performed based on configurations indicated in the input provided to the TPU 100. So, these connections can be switched during the operation of the TPU 100 for various computing needs.
[0061] The controllers 106 of a control interface 104 generates PRN packets corresponding to the data words read from the buffer module 110 based on control packets received from the CPG corresponding to the control interface 104. For example, with reference to the exemplary embodiment illustrated in Fig. 1, one or more controllers 106-A of control interface 104-A generates PRN packets based on control packets received from the CPGA 102-A. The control packets are generated by the CPGs 102 of the TPU 100 based on input received by the TPU 100, where the input include configuration parameters for generating control packets.
[0062] Control packets are generated by at least one CPG of the TPU 100. Fig.5 illustrates the internal architecture of a CPG of the proposed TPU 100, in accordance with an embodiment of the present invention. Each CPG 500 comprises one or more control packet sequence generators (collectively labelled 502) CO to Cn. In the embodiment illustrated in Fig.5, the CPG 500 comprises 3 control packet sequence generators CO 502-1, Cl 502-2, and C2502-3.The control packet sequence generators 502 are used for generating a sequence of control packets, based on inputs received. The control packet sequence generators 502 are programmed by a fixed number of parameters (each of CO, Cl, C2 will have a different set of parameters for different types of sequences) and generates a programmed number of packets in a sequence. Values corresponding to the fixed number of parameters, based on which the control packets are generated by the control packet sequence generators 502, are obtained from configuration parameters provided in the received input.
[0063] Specifically, the inputs received are used for programming the CPG 500, and comprises configuration parameters for generating control packets. The inputs may be comprised by one or more configuration parameters provided over different iterations or stages, where each configuration parameter includes parameters for configuring one control packet sequence generator 502. Based on the parameters received by a control packet sequencegenerator, the control packet sequence generator generates one or more control packets. The sequence of control packets generated collectively are provided to the chain of controllers constituting the control interface associated with the CPG 500.
[0064] The CPG 500 also comprises a control packet buffer 504 for storing control packets provided directly by the user to the CPG, which is thereafter provided by the CPG to the corresponding controllers. In certain embodiments, the control packet buffer 504 may be a FIFO buffer. The control packet buffer 504 is used for control packets that are put by the programmer from outside the TPU. These are the control packets that will be generated outside and put into the CPG along with the number of packets that will go in one transaction of CPG. A register holds the count of control packets that it has to release into the controller chain. A CPG 500 of the proposed TPU will always comprise one control packet buffer 504, and one or more control packet sequence generators 502.
[0065] In certain embodiments, the input received by the CPG may also include an indication of the generator types, i.e., whether either one of the control packet sequence generators 502 or the control packet buffer 504 is to be used by the CPG 500 for generating the control packets. Further still, in certain embodiments, the input may also include a specification of which of the plurality of control packet sequence generators 502 are to be used for generating the control packets. In certain embodiments, the input received may also include a signal relating to when the control packet generation is to be initiated in the CPG 500. All the wires and buses on the left side of the CPG 500 would be Read and Written by the user.
[0066] The control packets thus generated by the CPGs 102 are provided to the different associated controllers, as illustrated in Fig. 6. As illustrated in Fig. 6, the CPGs 602 are connected to the starting end of the corresponding control interfaces (constituted by the chain of controllers). The control packets generated by the CPGs 602 effectively program the controllers to do the Produce / Consume transactions for required number of iterations, i.e., either produce PRN packets to be provided to the PRN mesh 108 or consume PRN packets from the PRN mesh 108.
[0067] Each controller 106 has a counter which when populated with some non-zero value will do a number of transactions with only the adjoining PRN of the PRN mesh 110 or both with the adjoining PRN and a buffer array selected by programming due to the control packet.The controller 106 may just interact with adjoining PRN in case of packets being transferred into the PRN which contain constant data words, which means that they would not be needed to be queried from a buffer array. This will happen only when the controller is producing packets.
[0068] For all other cases, the controller 106 will be transacting with its adjoining PRN as well as one of the many buffer arrays to which it is a client. In case of producing packets into the PRN mesh 108, the controller 106 will query the data word from one of the buffer arrays and create the packet based on the fields in the control packet that has programmed the controller and push it into the connected PRN. In case of consuming packets from the PRN mesh 108 into the buffer module 110, the controller 106 will get the data word from the packet received from the adjoining PRN, and based on the fields programmed into it by the control packet, it will create write request into one of the buffer arrays at a given array location. This array location again comes from the control packet.
[0069] The array location will be updated after each read or write operation, in case multiple iterations are there. The address gets updated for multiple iterations of both read / write during producing / consuming of PRN packets respectively. During production of PRN packets into the mesh, the fields apart from the data words, which constitute the routing information , may also get updated based on the rule specified in the control packet.
[0070] Each control packet also contains information about the fields in the PRN packets that will be generated when a controller 106 need to produce packets into the mesh, and also how those fields will be updated in case of multiple iterations. The control packet also contains information about the buffer location (address) from which the data words would be queried and also the rule (increment / decrement, strides etc.) of updating the request address in the subsequent iterations. Similarly, when the controller 106 needs to consume packets coming from the PRN mesh 108 and store the data words from the packet into some locations into the buffer arrays of the buffer module 110, the control packet that has initialized the controller activity contains information about the starting address in buffer array where the data has to be written as well as the address update rule in the case of multiple iterations. Whether the controller 106 has to consume or produce is also programmed by the control packet.
[0071] The PRN packets and the control packets that traverse through the chain of controllers and program them for Producing / Consuming packets have the following contents. The following packets relate to exemplary PRN packets and control packets that may be used in the implementation of the proposed TPU 100.PRN_Packet_travel_control{PRN_Packet_start_distance;PRN_packet_end_distance,Turn_direction,Movement_type,Computation_OP
[0072] This above group of values is a part of both PRN_Packet and Control_Packet and contains the fields that give the packets moving in the PRN mesh 108 the required direction as to where to stop, which direction to turn in and whether to take part in computation or not, etc. Description of the fields used in the above packet are as follows:1. PRN packet start distance, PRN packet end distance: From the side of the PRN mesh 108 where the PRN_packet is injected into the PRN mesh 108, what is the straight distance that the packet must travel. Combination of start_distance and end_distance can be used in different contexts of use cases.2. Turn direction: The direction in which the packet should turn after going straight for the given number of PRNs.3. Computation OP : If the packet has to take part in computation, then what computation operation will it be is indicated by this field.4. Movement type : Whether the movement of the packets results in storage of the values in PRN registers, computation in the PRN , storage after computation in the PRN node or simply results in movement of packets from one side of the mesh to another side of the mesh.PRN_Packet[Data_word,PRN_Packet_travel_control
[0073] This above group of values constitute the PRN_packet. We can see it just has the PRN_packet_travel_control as discussed above and the additional data word that it carries. This is the content of the packet that is produced by the controller into the mesh and consumed from the mesh in case of Production and Consumption respectively.ControlPacket{First_controller ,Last_controller,Address_update_type,Start_address,Address_stride,PRN_Packet_travel_control,PRN_Packet_travel_distance_update_type,Iterations,Put_constant?,Constant_value,Data_direction
[0074] This above group of values constitute the control packet which is produced by each CPGs and goes along the chain of controllers, selectively programming them along the way. The meaning of the fields used above are as follows:1. First controller , Last controller: The first and the last controller respectively in the chain of controller in between whom ( and including both ) , all the controllers will be programmed by the control packet that move across them.2. Address update type: When the controller is reading or writing data from a buffer array , then how will the address of data words be updated during multiple interactions of the controller programmed by a single packet. Can be INCREMENT, DECREMENT or NOCHANGE.3. Start address: The starting address that the controller will do the first iteration from.4. Address stride: The value by which the addresses are updated across iterations.5. PRN Packet travel distance update type: How the distance fields in the PRN_packet_travel_control will be updated across multiple iterations.6. Iterations: The number of iterations that a single controller will do after being programmed by a single control packet7. Put constant?: Are we producing PRN_packets with constants into the mesh.8. Data direction : PRODUCE or CONSUME PRN packets.
[0075] Figs. 7(a) to 7(d) illustrates how a control packet generated by a CPG is pushed through a first controller, and sequential movement of the control packet through all the controllers in the chain of controllers. The figures also illustrate how controllers corresponding to which the control packet is created is selectively activated on receipt of the control packet. In the exemplary embodiment illustrated in Figs. 7(a) to 7(d), the second controller 706-2 is activated after receipt of the control packet.
[0076] On receipt of a control packet created for activating a controller, the controller may either create a PRN packet to be provided to the PRN mesh 108, or provide a data word received from the PRN mesh 108 to the buffer module 110. The different types of operations that may be performed by a controller configured based on receipt of a control packet is illustrated in Fig. 8. The different types of operations that may be performed by a controller based on activation by a received control packet include reading a data words from a buffer location,generating PRN packets to be put into the PRN mesh 108, receive a PRN packet from the PRN mesh 108, writing a data word into the buffer array, and passing a received control packet to the next controller in the chain of controllers.
[0077] Figs. 9(a) to 9(c) illustrate the activation of the second controller 906-2 and third controller 906-3 based on receipt of activating control packet, wherein the receipt of the control packets are illustrated in Fig. 7. Based on the configuration provided in the control packet received by the second controller 906-2 and third controller 906-3, one or more PRN packets may be produced by each of the controllers to be pushed into the PRN mesh.
[0078] Similarly, Fig. 10(a) to 10(d) illustrate movement of a multiple control packets with time, where the multiple control packets are generated by the CPG 1002 in a sequence for programming all the required controllers in the chain. Correspondingly, Figs. 11(a) to 11(c) illustrate the activation of controllers on receipt of the control packets, in accordance with an embodiment of the present invention. In the exemplary embodiment illustrated in Figs. 10 and 11, the user wishes to use just the second controller 1006-2 / 1106-2 and the third controller 1006-3 / 1106-3.
[0079] Hence, in the proposed TPU 100, tensor computations are performed by PRNs of the PRN mesh 108, based on PRN packets received from controllers 106. The PRN packets are generated by the controller 106, based on configurations provided in control packets generated by CPGs 102. In addition to generating PRN packets, the controllers 106 may also be configured by the control packets to receive PRN packets from the PRN mesh 108, and the data words contained in the received PRN packets may be stored into the buffer module 110 by the controllers, based on configurations relating thereto contained in the control packet received from the corresponding CPG 102. If the data word written by the controller 106 relates to an output of the tensor computations to be written into the main memory, the store module 114 is used for performing such store operations.
[0080] In some embodiments, the control packets based on which operations of the controllers 106 of the TPU 100 are configured, may be generated by one or more CPGs of the TPU 100, based on the input received. The CPGs can be programmed corresponding to the input received in the following combination:Singly A, B or C : This means that the input may intend to engage just one side of controllers of the PRN mesh with the mesh elements. This will be done when the user wants to persist some values in the PRN registers from any of the sides of the mesh. The single side that is being programmed can emit the packet with travel information so that they reach the appropriate PRN element and get persisted. In such embodiment, there is just one producer, i.e., one or more controllers of control interface connected to only the single producer of control packets generate the PRN packets.Another use case is when the user intends to store a unary transformed value into a certain location of the PRN mesh.Fig. 12 illustrates an exemplary implementation where only a single control interface is programmed, in accordance with an embodiment of the present invention. Herein, only CPGA 1202-A is configured, and controllers of control interface A 1204-A are configured by control packets generated by CPGA 1202-A. The data after it has reached the required PRN undergoes transformation according to the function f(x) = 2*x. This operation is programmed in all the PRN packets generated by the controllers of the control interface A 1204-A, which is detected by the required PRNs and executed and the result is persisted in the PRN registers.Pairs of sides (AB, BC, CA): In such an implementation, one side (i.e., controllers corresponding to one side of the PRN mesh 108) would act as a producer of PRN packets and the other side would act as a consumer of PRN packets, where the consumed PRN packets may be the same PRN packets as shared by the producer, or transformed packets.A use case for this is when we want to move a block of tensor data stored in the buffer from a certain location to another location. This can be achieved by moving between sides B and C, where one of them is a producer and another is a consumer. Also, shape change of tensor blocks can be implemented with appropriately selecting the pairs and configuring the packet generation logic.Computation is another application of the above implementation, where the input is fed in from one side, the unary computation transforms the Data points and resulting valueis read out through another side. Binary computation may also be done in this case, if the user intends to use the values persisted in the registers of the PRNs as the second operand.3. All 3 sides: 2 Producers and 1 Consumer side OR 1 Producer and 2 Consumer sides In such an implementation, different types of operations, such as transformations, data movements or transformed data movements can be performed.
[0081] The operations of the TPU 100 are programmed based on the input provided to the TPU 100, where the inputs include configuration parameters for configuring the operations of the CPGs 102, the load module 112, and the store module 114. The different wires and inputs that may be used by a user to program or configure the above-mentioned components of the TPU 100 is illustrated in Fig. 13. The different configurations parameters and configuration inputs included in the input provided by the user, illustrated in Fig. 13, is as follows:1. Delay A, Delay B, Delay C ( Inputs ) : Such input are provided to introduce delay in cycles after controllers 106 have done their job, to ensure that data has reached the location where it is intended to. This helps in handling the race conditions that might happen when production and consumption from different set of controllers 106 is happening asynchronously (when only singly programming a CPG 102 for production of PRN packets into the PRN mesh 108 and storing the data (transformed or not) into the required location in the PRN mesh, it is by design asynchronous, and it is uncertain exactly how many cycles after the controllers have finished their job, the data has exactly reached its required location and has undergone the required transformation. So, the user may determine the worst case delay possible for this transaction and provide it in these delay fields.2. Status A, Status B, Status C ( Outputs ): Status inputs are provided to the user to indicate the status of the control interfaces 104. BUSY status output may be provided when at least one controller of a side (control interface) is not idle and is fulfilling the needs of control packet that has programmed it. Alternatively, the BUSY status may also be provided when the TPU is counting the DELAY. Further still, the BUSY status also be provided when the CPG corresponding to a side or control interface has notcompleted producing packets. In all other instance, the status output is provided as IDLE.3. Start A, Start B, Start C ( Inputs ) : Start the production of control packets from the corresponding CPGs
[0082] Fig. 14 illustrates a system in which the TPU may be implemented, in accordance with an embodiment of the present invention. The system 1400 comprises a TPU 1402, a main memory IP 1404, and a processor 1406. In the embodiment illustrated in Fig. 14, the processor 1406 is a General-Purpose processor, and the TPU 1402 is comprised within a computing unit 1408. The processor 1406 may be used for managing the operations of the TPU 1402, and may be used to configure the TPU 1402 based on instructions stored in the main memory, or based on instructions received from a user.
[0083] The method performed by components of the TPU for performing tensor computations is illustrated in Fig. 15. At step S1501, the input is received by the TPU from a user. The input may be received from users such as programmers of the TPU, or as an input provided a computing device of a computing system in which the TPU is installed. At step S1502, control packets are generated by one or more CPGs of the TPU, where the one or more CPGs that generate the control packets are selected based on inputs received in step S1501.The operation of the one or more CPGs for generating control packets are based on configuration parameters that are provided in the input.
[0084] At step S1503, one or more of the generated control packets are provided sequentially through the controllers of the control interface associated with the CPG that generated the control packets, and the controllers for which each control packet is generated gets activated on receipt of the control packets. The operations of the controller are then configured based on the control packet, where the configurations include either configurations relating to producing or consuming the PRN packets.
[0085] The controllers that are configured to produce PRN packets generate one or more PRN packets based on the received control packets, and the PRN packets generated may include data words received from the buffer module. The data words received from the buffermodule may be data words that were loaded into the buffer module by the load module, or data words that were saved in the buffer module during previous iterations of tensor computations performed by the TPU.
[0086] At step S1504, the PRN packets generated by each controller are provided into the PRN mesh through the PRNs that constitute an edge of the PRN mesh. Each PRN packet may be configured for a particular PRN, and after the PRNs receive their PRN packets, computations are performed by the PRNs based on the PRN packets at step S1506. At step S1507, the output of the computations are provided as PRN packets to controllers configured by control packets to receive such PRN packets, and the data words stored in the PRN packets are written into the buffer module by the controllers. Thereafter, if the data words written into the buffer module constitute a final output of the tensor computations that are required to be provided back to the main memory, then the store module performs store operation for saving the data words to the main memory.
[0087] Fig. 16 illustrates a first implementation of the proposed TPU, in accordance with an embodiment of the present invention. In the first implementation, the PRN mesh of the TPU is a 4x4 mesh. There are 4 arrays of data words, and each data word is addressable within an array. Each array just has single port through which all requests of RD / WR are processed. The set of 4 controllers on all 3 sides of the mesh are connected to the set of 4 ports in a one-to-one mapping. So, a single data array in the buffer module is connected to 3 controllers from the 3 sides. The RD / WR requests from the 3 controllers goes through an arbiter in round-robin fashion and get served by the array one by one.
[0088] Each array is also connected to the LOAD and STORE unit, via the same RD / WR port. The RD / WR requests from the LOAD and STORE modules also go through the arbiter and compete with the requests from the controllers to get served. A total of 5 connections are there for each data array port. In one embodiment, a round robin arbitration may be implemented, where a single set of arrays and all the 3 sets of controllers connected to the same set of ports of the arrays, are all implementations of the rules that were mentioned in the writeup document shared earlier. Similarly, different embodiments of the first implementation may have different arbitration schemes. In all embodiments of the first implementation, the array set will always contain the same number of arrays as the number of controllers that the chain of controllers hasto which it is going to be mapped. Further, all the 4 arrays will have the same addressing -starting from 0 at the top.
[0089] Different tensor computations may be performed using the first implementation of the TPU as illustrated in Fig. 16. For example, the TPU may be used for finding the transpose of a 3x3 matrix. In the exemplary transpose computation, the 3x3 matrix may be as follows:' 7 4—9 1. 0 2.
[0090] Figs. 17(a)-(i) illustrates the computation of a transpose of a matrix based on the first implementation, in accordance with an embodiment of the present invention. The LOAD module (programmed by the user), will bring in the data for matrix A into the buffer arrays in the shown arrangement. Thereafter, the user will program the CPGA and CPGB for programming the controllers to generate the PRN packets and consuming the PRN packets respectively. In the computation illustrated in Fig. 17(a), the CPGA is be provided with a single Control Packet via the direct path (without using the programmable components inside the CPGA which are CO, Cl, C2 etc.) for producing PRN packets from the A side boundary PRNs. The CPGB will also be provided with a single Control Packet via the direct path for Consuming the PRN packets as they come to the B side boundary PRNs.
[0091] Figs. 17(b) to 17(e) illustrated how the data contained in the PRN packets moves along the mesh. Thereafter, once all the values are pushed into the PRN mesh through side A as illustrated in Fig. 17(e), PRN packets will start moving into the B side controllers and the controller will write the data words contained in them to the correct memory location in the buffer. The packet travel control information in the PRN packet get updated as they hop from one PRN to another, as a result of which the packet gets guided to its ultimate destination. The hardware logic for doing this update is within each PRN node in the mesh.
[0092] Figs. 17(f) to 17(1) illustrated have the data in the PRN mesh is written into the buffer array by the controllers in control interface of side B. Once the data words in the PRN mesh are completely written into the buffer array, as illustrated in Fig. 17(i), the values may be written into the main memory by the STORE module programmed by the user.
[0093] Fig. 18 illustrates a second implementation of the proposed TPU, in accordance with an embodiment of the present invention. In the second implementation, the proposed TPU may have a PRN mesh of 4x4 size. Further, 3 sets of 4 arrays of data words are used in the second implementation, and each data word is addressable within an array. The 3 sets of arrays are connected in different ways to the LOAD module, STORE module and Controllers of the TPU, as illustrated in Fig. 18. Such an implementation may be used by a designer of a system to achieve certain performance requirements in their applications.
[0094] For instance, the second implementation of the proposed TPU, as illustrated in Fig.18, may be used for computation of 2D convolution. Fig. 19 illustrates the execution of a 2D convolution in the second implementation of TPU, in accordance with an embodiment of the present invention. In the execution of 2D convolution, the X values will be loaded into the buffer arrays on the A side and W values on the B side arrays of the buffer. The output Y will be stored on the C side arrays of the buffer. Details computations performed by the TPU in the second implementation are as follows:2D Convolution: Input 3 x 3 x 2, Filters 2 x 2 x 2, No Padding,Stride™!Input TensorP 4 •:< ] 0 0 3Filter Weights VtAH $ / - 1.2Convol u tion FinmulaUp 5252 y <.«« wiu.. o, i .Detailed ComputationsFilial Output Tensor F <0 iS2*-*J
[0095] The execution of 2D convolution in the third implementation of the proposed TPU, as illustrated in Fig. 19(a), involves 3 sets of buffer arrays in the buffer module, each having different kinds of connections with the controllers. The Load Module will load the data of X and W in the appropriate locations in the buffer arrays. Then the CPGs will be programmed by the user to calculate the output using these 2 input tensors. The values are loaded into the A side buffer arrays and B side buffer arrays. There will be total 4 iterations of calculations for getting the final output Y. Each iteration will build on the previous iteration which calculated its set of partial sums.
[0096] For CPGB and CPGC, the addresses in the controllers are incrementing in a very simple order. So, this increment operation can be programmed by a single control packet travelling to all the controllers in the controller chain. Hence, CPGB and CPGC will be getting the control packet directly from the user through the buffer route. For CPGA, the addresses in the controllers are not incrementing just by a fixed amount. They have a certain pattern which is dictated by the need of the convolution calculation. For such a pattern, the CPGA uses a “Convolution” control packet sequence generator which would be programmed by the user to produce the control packets in the required sequence. Each control packet will just contain 1 address, it will do its activity on the controller if it is intended to and then move onto the next controller. Fig. 19(b) illustrates the output of the convolution executed in the second implementation, in accordance with an embodiment of the present invention. Herein, required calculated output is obtained in the C side buffer arrays. Now, the Store module can take these values and put them into main memory.
[0097] Fig.20 illustrates a third implementation of the proposed TPU, in accordance with an embodiment of the present invention. In the third implementation, a chip on a development board 2002 can be configured to communicate with a TPU chip 2004 via a USB connection, and the TPU chip 2004 may be used for speeding up the execution of tensor processing in its application. Fig. 21(a) illustrates representative development board containing a chip with a general -purpose processor which can work with any devices connected on the USB port, and Fig. 21(b) illustrates a small USB device containing the TPU chip.
[0098] Fig. 22 illustrates a fourth implementation of the proposed TPU, in accordance with an embodiment of the present invention. The proposed TPU may be implemented on a FPGA (Field Programmable Gate Array) chip 2202, where the FPGA chip is connected to acomputing system 2204. The computing system 2204 uses the TPU on the FPGA chip to speed up tensor-based calculations. Fig. 23 illustrated a fifth implementation of the proposed TPU, in accordance with an embodiment of the present invention. The fifth implementation involves a single development board having both general purpose CPU chip and the TPU chip containing just the TPU. The TPU chip will be used by the CPU chip for accelerating tensor based calculations.
[0099] Any combination of the above features and functionalities may be used in accordance with one or more embodiments. In the foregoing specification, embodiments have been described with reference to numerous specific details that may vary from implementation to implementation. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. The sole and exclusive indicator of the scope of the invention, and what is intended by the applicants to be the scope of the invention, is the literal and equivalent scope of the set as claimed in claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction.
Claims
WE CLAIM:
1. A tensor processing unit (TPU) for performing tensor computations, the TPU comprising:one or more control packet generators, wherein each control packet generator comprises at least one control packet sequence generator and one control packet buffer;one or more control interfaces, wherein each control interface is associated with a specific control packet generator and is constituted by one or more controllers connected in a chain formation;wherein the controllers of each control interface are connected to a set of PRNs (Processing and Routing Nodes) constituting a boundary of a PRN mesh and to a buffer module such that the control interface constitutes an interface between the buffer module and the PRN mesh, andwherein the TPU is configured to:receive an input, wherein the input includes configuration parameters associated with at least one control packet generator;generate, using the at least one control packet generator, one or more control packets based on the associated configuration parameters;provide, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface;generate, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, wherein each PRN packet comprises a data word and routing information of the PRN packet;provide, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller, wherein the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh;perform, by the PRN mesh, computations based on the received PRN packets, wherein the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packets; andprovide as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.
2. The TPU as claimed in claim 1, wherein each controller of the one or more control interfaces of the TPU is configured to receive PRN packets from a connected PRN of the set of PRNs constituting a boundary of the PRN mesh adjacent to the control interface of the controller.
3. The TPU as claimed in claim 1, wherein the buffer module of the TPU comprises one or more arrays of addressable memory, and data words are written in the arrays by a load module of the TPU before they are retrieved by one or more control interfaces.
4. The TPU as claimed in claim 1, wherein the packets provided as output are received by at least one controller of the one or more control interfaces, based on control packets received by the one or more controllers from the associated control packet generator.
5. The TPU as claimed in claim 4, wherein the data words contained in the packets provided as outputs are written in one or more arrays of the buffer module by the one or more controllers based on the control packets received from the control packet generator, where the control packets include a location of array in which output data words are to be stored.
6. The TPU as claimed in claim 2, wherein the controllers are configured to receive the PRN packets from a connected PRN of the PRN mesh based on control packets provided by the associated control packet generator.
7. The TPU as claimed in claim 2, wherein the PRN packets received include at least one of transformed data words and data words to be transferred from one control interface to the other.
8. The TPU as claimed in claim 1, wherein each control packet generated by a packet generator is pushed through a first controller of the control interface and moves sequentially to all controllers, and only controllers for which the control packet is designated is activated on receipt of the control packet.
9. The TPU as claimed in claim 3, wherein the data words stored in the one or more arrays of the buffer module are retrieved from a main memory by the load module, where the operations of the load module are configured by the user input.
10. The TPU as claimed in claim 5, wherein the data words stored in the one or more arrays of the buffer module are written into the main memory by a store module on completion of the tensor computation, where the operations of the store module are configured by the user input.
11. The TPU as claimed in claim 5, wherein the data words stored in the one or more arrays of the buffer module are provided back into the PRN mesh as packets when required for the next step of tensor computations.
12. The TPU as claimed in claim 1, wherein the tensor computation is performed by the TPU over one or more steps of computations, wherein subsequent steps may utilize results of previous steps stored as data words in the buffer module.
13. The TPU as claimed in claim 1, wherein the inputs received by the TPU include configurations relating to delay of operations of controllers, changing state of operation of controller, and initiating production of control packets, instructions relating to load and store operations, and values on which computation is to be performed.
14. The TPU as claimed in claim 1, wherein the operations of the TPU is configured based on input received, and operations of the TPU are configured by configuring of the load module, store module, and the one or more control packet generators.
15. The TPU as claimed in claim 1, wherein the PRN mesh of the TPU is a two-dimensional arrangement of interconnected PRNs, wherein at least one boundary of the PRN mesh is connected to a control interface.
16. The TPU as claimed in claim 1, wherein the control packet buffer is used for storing at least one control packet provided by a user.
17. The TPU as claimed in claim 1, wherein the configuration parameters corresponding to a control packet generator includes parameters for configuring operations of at least one of the control packet sequence generators.
18. A method of performing tensor computations using a TPU, the method comprising:receiving an input, wherein the input includes configuration parameters associated with at least one control packet generator;generating, using the at least one control packet generator, one or more control packets based on the associated configuration parameters;providing, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface;generating, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, wherein each PRN packet comprises data words and routing information of the PRN packet;providing, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller, wherein the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh;performing, by the PRN mesh, computations based on the received PRN packets, wherein the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packets; andproviding as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.
19. A system performing tensor computations using a TPU, the system comprising:a processor; anda memory storing program instructions which, when executed by the processor, causes the processor to:receive an input, wherein the input includes configuration parameters associated with at least one control packet generator;generate, using the at least one control packet generator, one or more control packets based on the associated configuration parameters;provide, by the at least one control packet generator, the generated control packets to at least one controller of the associated control interface;generate, by the at least one controller of the associated control interface, one or more PRN packets based on the received control packets, wherein each PRN packet comprises a data word and routing information of the PRN packet;provide, by the at least one controller of the associated control interface, the generated PRN packets to the PRN mesh through a PRN connected with the controller, wherein the receiver PRN belongs to the set of PRNs constituting a boundary of the PRN mesh;perform, by the PRN mesh, computations based on the received PRN packets, wherein the computations are performed on data words fed into the PRN mesh from the buffer module as PRN packets; andprovide as output, through one or more control interfaces, packets comprising data words corresponding to results of the performed computations.
20. The system as claimed in claim 19, wherein the TPU comprises:one or more control packet generators, wherein each control packet generator comprises at least one control packet sequence generator and one control packet buffer;one or more control interfaces, wherein each control interface is associated with a specific control packet generator and is constituted by one or more controllers connected in a chain formation;wherein the controllers of each control interface are connected to a set of PRNs (Processing and Routing Nodes) constituting a boundary of a PRN mesh and to a buffer module such that the control interface constitutes an interface between the buffer module and the PRN mesh.
