A transmission channel allocation method, device, electronic device and storage medium

By using multiple interconnection topologies between processors and allocating buffers and splitting data according to bandwidth proportions, the problem of insufficient utilization of transmission channel bandwidth in mesh topologies is solved and communication efficiency is improved.

CN118410756BActive Publication Date: 2024-08-30MU XI LING ZHI KE JI (HANG ZHOU) YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410888236.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-08-30
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

When using a mesh topology for collective communication, the transmission channel between the PCIe Switch and each processor in the mesh topology cannot fully utilize the bandwidth, resulting in low communication efficiency.

Method used

By obtaining N processors, fully interconnected through the first interconnection topology and the second interconnection topology respectively, and allocating buffers according to the bandwidth ratio of each transmission channel, the data to be broadcast is split into data of different bandwidths Fragments are transmitted in parallel through different transmission channels.

Benefits of technology

It realizes the simultaneous start and end of transmission of different data fragments, reduces waiting time, and improves system bandwidth and collective communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118410756B
    Figure CN118410756B
Patent Text Reader

Abstract

The present invention relates to the field of chip design, and in particular to a transmission channel allocation method, device, electronic device and storage medium. The method obtains N processors that are fully interconnected through a first interconnection topology and a second interconnection topology, respectively, and obtains bandwidth ratios of transmission channels in different interconnection topologies. The bandwidth ratio is used to allocate a buffer and split data to be exchanged to obtain corresponding data fragments, and the data fragments are stored in corresponding buffers. When a processor sends data, different data fragments are transmitted to a destination processor in parallel through transmission channels of corresponding bandwidths. Different data fragments can be started and ended simultaneously through the transmission channels of corresponding bandwidths, thereby reducing waiting time and improving system bandwidth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip design, and in particular to a method, device, electronic equipment and storage medium for allocating transmission channels. Background Art

[0002] The application of artificial intelligence models often requires huge computing resources, especially when training artificial intelligence models, which usually involves large amounts of data and complex computing tasks. Collective communication technologies, such as Allreduce, Reduce-Scatter, etc., are widely used in distributed training frameworks to efficiently synchronize gradient information between multiple processors, significantly accelerating training speed. Distributed training supported by collective communication allows researchers to use larger data sets and more complex model architectures because they can effectively manage data exchange and computation across nodes. Collective communication helps optimize resource allocation in multi-GPU, multi-server environments through efficient data exchange mechanisms, reduces communication bottlenecks, and improves overall computing efficiency.

[0003] Collective communication involves data exchange between multiple processors. In order to perform collective operations efficiently, choosing the right network topology is crucial to optimizing communication performance. The mesh topology is a network topology that enables each processor to communicate directly with all other processors, with less data exchange and high exchange efficiency. PCIe Switch provides expansion slots, allowing the system to more easily add or replace hardware devices, which not only enhances the functionality of the system but also facilitates future upgrades. Moreover, PCIe is a widely supported standard. Using PCIe Switch can ensure that newly added processors or other components are seamlessly integrated with the existing system, maintaining system compatibility and standardization. Therefore, in general, the processors in the mesh topology are inserted into the slots of the PCIE Switch. There are the following defects when performing collective communication based on this topology: When performing collective communication through the mesh topology, the transmission channels between the PCIE Switch and each processor in the mesh topology are idle, and the bandwidth cannot be fully utilized. Summary of the invention

[0004] In view of the above technical problems, the technical solution adopted by the present invention is:

[0005] In a first aspect, the present invention provides a method for allocating transmission channels, the method comprising the following steps:

[0006] N processors are obtained, where the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, respectively, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, respectively, and bandwidths of the first transmission channel and the second transmission channel are different.

[0007] A bandwidth ratio of the first transmission channel to the second transmission channel of each processor is obtained.

[0008] According to the bandwidth ratio, a buffer is allocated to the first transmission channel of each processor to obtain a first buffer, and a buffer is allocated to the second transmission channel to obtain a second buffer.

[0009] Each processor performs collective communication according to the data in the first buffer and the second buffer, wherein the step of the i-th processor performing collective communication at least includes:

[0010] The data to be broadcasted by the current processor is split into a first data segment and a second data segment according to the bandwidth ratio.

[0011] The first data segment is stored in a first buffer and the second data segment is stored in a second buffer.

[0012] The i-th processor takes out the data in the first buffer and the second buffer and sends them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel, and the second data fragment is sent along the second transmission channel.

[0013] In a second aspect, the present invention further provides a transmission channel allocation device, the device comprising:

[0014] The interconnection topology acquisition module is used to acquire N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, and the bandwidths of the first transmission channel and the second transmission channel are different.

[0015] The bandwidth ratio acquisition module is used to acquire the bandwidth ratio of the first transmission channel and the second transmission channel of each processor.

[0016] an allocation module, configured to allocate a buffer to the first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocate a buffer to the second transmission channel to obtain a second buffer. and a collective communication module, configured for each processor to perform collective communication according to the data in the first buffer and the second buffer. The collective communication module includes:

[0017] The data splitting module is used to split the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio.

[0018] A writing module is used to store the first data fragment into the first buffer and the second data fragment into the second buffer. And a sending module is used for the i-th processor to take out the data in the first buffer and the second buffer and send them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel and the second data fragment is sent along the second transmission channel.

[0019] In a third aspect, the present invention further provides a non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above method.

[0020] In a fourth aspect, the present invention further provides an electronic device comprising a processor and the above-mentioned non-transitory computer-readable storage medium.

[0021] The present invention has at least the following beneficial effects:

[0022] The embodiment of the present invention provides a method, device, electronic device and storage medium for allocating transmission channels, which obtain N processors that are fully interconnected through a first interconnection topology and a second interconnection topology, and obtain the bandwidth ratio of the transmission channels in different interconnection topologies, allocate buffers using the bandwidth ratio, split the data to be exchanged to obtain corresponding data fragments, store the data fragments in the corresponding buffers, and transmit different data fragments to the destination processor in parallel through the transmission channels of the corresponding bandwidth when the processor sends data. Different data fragments can be started and ended at the same time through the transmission channels of the corresponding bandwidth, thereby reducing waiting time, improving the bandwidth of the system, and further improving the efficiency of collective communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A flow chart of a method for allocating transmission channels provided in Embodiment 1 of the present invention;

[0025] Figure 2 A schematic diagram of an interconnection topology structure provided in Embodiment 1 of the present invention;

[0026] Figure 3A flowchart of the steps for the i-th processor to perform collective communication provided in the first embodiment of the present invention;

[0027] Figure 4 A flowchart of the optimization steps for collective communication of multiple copies of data by N processors provided in the first embodiment of the present invention;

[0028] Figure 5 A schematic diagram of a transmission channel allocation device provided in Embodiment 2 of the present invention;

[0029] Figure 6 A schematic diagram of a collective communication module provided in Embodiment 2 of the present invention;

[0030] Figure 7 A schematic diagram of an optimization module provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0031] 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 only 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0032] Embodiment 1

[0033] See also Figure 1 , which shows a flow chart of a method for allocating transmission channels, the method comprising the following steps:

[0034] S100, obtaining N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, and bandwidths of the first transmission channel and the second transmission channel are different.

[0035] Among them, full interconnection means that any processor is connected to all other processors. In other words, any two processors can exchange data directly without the need for a third processor to transfer. The first interconnection topology alone can make N processors fully interconnected, and the second interconnection topology alone can also make N processors fully interconnected.

[0036] As a preferred embodiment, the first interconnection topology is a topology in which interconnection is performed through a fully interconnected network.

[0037] Optionally, the fully interconnected network is a bus switch (PCIE switch), wherein PCIE (Peripheral Component Interconnect Express) is a high-speed serial computer expansion bus standard. Other interconnection topologies for realizing a fully interconnected network also fall within the protection scope of the present invention.

[0038] As a preferred embodiment, the second interconnection topology is a topology in which interconnection is performed through high-speed physical interconnection lines.

[0039] Optionally, the high-speed physical interconnection line is MetaLink or NvLink. Other high-speed physical interconnections also fall within the protection scope of the present invention.

[0040] For ease of understanding, taking 4 processors as an example, when the first interconnection topology is PCIE Switch and the second interconnection topology is a high-speed physical interconnection line, please refer to Figure 2 , which shows a schematic diagram of an interconnection topology. Figure 2 The system includes four processors 10, a bus switch 20 and a high-speed physical interconnection line 30. The four processors 10 form a first interconnection topology through the bus switch 20. The four processors 10 form a second interconnection topology through the fully interconnected high-speed physical interconnection line 30.

[0041] Specifically, when the number of interconnection topologies included between the N processors is greater than 2, the bandwidths of all interconnection topologies are not completely the same, wherein the bandwidths of all transmission channels in each interconnection topology are the same.

[0042] S200, obtaining a bandwidth ratio of a first transmission channel to a second transmission channel of each processor.

[0043] The bandwidth ratio is used to indicate the buffer allocation ratio of the corresponding transmission channel. By using the transmission channels in two different interconnection topologies to transmit data simultaneously, the bandwidth can be fully utilized, avoiding the situation where one transmission channel is overloaded while other transmission channels are idle, thereby improving the efficiency and response speed of the overall system.

[0044] It should be noted that, in the prior art, using only the first transmission channel to transmit data or only the second transmission channel to transmit data will cause the transmission channel in another interconnection topology to be idle, and the bandwidth cannot be effectively utilized. Therefore, in order to fully utilize the bandwidth, using the first transmission channel and the second transmission channel to send data at the same time, allocating buffer ratios for different transmission channels according to the bandwidth ratio can make the transmitted data have the same transmission time in different channels and be sent to the destination processor at the same time.

[0045] As an example, Figure 2Taking the interconnection topology in as an example, if the bandwidth of the first transmission channel of each processor is 20GB / s and the bandwidth of the second transmission channel is 60GB / s, the bandwidth ratio of the first transmission channel to the second transmission channel is 1:3.

[0046] Specifically, when the number of interconnection topologies is greater than 2, the number of transmission channels of each processor in different interconnection topologies obtained is equal to the number of interconnection topologies.

[0047] S300, allocating a buffer to a first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocating a buffer to a second transmission channel to obtain a second buffer.

[0048] A buffer is a memory area used to temporarily store data.

[0049] As an example, when the bandwidth ratio of the first transmission channel to the second transmission channel is 1:3, the size ratio of the first buffer and the second buffer is also 1:3.

[0050] S400: Each processor performs collective communication according to data in the first buffer and the second buffer.

[0051] For further information, see Figure 3 , the steps for the i-th processor to perform collective communication at least include:

[0052] S410: Split the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio.

[0053] Among them, splitting data according to bandwidth ratio ensures that each part of parallel processing can start and end at the same time, reducing waiting time. After the data is split, it can be sent in parallel through multiple buffers, which can achieve the purpose of fully utilizing bandwidth.

[0054] Among them, keeping the data split ratio consistent with the buffer division ratio can simplify data management and synchronization issues between processes. In a multi-threaded or multi-process environment, it is easier to control data flow, avoid complex locking and synchronization mechanisms, and reduce the probability of errors.

[0055] S420, storing the first data segment into a first buffer and storing the second data segment into a second buffer.

[0056] S430, the i-th processor takes out the data in the first buffer and the second buffer and sends them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel, and the second data fragment is sent along the second transmission channel.

[0057] It should be noted that the first data fragment and the second data fragment are sent simultaneously to achieve simultaneous concurrency, and the first transmission channel and the second transmission channel are fully utilized. Since the sizes of the first data fragment and the second data fragment are split according to the bandwidth ratio, the time when the first data fragment arrives at the destination processor along the first transmission channel is the same as the time when the second data fragment arrives at the destination processor along the second transmission channel. Both arrive at the destination processor at the same time, achieve simultaneous start and end, reduce waiting time, and improve the bandwidth of the system.

[0058] As a preferred embodiment, please refer to Figure 4 The method further includes: S500, an optimization step of N processors performing collective communication on multiple copies of data:

[0059] S510, splitting the entire data to be collectively communicated into K pieces of data, and performing a collective communication on each piece of data.

[0060] Optionally, the collective communication is an all-gather operation (All-Gather) or an all-reduce operation (All-Reduce), and other types of collective communications also fall within the protection scope of the present invention.

[0061] The K pieces of data are different from the data fragments. Each piece of data is the basic data for collective communication, while the data fragments are obtained by splitting each piece of data again during the collective communication process. Collective communication is performed on each piece of data through S410-S430. In S410, each piece of data is divided into different data fragments according to the bandwidth ratio to fully utilize the bandwidth.

[0062] S520, obtaining L steps of accessing the buffer for each piece of data during the collective communication process.

[0063] Optionally, when the collective communication is a full collection operation, L is equal to 2, and the two steps are a collection step and a reading step, wherein the collection stage is that each processor exchanges data through different transmission channels and writes into a corresponding buffer, wherein the reading step is a step in which each processor reads a complete data set from its own local buffer.

[0064] Optionally, when the collective communication is a full reduction operation, L is equal to 3, and the three steps include a distribution step, a collection step and a reading step, wherein the distribution step is that each processor exchanges data through different transmission channels and writes into a corresponding buffer and performs a reduction operation locally to obtain a reduction result; the collection step is that all processors exchange the reduction results through different transmission channels and write into a corresponding buffer; the reading step is a step in which each processor reads all reduction results from its local buffer.

[0065] It should be noted that for each piece of data, when the collective communication is a full collection operation, all tasks of the collection step must be completed before the reading step can be executed. When the collective communication is a full reduction operation, the next step can only be executed after all the data of the previous step has been processed in the order of the distribution step, the collection step, and the reading step. However, there is no dependency between the collective communication steps of different data. For example, there is no relationship between the collective communication operation of the first piece of data and the collective communication operation of the second piece of data. Therefore, the collective communication steps of different pieces of data can be processed in a pipeline mode to improve the utilization of the processor.

[0066] S530, each piece of data is processed in pipeline according to the steps of collective communication, wherein when the kth piece of data is executing the mth step, the value range of k is 1 to K, the value range of m is 1 to L, and the pipeline mode satisfies the following conditions: if m is less than K, the i-1th piece of data is executing the m+1th step. If i is less than L, the i+1th piece of data is executing the m-1th step.

[0067] As an example, for ease of understanding, take 4 copies of data as an example: the first copy of data, the second copy of data, the third copy of data and the fourth copy of data, and take collective communication as a full reduction operation as an example. The full reduction operation needs to perform three steps: distribution step, collection step and reading step. For the convenience of description and to reflect the relevance between the steps, the distribution step is called the first step, the collection step is called the second step, and the reading step is called the third step. In the pipeline processing process, the first copy of data executes the first step and the second step in sequence; when the first copy of data executes the second step, the first step of the second copy of data is executed; when the third step of the first copy of data is executed, the second step of the second copy of data is executed, and the first step of the third copy of data is executed; when the third step of the first copy of data is executed, the collective communication of the first copy of data is completed, but the pipeline is still in progress. When the third step of the second copy of data is executed, the second step of the third copy of data is executed, and the first step of the fourth copy of data is executed; when the third step of the second copy of data is executed, the collective communication of the second copy of data is completed, and the pipeline is still in progress. While executing the third step of the third data, the second step of the fourth data is executed. Since there are four data in total, no other data is executed. When the third step of the third data is completed, the collective communication of the third data is completed, and the pipeline is still in progress. Finally, the third step of the fourth data is executed. When the third step of the fourth data is completed, the collective communication of the fourth data is completed. At the same time, the pipeline processing of the four data is completed.

[0068] At present, it is usually necessary to split the entire data into multiple data, and then perform collective communication on each data in turn, that is, after the current data completes collective communication, the next data is started for collective communication. Since there are dependencies between the steps in collective communication, the next step can only be executed after all processors have completed the previous step. Therefore, the processor that completes the previous step first will wait for the processor that completes the previous step later. The time gaps for the processor to wait are long and numerous, so the utilization rate of the processor is low. The pipeline mode provided by S500 of the present invention enables the processor to start processing different steps in other collective communications while waiting for the previous step in a collective communication to be completed, effectively hiding the delay of individual steps, making full use of the processor, and improving the overall execution efficiency. Compared with the prior art, the utilization rate of the processor and the overall execution efficiency are improved.

[0069] It should be noted that S400 and S500 are not the order of processing steps, and S400 is a sub-step that needs to be executed in each step of S500.

[0070] S400 improves the efficiency of collective communication by fully utilizing the bandwidth of each processor, and S500 improves the efficiency of collective communication of overall data by coordinating different steps in collective communication of multiple copies of data; S400 and S500 cooperate with each other, and when the processor sends data, different data fragments are transmitted to the destination processor in parallel through the transmission channel of the corresponding bandwidth, and then multiple copies of data are processed according to the pipeline, which can improve the utilization rate of the processor on the basis of fully utilizing the bandwidth, thereby greatly improving the efficiency of collective communication.

[0071] Embodiment 2

[0072] See also Figure 5 , which shows a transmission channel allocation device, the device includes an interconnection topology acquisition module, a bandwidth ratio acquisition module, an allocation module and a collective communication module.

[0073] The interconnection topology acquisition module is used to acquire N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, and the bandwidths of the first transmission channel and the second transmission channel are different.

[0074] The bandwidth ratio acquisition module is used to acquire the bandwidth ratio of the first transmission channel and the second transmission channel of each processor.

[0075] The allocation module is used to allocate a buffer to the first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocate a buffer to the second transmission channel to obtain a second buffer.

[0076] The collective communication module is used for each processor to perform collective communication according to the data in the first buffer and the second buffer.

[0077] For further information, see Figure 6 ,The collective communication module includes a data splitting module, a writing module, and a sending module.

[0078] The data splitting module is used to split the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio.

[0079] The writing module is used to store the first data segment into the first buffer and store the second data segment into the second buffer.

[0080] The sending module is used for the i-th processor to take out the data in the first buffer and the second buffer and send them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel and the second data fragment is sent along the second transmission channel.

[0081] As a preferred embodiment, please refer to Figure 7 The device also includes: an optimization module, which is used to optimize the steps of collective communication of multiple copies of data by N processors.

[0082] Furthermore, the optimization module includes an overall splitting module, a step acquisition module and a pipeline processing module.

[0083] The overall splitting module is used to split the overall data to be collectively communicated into K pieces of data, and perform a collective communication on each piece of data;

[0084] The step acquisition module is used to obtain L steps of accessing the buffer for each piece of data during the collective communication process;

[0085] The pipeline processing module is used to perform pipeline processing on each piece of data in sequence according to the steps of collective communication.

[0086] As a preferred embodiment, the pipeline processing module is also used for: when the kth copy of data is executing the mth step, the value range of k is 1 to K, the value range of m is 1 to L, and the pipeline mode satisfies the following conditions: if m is less than K, the i-1th copy of data is executing the m+1th step; if i is less than L, the i+1th copy of data is executing the m-1th step.

[0087] As a preferred embodiment, the first interconnection topology in the interconnection topology acquisition module is a topology of interconnection through a fully interconnected network, and the second interconnection topology is a topology of interconnection through a high-speed physical interconnection line.

[0088] In summary, the second embodiment of the present invention provides a transmission channel allocation device, which includes an interconnection topology acquisition module, a bandwidth ratio acquisition module, an allocation module and a collective communication module. The modules interact with each other to allocate buffers through the bandwidth ratio of transmission channels in different interconnection topologies and split the data to be exchanged to obtain corresponding data fragments, store the data fragments in corresponding buffers, and transmit different data fragments to the destination processor in parallel through transmission channels of corresponding bandwidths when the processor sends data. Different data fragments can start and end at the same time through the transmission channels of corresponding bandwidths, thereby reducing waiting time, achieving the purpose of increasing system bandwidth, and further improving the efficiency of collective communication.

[0089] Embodiment 3

[0090] Embodiment 3 of the present invention further provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the steps:

[0091] S100, obtaining N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, and bandwidths of the first transmission channel and the second transmission channel are different.

[0092] S200, obtaining a bandwidth ratio of a first transmission channel to a second transmission channel of each processor.

[0093] S300, allocating a buffer to a first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocating a buffer to a second transmission channel to obtain a second buffer.

[0094] S400, each processor performs collective communication according to the data in the first buffer and the second buffer, wherein the step of the i-th processor performing collective communication at least includes:

[0095] S410: Split the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio.

[0096] S420, storing the first data segment into a first buffer and storing the second data segment into a second buffer.

[0097] S430, the i-th processor takes out the data in the first buffer and the second buffer and sends them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel, and the second data fragment is sent along the second transmission channel.

[0098] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0099] Embodiment 4

[0100] A fourth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in the third embodiment of the present invention.

[0101] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0102] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A method for allocating a transmission channel, characterized in that: The method comprises the following steps: Acquire N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, respectively, and the bandwidths of the first transmission channel and the second transmission channel are different; Obtaining a bandwidth ratio of a first transmission channel to a second transmission channel of each processor; Allocate a buffer to the first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocate a buffer to the second transmission channel to obtain a second buffer; Each processor performs collective communication according to the data in the first buffer and the second buffer, wherein the step of the i-th processor performing collective communication at least includes: Splitting the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio; storing the first data segment in a first buffer and storing the second data segment in a second buffer; The i-th processor takes out the data in the first buffer and the second buffer and sends them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel, and the second data fragment is sent along the second transmission channel.

2. The method according to claim 1, characterized in that: The first interconnection topology is a topology for interconnection through a fully interconnected network, and the second interconnection topology is a topology for interconnection through a high-speed physical interconnection line.

3. The method according to claim 1, characterized in that The method further includes: an optimization step of N processors performing collective communication on multiple copies of data: Split the entire data to be collectively communicated into K pieces of data, and perform a collective communication on each piece of data; Get the L steps for each piece of data to access the buffer during collective communication; Each piece of data is processed in pipeline according to the steps of collective communication.

4. The method according to claim 3, characterized in that When the kth piece of data is executing the mth step, the value range of k is 1 to K, the value range of m is 1 to L, and the pipeline satisfies the following conditions: S531, if m is less than K, the i-1th piece of data is executing the m+1th step; S532, if i is less than L, the i+1th piece of data is executing the m-1th step.

5. A transmission channel distribution device, characterized in that: The device comprises: an interconnection topology acquisition module, used to acquire N processors, wherein the N processors are fully interconnected through at least a first interconnection topology and a second interconnection topology, wherein each processor is interconnected with other processors through a first transmission channel in the first interconnection topology and a second transmission channel in the second interconnection topology, and the bandwidths of the first transmission channel and the second transmission channel are different; A bandwidth ratio acquisition module, used to acquire the bandwidth ratio of the first transmission channel and the second transmission channel of each processor; an allocation module, configured to allocate a buffer to a first transmission channel of each processor according to the bandwidth ratio to obtain a first buffer, and allocate a buffer to a second transmission channel to obtain a second buffer; and A collective communication module, used for each processor to perform collective communication according to the data in the first buffer and the second buffer; wherein the collective communication module includes: A data splitting module, used for splitting the data to be broadcasted by the current processor into a first data segment and a second data segment according to the bandwidth ratio; a writing module, configured to store the first data segment into a first buffer and the second data segment into a second buffer; and The sending module is used for the i-th processor to take out the data in the first buffer and the second buffer and send them to the destination processor at the same time, wherein the first data fragment is sent along the first transmission channel and the second data fragment is sent along the second transmission channel.

6. The device according to claim 5, characterized in that The first interconnection topology in the interconnection topology acquisition module is a topology for interconnection through a fully interconnected network, and the second interconnection topology is a topology for interconnection through a high-speed physical interconnection line.

7. The device according to claim 5, characterized in that The device also includes: The optimization module is used to optimize the steps of collective communication of multiple copies of data by N processors, wherein the optimization module includes: The overall splitting module is used to split the overall data to be collectively communicated into K pieces of data, and perform a collective communication on each piece of data; A step acquisition module is used to obtain L steps of accessing the buffer for each piece of data during the collective communication process; The pipeline processing module is used to perform pipeline processing on each piece of data in sequence according to the steps of collective communication.

8. The device according to claim 7, characterized in that The pipeline processing module is further used for: when the kth piece of data is executing the mth step, the value range of k is 1 to K, the value range of m is 1 to L, and the pipeline mode satisfies the following conditions: if m is less than K, the i-1th piece of data is executing the m+1th step; If i is less than L, the i+1th piece of data is executing the m-1th step.

9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the method according to any one of claims 1 to 4.

10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.

Citation Information

Patent Citations

  • Hierarchical network-on-chip topology and routing method thereof

    CN109189720A

  • Multi-channel data transmission method and device and storage medium

    CN114356818A