Network adaptation method and device and system-on-chip
By constructing multiple logical topologies on the chip and using virtual address replacement technology, the problems of high hardware overhead and software complexity in the existing technology are solved, and flexible scheduling and topology support for multiple AI application scenarios are achieved.
Patent Information
- Application Number
- CN202410844060.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-29
AI Technical Summary
It is difficult for existing chips to support multiple logical topologies, resulting in high hardware overhead and complex software operations, and cannot meet the flexible topology requirements of different operators in AI applications.
Build multiple logical topologies on the mesh network. By pre-configuring the next-hop physical address in the hardware register and using virtual address replacement, you can flexibly switch the logical topology and support single-ring, multi-ring, star and other topologies.
It achieves flexible scheduling of multiple logical topologies, reduces hardware overhead and software complexity, and is suitable for a variety of AI application scenarios.
Smart Images

Figure CN118869490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network-on-chip technology, and in particular to a network adaptation method, device and system-level chip. Background Art
[0002] With the rapid development and widespread application of AI, on the one hand, new algorithms continue to emerge, and various operators have appeared, each with different requirements for computing power and storage; on the other hand, models continue to grow (especially LLM large models have reached terabytes of parameters) and data is rapidly increasing, and various parallel strategies are constantly proposed, such as data parallelism, tensor parallelism, pipeline parallelism, etc. All of these require the chip's network on chip (NoC) to support a variety of flexible topologies, such as some suitable for ring structures (allreduce), some suitable for trees (broadcast), some suitable for mesh, etc. However, NoC has a large hardware overhead to support multiple topologies, and general chips only support a single topology.
[0003] The Chinese invention patent application with publication number CN103580890A and invention name “A reconfigurable on-chip network structure and its configuration method” discloses that it is implemented by physical means. The chip includes a reconfigurable router and a reconfigurable switch. Different topologies require configuration of routing tables and switches. This not only has a large hardware overhead, but the switch contains 8-directional path convergence, which will cause serious congestion in the physical implementation of the chip. In addition, the software operation is relatively complicated, because in AI applications, different operators in a scenario require multiple different logical topologies, and changing the routing table often requires the network to be idle. Summary of the invention
[0004] In view of the defects in the prior art, the present invention provides a network adaptation method, device and system-level chip, which can support multiple logical topologies and can be applied to flexible scheduling of various application scenarios.
[0005] In a first aspect, an embodiment of the present invention provides a network adaptation method, including:
[0006] During initialization, a logical topology is constructed on the mesh network;
[0007] The physical address of the next-hop minimum system is pre-configured in the hardware register of the network adaptation layer of each minimum system in the logical topology, the address space inside each minimum system is allocated the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system;
[0008] The next smallest system is accessed in the manner of adding the current public virtual address to the offset address. After the network adaptation layer hardware finds the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop smallest system.
[0009] In a second aspect, an embodiment of the present invention provides a network adaptation device, including a topology construction module, an address preset module and an addressing module, wherein the topology construction module is used to construct a logical topology structure on a mesh network;
[0010] The address preset module is used to pre-configure the physical address of the next-hop minimum system in the hardware register of the network adaptation layer of each minimum system in the logical topology, and the address space allocation inside each minimum system is the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system;
[0011] The addressing module is used to access the next smallest system in the manner of adding the current public virtual address to the offset address, and after the network adaptation layer hardware finds the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop smallest system.
[0012] In a third aspect, an embodiment of the present invention provides a system-level chip, comprising a computing unit, an on-chip network unit, a memory and a router, and also comprising the network adapter device described in the above embodiment, wherein the network adapter device is used to connect the computing unit and the memory to the on-chip network unit, and the on-chip network unit is also connected to the router.
[0013] Beneficial effects of the present invention:
[0014] The embodiments of the present invention provide a network adaptation method, device and system-level chip, which can support multiple logical topologies and can be applied to flexible scheduling of multiple different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0016] Figure 1 It is a structural diagram of SoC in the prior art;
[0017] Figure 2 A flowchart of a network adaptation method provided by the first embodiment of the present invention;
[0018] Figure 3 Schematic diagram of a single ring topology structure in the first embodiment of the present invention;
[0019] Figure 4 A schematic diagram of a multi-ring topology structure in a first embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of a star structure in the first embodiment of the present invention;
[0021] Figure 6 A structural block diagram of a network adapter device provided by another embodiment of the present invention;
[0022] Figure 7 A schematic diagram of the structure of a system-on-chip provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0025] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0028] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.
[0029] like Figure 1 As shown in the figure, in SoC (system-on-chip), NoC (network on chip unit) is often used to interconnect various main modules (such as DMA, operation unit / PE, i.e. CPU / NPU, etc.) and slave modules (such as on-chip SRAM, off-chip DRAM, etc.); the network topology depends on the application scenario, such as GPU mostly uses crossbar mode, while CPU mostly uses ring or mesh network. However, a single SoC usually only supports one topology structure, and NoC with crossbar structure is difficult to support mesh routing mode.
[0030] AI computing, especially LLM, requires various collective communications, such as reduce, gather, and allreduce. Different collective communications use different network topologies with different efficiencies. For example, tree is suitable for broadcasting. For allreduce, when the number of communication nodes is small (for example, less than 16), ring is suitable. When the number of nodes is large (for example, hundreds or thousands), tree is suitable.
[0031] In order to support multiple logical topologies on one SoC (to adapt to the above-mentioned different communication requirements), the embodiments of this aspect add a network adaptation layer to the physical mesh network structure, and can communicate on the mesh network according to logical single ring, multiple rings, tree and other topologies.
[0032] like Figure 2 FIG. 1 shows a network adaptation method of a network adaptation layer provided by a first embodiment of the present invention, comprising the following steps:
[0033] During initialization, a logical topology is constructed on the mesh network;
[0034] The physical address of the next-hop minimum system is pre-configured in the hardware register of the network adaptation layer of each minimum system in the logical topology, the address space inside each minimum system is allocated the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system;
[0035] The next smallest system is accessed in the manner of adding the current public virtual address to the offset address. After the network adaptation layer hardware finds the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop smallest system.
[0036] Specifically, each tile has a register to store the physical address of the next-hop tile / router. The tile is a part of the SoC, and it is also a minimum system with CPU / NPU and memory. The address space allocation inside each tile is the same. For example, mem is 0x2000_0000~0x3FFF_FFFF (512MB). The ID address of a tile that has not been assigned is used as the next tile. For example, the global address allocation is 16*16 (SoC only uses 10*10 tiles), so the address space of tile (15,15) can be used as the next tile. When the software is initialized, the next-hop register of each tile is configured according to the logical topology. The software accesses the next tile according to tile (15,15) + offset; when the network adaptation layer / NAL sees tile (15,15), it replaces it with the content of the next-hop register;
[0037] Different logical topologies are constructed in the mesh network. The logical topology can be a single ring topology, such as Figure 3 As shown, starting from tile (1,1), after traversing all nodes on the network, it returns to tile (1,1) to form a large single ring. For example, for a 6*8 mesh, there are 48 tiles, so the single ring has 48 nodes. The network adaptation method is: configure the physical address of the next hop tile (1,2) in the register of tile (1,1), configure the physical address of the next hop tile (1,3) in the register of tile (1,2), configure the physical address of the next hop tile (2,3) in the register of tile (1,m), and configure in sequence according to the direction indicated by the arrow until returning to tile (1,1).
[0038] In some scenarios, SoC needs to be divided among multiple users (virtualization, multi-tenancy); for example, if there are four users, four single rings are required. The logical topology can be a multi-ring topology, such as Figure 4 As shown, the network is cut into 4 parts in the vertical direction to form 4 single rings. Of course, the same is true for the horizontal direction (as long as m or n is divisible by 4). The network adaptation method is the same as above.
[0039] In data parallel mode, it is often necessary to use allreduce to get the aggregated gradient. When there are many nodes (for example, more than 64), the ring method is not effective; instead, a star topology is used, such as Figure 5As shown in the figure, the reduce+broadcast method is more effective. In the horizontal direction, each row converges the gradient to its center point (in parallel for each row); then in the center column, it converges to its center; in this way, the center tile gets the converged gradient of all tiles; broadcast in the opposite direction, that is, the center tile is multicast to the center column; then, each row is multicast from its center. The network adaptation method is the same as above.
[0040] For other topological structures, such as 2D torus, etc., a similar method can be used, which will not be described here.
[0041] A network adaptation method provided by an embodiment of the present invention can support multiple logical topologies and can be applied to flexible scheduling of multiple different application scenarios.
[0042] In the above first embodiment, a network adaptation method is provided. Correspondingly, the present application also provides a network adaptation device. Figure 6 , which is a structural block diagram of a network adapter device provided by another embodiment of the present invention. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0043] like Figure 6 As shown, another embodiment of the present invention provides a network adaptation device, including a topology construction module, an address preset module and an addressing module, wherein the topology construction module is used to construct a logical topology structure on a mesh network; the address preset module is used to pre-configure the physical address of the next-hop minimum system in the hardware register of the network adaptation layer of each minimum system in the logical topology, and the address space allocation within each minimum system is the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system; the addressing module is used to access the next minimum system in the manner of adding the offset address to the current public virtual address, and after the network adaptation layer hardware discovers the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop minimum system. The logical topology structure can be a single-ring topology structure, a multi-ring topology structure, a star topology structure, etc.
[0044] A network adaptation device provided by an embodiment of the present invention can support a variety of logical topology structures and can be applied to flexible scheduling of a variety of different application scenarios.
[0045] like Figure 7As shown, a system-level chip provided by an embodiment of the present invention includes a computing unit, an on-chip network unit, a memory and a router, and also includes the network adapter device described in the above embodiment, the network adapter device is used to connect the computing unit and the memory with the on-chip network unit, and the on-chip network unit is also connected to the router.
[0046] A system-on-chip provided by an embodiment of the present invention can support a variety of logical topologies and can be applied to flexible scheduling of a variety of different application scenarios.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A network adaptation method, characterized in that: include: During initialization, a logical topology is constructed on the mesh network; The physical address of the next-hop minimum system is pre-configured in the hardware register of the network adaptation layer of each minimum system in the logical topology, the address space inside each minimum system is allocated the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system; The next smallest system is accessed in the manner of adding the current public virtual address to the offset address. After the network adaptation layer hardware finds the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop smallest system.
2. The method according to claim 1, characterized in that The logical topology structure is a single-ring topology structure.
3. The method according to claim 1, characterized in that The logical topology structure is a multi-ring topology structure.
4. The method according to claim 1, characterized in that The logical topology structure is a star topology structure.
5. A network adapter device, characterized in that: It includes a topology building module, an address preset module and an addressing module, wherein the topology building module is used to build a logical topology structure on a mesh network; The address preset module is used to pre-configure the physical address of the next-hop minimum system in the hardware register of the network adaptation layer of each minimum system in the logical topology, and the address space allocation inside each minimum system is the same, and the physical address of an unallocated minimum system is used as the virtual address of the common next minimum system; The addressing module is used to access the next smallest system in the manner of adding the current public virtual address to the offset address, and after the network adaptation layer hardware finds the access to the virtual address, the virtual address is replaced with the physical address of the corresponding next-hop smallest system.
6. The device according to claim 5, characterized in that The logical topology structure is a single-ring topology structure.
7. The device according to claim 5, characterized in that The logical topology structure is a multi-ring topology structure.
8. The device according to claim 5, characterized in that The logical topology structure is a star topology structure.
9. A system-on-chip, comprising a computing unit, an on-chip network unit, a memory and a router, characterized in that: It also includes a network adapter device as described in any one of claims 5 to 8, wherein the network adapter device is used to connect the computing unit and the memory to the on-chip network unit, and the on-chip network unit is also connected to a router.
