Data exchange method and device based on many-core architecture

By dividing clusters in many-core processors and adopting an asynchronous computing mechanism, the problem of resource waste caused by traditional global synchronization is solved, the utilization rate and execution efficiency of the processor are improved, and the integrity of data transmission is guaranteed.

CN112631982BActive Publication Date: 2024-10-29TSINGHUA UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011565990.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-10-29
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

The utilization rate and execution efficiency of existing many-core processors are low, mainly due to the traditional global synchronization mechanism that leads to the serialization of inter-core communication and local calculations, resulting in resource waste and waiting phenomena.

Method used

By dividing the core into clusters and synchronously exchanging data in the first working cycle, and executing computing tasks asynchronously in the second working cycle, a decentralized counter delay synchronization mechanism is adopted to ensure the integrity of data exchange and computing tasks. efficient execution.

Benefits of technology

It improves the utilization and execution efficiency of many-core processors, reduces the overall waiting time, maintains high parallelism, and does not require the addition of additional synchronization controllers. It is suitable for various application scenarios such as neural network computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112631982B_ABST
    Figure CN112631982B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data exchange method and device based on a many-core architecture, the method is applied to a many-core processor, the many-core processor includes multiple cores, the multiple cores are divided into multiple clusters according to different computing tasks, the method includes: the cores in the multiple clusters exchange data in a first working cycle, the first working cycle corresponding to each cluster includes one or more first sub-working cycles, in each first sub-working cycle, the cores of the multiple clusters that perform data exchange start and end synchronously; after the first working cycle ends, the cores of each cluster perform computing tasks in a second working cycle adjacent to the first working cycle, the second working cycle corresponding to each cluster includes one or more second sub-working cycles, and each second sub-working cycle between the clusters ends asynchronously. By starting to execute computing tasks for the cores of different clusters after data exchange is completed, the utilization rate and execution efficiency of the many-core processor can be improved while ensuring the integrity of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data exchange method and device based on a many-core architecture. Background Art

[0002] The continuous development of artificial intelligence technology places higher and higher demands on chip processing capabilities. Since the processing power of single-core chips is limited, many-core chips are increasingly used. Many-core chips can improve processing power by assigning tasks to a combination of multiple cores for parallel execution. In a many-core architecture chip, not only does it need to execute the tasks assigned to each core, but it also needs to exchange data between cores. The execution mechanism of tasks and inter-core communication in a many-core chip largely determines the overall operating performance of the many-core chip. Summary of the invention

[0003] In view of this, the present disclosure proposes a data exchange method and device based on a many-core architecture, which can improve the utilization and execution efficiency of the many-core processor while ensuring the integrity of data transmission.

[0004] According to one aspect of the present disclosure, there is provided a data exchange method based on a many-core architecture, the method being applied to a many-core processor, the many-core processor comprising a plurality of cores, the plurality of cores being divided into a plurality of clusters according to different computing tasks, the method comprising: the cores in the plurality of clusters exchange data in a first working cycle, wherein the first working cycle corresponding to each cluster comprises one or more first sub-working cycles, in each first sub-working cycle, the cores in all or part of the plurality of clusters exchange data, and the cores performing the data exchange start and end synchronously; after the first working cycle ends, the cores in each cluster perform computing tasks in a second working cycle adjacent to the first working cycle, wherein the second working cycle corresponding to each cluster comprises one or more second sub-working cycles, the computing tasks performed by each cluster comprise one or more sub-computing tasks, each sub-computing task is assigned to a different second sub-working cycle for execution, and each second sub-working cycle between the clusters ends asynchronously.

[0005] According to another aspect of the present disclosure, there is provided a data exchange device based on a many-core architecture, the device being applied to a many-core processor, the many-core processor comprising a plurality of cores, the plurality of cores being divided into a plurality of clusters according to different computing tasks, the device comprising: a data exchange unit, for exchanging data between the cores in the plurality of clusters in a first working cycle, wherein the first working cycle corresponding to each cluster comprises one or more first sub-working cycles, in each first sub-working cycle, data is exchanged between the cores of all or part of the plurality of clusters, and the cores performing data exchange start and end synchronously; a computing unit, for, after the first working cycle ends, the cores of each cluster perform computing tasks in a second working cycle adjacent to the first working cycle, wherein the second working cycle corresponding to each cluster comprises one or more second sub-working cycles, the computing tasks performed by each cluster comprises one or more sub-computing tasks, each sub-computing task is assigned to a different second sub-cycle for execution, and each second sub-cycle between the clusters ends asynchronously.

[0006] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the data exchange method based on the many-core architecture is implemented.

[0007] By starting to execute computing tasks for cores of different clusters as soon as data exchange is completed synchronously, the data exchange method and device based on the many-core architecture according to various aspects of the present disclosure can improve the utilization and execution efficiency of the many-core processor while ensuring the integrity of data transmission.

[0008] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0010] Figure 1 A flow chart showing a data exchange method based on a many-core architecture according to an embodiment of the present disclosure.

[0011] Figure 2 A schematic diagram showing an exemplary cluster execution computing task based on a many-core architecture according to an embodiment of the present disclosure.

[0012] Figure 3 A schematic diagram showing a traditional data exchange method based on many-core architecture according to an embodiment of the present disclosure.

[0013] Figure 4 A schematic diagram showing a data exchange method based on a many-core architecture according to an embodiment of the present disclosure.

[0014] Figure 5 A schematic diagram showing synchronization between single cores of two clusters according to an embodiment of the present disclosure.

[0015] Figure 6 A schematic diagram showing synchronization between single cores of two clusters according to an embodiment of the present disclosure.

[0016] Figure 7 A schematic diagram showing synchronization between single cores and multiple cores of two clusters according to an embodiment of the present disclosure.

[0017] Figure 8 A schematic diagram showing synchronization between multiple cores and a single core of two clusters according to an embodiment of the present disclosure.

[0018] Fig. 9 A schematic diagram showing synchronization between multiple cores of two clusters according to an embodiment of the present disclosure.

[0019] Fig.10 A schematic diagram showing synchronization between single cores of three clusters according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0021] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0022] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0023] Figure 1 A flow chart showing a data exchange method based on a many-core architecture according to an embodiment of the present disclosure.

[0024] In one possible approach, Figure 1 As shown, the method is applied to a many-core processor, the many-core processor includes multiple cores, and the multiple cores are divided into multiple clusters according to different computing tasks. The method includes:

[0025] S100, the cores in the plurality of clusters exchange data in a first working cycle, wherein the first working cycle corresponding to each cluster includes one or more first sub-working cycles, and in each first sub-working cycle, the cores in all or part of the plurality of clusters exchange data, and the cores that perform data exchange start and end synchronously;

[0026] S200, after the first working cycle ends, the cores of each cluster execute computing tasks in a second working cycle adjacent to the first working cycle, wherein the second working cycle corresponding to each cluster includes one or more second sub-working cycles, and the computing tasks executed by each cluster include one or more sub-computing tasks, each sub-computing task is assigned to a different second sub-cycle for execution, and each second sub-working cycle between clusters ends asynchronously.

[0027] In one possible implementation, the method may be applied to a many-core processor or a circuit using a many-core architecture. For example, the many-core processor may be a neuromorphic chip. The neuromorphic chip is a chip with a new architecture that can simulate the working mechanism of the human brain.

[0028] The neuromorphic chip may include multiple functional cores, each of which may be used to perform different computing tasks (e.g., computing tasks of a neural network), and the same computing task may also be assigned to different functional cores for execution. In one example, a neuromorphic chip may include 4096 (e.g., a 64×64 array) functional cores, each of which may simulate 256 biological neurons, so that a neuromorphic chip may simulate a total of about 1 million neurons to perform different computing tasks.

[0029] In a possible implementation, the neuromorphic chip can perform both artificial neural network calculations and pulse neural network calculations. The functional core of the neuromorphic chip may include a matrix calculation unit for neural network calculations, a routing unit for data exchange between functional cores, and a storage unit for data storage, that is, the functional core may adopt a storage-computation integrated architecture, data exchange between functional cores may be performed through the routing unit, and data calculation is performed locally within the functional core.

[0030] In one possible implementation, the many-core processor may include multiple cores, and the multiple cores may be divided into multiple clusters according to different computing tasks. For example, cluster 1 may include 9 cores for processing computing task 1. After processing computing task 1, cluster 2 may include 3 cores of cluster 1 for processing computing task 2, that is, the multiple cores may be dynamically divided into multiple clusters according to different computing tasks. Among them, different clusters can perform different computing tasks, and the same computing tasks can be performed within a cluster. Therefore, it is equivalent to grouping the data interaction in the many-core chip. Intensive data interaction within the same task is realized through synchronous data interaction within the timing cluster. Communications with small data volumes and long intervals between different tasks will be divided into different timing clusters and implemented through asynchronous data interaction mechanisms.

[0031] The computing tasks between different clusters can have upstream and downstream relationships. For example, the output results of a cluster are provided to other clusters as input data. The data exchange between clusters can only be related to the upstream and downstream clusters. Data exchange includes receiving and sending. After each cluster task is completed, the data will be sent to the next group of clusters first, while receiving the computing results of the previous group of clusters, and then starting the computing tasks of this cluster.

[0032] The computing task may be an artificial neural network computing task or a pulse neural network computing task. It should be understood by those skilled in the art that the description of the many-core processor, core, and computing task in the present disclosure is exemplary. For example, the many-core processor may include a processor of a non-neuromorphic chip, the core of the many-core chip may include a core of a non-functional core, and the many-core processor may also perform other non-computing tasks. The present disclosure does not limit the many-core processor, core, and computing task.

[0033] In a possible implementation, the cores of the multi-core processor may exchange data and perform computing tasks according to a working cycle. The working cycle may include a first working cycle and a second working cycle. Each core may exchange data in the first working cycle and perform computing tasks in the second working cycle. It should be understood by those skilled in the art that the present disclosure does not limit the working cycle.

[0034] Figure 2 A schematic diagram showing an exemplary cluster execution computing task based on a many-core architecture according to an embodiment of the present disclosure.

[0035] In one possible implementation, Figure 2As shown, the cores can be divided into clusters according to the different computing tasks performed by the multi-core processor or the different execution times of the computing tasks. The same core can be divided into different clusters according to different tasks performed or the execution times of different tasks. The cores belonging to the same cluster have synchronized local computing and the same inter-core communication working cycle. The cores in the same cluster can cyclically and continuously execute multiple computing tasks in time, and each computing task corresponds to an execution working cycle. The time lengths corresponding to the working cycles to which these different computing tasks belong can be equal or unequal. It is worth noting that the cluster can also be called a timing cluster, and "cluster" and "timing cluster" have equivalent meanings in the present disclosure. The present disclosure is not limited to clusters and computing tasks.

[0036] In a possible implementation, the computing task can be a complex computing task or a simple computing task, and different computing tasks require different numbers of cycles. For example, for a multi-layer neural network computing task, timing cluster 1 can execute the computing task of the first layer, and timing cluster 2 can execute the computing task of the second layer. The computing task of the first layer executed by timing cluster 1 and the computing task of the second layer executed by timing cluster 2 can be regarded as sub-computing tasks of the neural network computing task. The execution of the sub-computing task requires a certain number of cycles, that is, the working cycle required to complete the sub-computing task.

[0037] In one possible implementation, Figure 2 As shown, a computing task can include four sub-computing tasks, which are represented by D, E, F and G respectively and are assigned to two timing clusters for execution. Figure 2 The size of D, E, F, and G in the figure can be used to represent the size of the task volume of the sub-computing task, that is, the task volume of each sub-computing task can be the same or different. A sub-computing task can be assigned to different timing clusters for execution, and a timing cluster can also handle a complete sub-computing task. In an example, Figure 2 As shown, timing cluster 1 may include 9 cores for executing sub-computing tasks D and E. From a temporal point of view, timing cluster 1 may synchronously execute sub-computing task D in one of the second sub-working cycles of the second working cycle, and synchronously execute sub-computing task E in another second sub-working cycle of the second working cycle. Timing cluster 2 may include 7 cores for executing sub-computing task F and sub-computing task G. From a temporal point of view, timing cluster 2 may synchronously execute sub-computing task F in one of the second sub-working cycles of the second working cycle, and synchronously execute sub-computing task G in another second sub-working cycle of the second working cycle. Timing cluster 1 and timing cluster 2 may be executed asynchronously.

[0038] Traditional many-core processors use a Bulk Synchronous Parallel (BSP) computing model to process data. The model can be divided into three stages: local computing stage, global communication stage, and fence synchronization stage. In the local computing stage, each processor only performs local computing on data stored in local memory. In the global communication stage, the many-core processor operates on any non-local data, including the exchange of data between cores. In the fence synchronization stage, the many-core processor needs to wait for the end of all communication behaviors. In one example, for this model, a synchronization device is provided in the many-core processor to implement fence synchronization, that is, when the thread program of a core of the many-core processor executes to a predetermined synchronization point, the core sends information to the synchronization device, indicating that the predetermined synchronization point has been executed. When all thread programs have executed to the predetermined synchronization point, the synchronization device sends instructions to the core corresponding to each thread program to continue to execute the next stage, thereby achieving synchronization. It can be seen that the synchronization mechanism of this model is global synchronization. The local calculation and inter-core communication of the processor are executed in a serial manner. When the number of threads increases, an access bottleneck will occur, resulting in a slowdown in the coordinated execution of multiple threads, reducing the utilization and execution efficiency of the multi-core processor.

[0039] In the related art, the execution process of the multi-core processor is divided into multiple working cycles by the global synchronization signal. In one working cycle, all running cores perform inter-core communication and local calculation synchronously, and each core will send out the obtained calculation results while calculating. When the amount of calculation required to be performed in different cores and the amount of data to be transmitted do not match, some cores will be idle or waiting, which reduces the utilization rate and execution efficiency of the multi-core processor.

[0040] Figure 3 A schematic diagram showing a traditional data exchange method based on many-core architecture according to an embodiment of the present disclosure.

[0041] In one possible implementation, Figure 3 As shown, in the traditional data exchange method based on many-core architecture, many-core processors need to perform local computing and inter-core communication tasks according to the global synchronization work cycle. In one example, Figure 3 It includes three timing clusters, each of which can exchange data between cores and perform computing tasks. The data exchange includes receiving and sending data. For example, timing cluster 1 can include three parts: data receiving A1, data sending B1, and data computing C1, and timing cluster 2 can include three parts: data receiving A2, data sending B2, and data computing C2. The data exchange part and the data computing part of the same timing cluster can be completed in different working cycles.

[0042] In one possible implementation, Figure 3 As shown, timing cluster 1 and timing cluster 2 start data exchange (data sending and data receiving) synchronously, and end synchronously after the data exchange is completed. When the core in timing cluster 1 completes data receiving A1 and data sending B1, it needs to idle or wait for data sending B2 in timing cluster 2 to complete synchronization, and then start data calculation C1. Similarly, the cores in timing clusters 1, 2, and 3 all start and end synchronously when performing data exchange, causing the timing clusters to idle or wait before performing data calculation, wasting the limited resources of the many-core processor and reducing the utilization and execution efficiency of the many-core processor.

[0043] Figure 4 A schematic diagram showing a data exchange method based on a many-core architecture according to an embodiment of the present disclosure.

[0044] In one possible implementation, Figure 4 As shown, the timing cluster can start data exchange synchronously, and end asynchronously after completing the data exchange, and then start data calculation asynchronously. For example, after completing data reception A1 and data transmission B1, the core in timing cluster 1 can start data calculation immediately, without the need to perform local calculation and inter-core communication tasks according to the global synchronization work cycle. After completing data exchange, the cores of timing cluster 1, timing cluster 2, and timing cluster 3 can start data calculation without idling or waiting, that is, the data exchange process of the cores in different timing clusters can be started synchronously and ended asynchronously, and the data calculation process of the cores in different timing clusters can be started asynchronously. This can improve the utilization rate and execution efficiency of the multi-core processor.

[0045] In a possible implementation, the timing clusters may be asynchronous. When exchanging data between asynchronous timing clusters, it is necessary to consider how to synchronize the data and ensure the integrity of the data. When executing tasks, traditional multi-core processors need to establish a dedicated global control unit for global synchronization, which reduces the utilization and execution efficiency of the multi-core processor.

[0046] The present disclosure provides a data exchange method based on a many-core architecture. By having cores in different clusters start to execute computing tasks after data exchange synchronization is completed, it is possible to efficiently execute intra-core tasks and inter-core communication tasks in the many-core chip while ensuring data integrity, thereby improving the utilization rate and execution efficiency of the many-core processor.

[0047] In a possible implementation, each first sub-operation cycle and each second sub-operation cycle of the cores in the same cluster start and end synchronously. That is, the cores in the same cluster can synchronously exchange data and perform local calculations. For example, the cores in different clusters can synchronously start and end the data exchange process in a first sub-operation cycle; Figure 2 Each core of the timing cluster 1 can synchronously execute the sub-computing task D in a second sub-working cycle, and synchronously start executing the sub-computing task E in another second sub-working cycle when the execution of the sub-computing task D is synchronously finished.

[0048] In a possible implementation, the first working cycle corresponding to any cluster may include one or more first sub-working cycles, and each first sub-working cycle starts and ends synchronously. The number of the first sub-working cycles can be predetermined according to the amount of data exchanged. For example, the core 1 of the timing cluster 1 can complete the data exchange in one first sub-working cycle, and the core 2 of the timing cluster 2 can complete the data exchange in one first sub-working cycle, or can complete the data exchange in two first sub-working cycles. When the core 2 of the timing cluster 2 completes the data exchange in one first sub-working cycle, the first working cycle of the timing cluster 1 and the first working cycle of the timing cluster 2 start and end synchronously; when the core 2 of the timing cluster completes the data exchange in two first sub-working cycles, the first working cycle of the timing cluster 1 and the first working cycle of the timing cluster 2 start and end synchronously, but at this time, the first working cycle of the timing cluster 1 can start and end synchronously with one of the first sub-working cycles of the timing cluster 2. The time lengths of the two first sub-working cycles of the timing cluster 2 can be equal or unequal.

[0049] In a possible implementation, the first sub-working cycle can be synchronized by delaying the counter, and the time length for the counter to synchronize the first sub-working cycle can be greater than the time length occupied by the data exchange in the first sub-working cycle. For example, core 1 and core 2 of timing cluster 1 can exchange data with cores of other different clusters respectively. Since the amount of data exchanged by core 1 and core 2 may be different, the time length occupied by core 1 and core 2 to complete their respective data exchanges is also different. For example, the time length for core 1 to complete data exchange is 100ns (nanoseconds), and the time length for core 2 to complete data exchange is 150ns. Then, the counter can be used to delay the time point from when core 1 and core 2 start data exchange, and the delay time length is greater than 150ns, so that the working cycle of core 1 and core 2 for data exchange can be automatically aligned. It is worth noting that the time length for the counter to synchronize the first sub-working cycle can be pre-configured, and the maximum time length occupied by data exchange in each first sub-working cycle can also be automatically aligned. The present disclosure does not limit the time length.

[0050] In one possible implementation, a counter can be set in the matrix computing unit of the neuromorphic chip to perform delay in order to synchronize the first sub-working cycle of each core of different clusters. The counter can synchronize the first sub-working cycle of each core of different clusters in a decentralized manner, rather than globally synchronizing the first sub-working cycle of each core of all different clusters. At the same time, the counter can be implemented in hardware or in software. Under the architecture of the neuromorphic chip, setting the counter does not require adding an additional timing cluster interaction controller for synchronizing different clusters, which can simply and conveniently improve the utilization and execution efficiency of the multi-core processor. It should be understood by those skilled in the art that the present disclosure is not limited to the counter.

[0051] In a possible implementation, the second working cycle may include one or more second sub-working cycles, the computing task may include multiple sub-computing tasks, and each sub-computing task may be assigned to a different second sub-working cycle for execution. The number of the second sub-working cycles may be predetermined according to the task size of the computing task. It is worth noting that the first working cycle and the second working cycle may be performed in a pipeline manner, that is, the multi-core processor performs data exchange in the first working cycle and then performs the computing task in the second working cycle. The present disclosure does not limit the order of the first working cycle and the second working cycle.

[0052] Due to the difference in the amount of data exchange, the first working cycles of different clusters may be the same or different. Since the first working cycle can be synchronized using a counter delay, when the first working cycles of the cores of different clusters include the same number of first sub-working cycles, the second sub-working cycles of the cores of different clusters can start to execute computing tasks synchronously; when the first working cycles of the cores of different clusters include different numbers of first sub-working cycles, the second sub-working cycles of the cores of different clusters can start to execute computing tasks asynchronously.

[0053] In a possible implementation, when the lengths of the first working cycles of each cluster are equal, the first working cycles end synchronously, and the cores of different clusters start computing tasks synchronously in the second working cycle. For example, the first working cycle of core 1 of timing cluster 1 and the first working cycle of core 2 of timing cluster 2 can both include two first sub-working cycles. In this case, since the first sub-working cycle of core 1 and the first sub-working cycle of core 2 are respectively aligned, start synchronously and end synchronously, the first working cycle of core 1 is equal to the first working cycle of core 2, and the first working cycle of core 1 and the first working cycle of core 2 start synchronously and end synchronously. Since the cores of different clusters need to perform computing tasks in the second working cycle after completing data exchange in the first working cycle, when the first working cycles end synchronously, core 1 and core 2 start to perform computing tasks synchronously in the second working cycle.

[0054] In a possible implementation, when the lengths of the first working cycles of each cluster are not equal, the first working cycle ends asynchronously, and the cores of different clusters start computing tasks asynchronously in the second working cycle. In the case where the first working cycle ends asynchronously, the cores of different clusters start to execute computing tasks asynchronously in the second working cycle adjacent to the first working cycle. For example, the first working cycle of core 1 of timing cluster 1 may include two first sub-working cycles, and the first working cycle of core 2 of timing cluster 2 may include three first sub-working cycles. In this case, the first sub-working cycle of core 1 and the first sub-working cycle of core 2 are respectively aligned, start synchronously and end synchronously, but core 2 has one more first sub-working cycle than core 1, so the first working cycle of core 1 is not equal to the first working cycle of core 2, and the first working cycle of core 1 and the first working cycle of core 2 start synchronously and end asynchronously. Since the cores of different clusters need to execute computing tasks in the second working cycle after completing data exchange in the first working cycle, in the case where the first working cycle ends asynchronously, core 1 and core 2 start to execute computing tasks asynchronously in the second working cycle.

[0055] Figures 5 to 10 A schematic diagram of cores of different timing clusters exchanging data and executing computing tasks is shown, which is divided into six different situations. It should be understood by those skilled in the art that these six different situations are exemplary, and there may be other extended situations for the technical solution in the present disclosure. The present disclosure does not limit the extended situations derived from the data exchange method based on the many-core architecture.

[0056] Figure 5 A schematic diagram showing synchronization between single cores of two clusters according to an embodiment of the present disclosure.

[0057] In one possible implementation, Figure 5 As shown, the single cores of the two timing clusters are synchronized with each other. The first working cycle may be working cycle 1, during which timing cluster 1 and timing cluster 2 exchange data; the second working cycle may include working cycle 2 and working cycle 3, and timing cluster 1 and timing cluster 2 may respectively execute sub-computing task D and sub-computing task F in working cycle 2, and execute sub-computing task E and sub-computing task G in working cycle 3, that is, working cycle 2 and working cycle 3 may be the second sub-working cycle. The static primitive group may include the basic operations of the many-core processor, such as data exchange, neural network calculation, etc. Figure 5In the figure, static primitive group 1 can be used to represent the data exchange of the core, and the length of static primitive group 1 can represent the length of time taken by the core to complete the data exchange; static primitive group 2 and static primitive group 3 of core 1 can represent sub-computing task D and sub-computing task E respectively, static primitive group 2 and static primitive group 3 of core 2 can represent sub-computing task F and sub-computing task G respectively, and the lengths of static primitive group 2 and static primitive group 3 of the two cores can represent the length of time taken by the core to complete sub-computing task D and sub-computing task E respectively. The dotted line part can represent the time points when the working cycle of each core of different clusters starts and ends. For the other five cases below, the working cycle, static primitive group and dotted line have similar meanings and will not be repeated.

[0058] In one possible implementation, Figure 5 As shown, core 1 of timing cluster 1 and core 2 of timing cluster 2 exchange data in working cycle 1. Since the amount of data exchanged by core 1 and core 2 may be different, the length of time taken by core 1 and core 2 to complete the data exchange may also be different. In this case, a counter is used for delay, and the length of the delay is greater than the length of time taken by core 1 and core 2 to complete the data exchange respectively, so that core 1 and core 2 are synchronized after completing the data exchange. Since core 1 and core 2 start to execute computing tasks in working cycle 2 immediately after completing working cycle 1 for data exchange, for the sub-computing tasks of the first computing task (i.e., sub-computing task D of core 1 and sub-computing task F of core 2), working cycle 2 of core 1 and core 2 starts synchronously. Since the amount of tasks of sub-computing task D of core 1 and sub-computing task F of core 2 may be different, the length of time taken by core 1 and core 2 to complete the sub-computing tasks of the first computing task respectively is also different, so at the end of working cycle 2 of core 1 and core 2, core 1 and core 2 are asynchronous. After core 1 and core 2 have completed the sub-computing tasks of the first computing task, they then start to execute sub-computing tasks E and G respectively in working cycle 3. At this time, sub-computing tasks E and sub-computing tasks G are started asynchronously in working cycle 3. It is worth noting that if the execution time of sub-computing tasks D and sub-computing tasks F is equal, sub-computing tasks E and sub-computing tasks G can also be started synchronously in working cycle 3.

[0059] Figure 6 A schematic diagram showing synchronization between single cores of two clusters according to an embodiment of the present disclosure.

[0060] In one possible implementation, Figure 6As shown, the single cores of the two timing clusters are synchronized with each other. The first working cycle includes working cycle 1 and working cycle 2, working cycle 1 and working cycle 2 may be the first sub-working cycle, and timing cluster 1 and timing cluster 2 exchange data in the first working cycle; the second working cycle may include working cycle 3 and working cycle 4, working cycle 3 and working cycle 4 may be the second sub-working cycle, and timing cluster 1 and timing cluster 2 perform different computing tasks in the second working cycle.

[0061] In one possible implementation, Figure 6 As shown, core 1 of timing cluster 1 and core 2 of timing cluster 2 can be synchronized in working cycle 1 and working cycle 2, respectively, that is, when cores of different clusters include multiple first sub-working cycles, cores of different clusters can be synchronized in the corresponding first sub-working cycles. For example, core 1 and core 2 require two working cycles (i.e., working cycle 1 and working cycle 2) to exchange data. At this time, counter delay is used in working cycle 1 and working cycle 2 for synchronization, respectively, to ensure the smooth data exchange between core 1 and core 2. It is worth noting that the length of time that core 1 uses counter delay in working cycle 1 may be equal to or unequal to the length of time that core 1 uses counter delay in working cycle 2. The present disclosure does not limit the length of the delay.

[0062] Figure 7 A schematic diagram showing synchronization between single cores and multiple cores of two clusters according to an embodiment of the present disclosure.

[0063] In one possible implementation, Figure 7 As shown, the single core and multi-core of the two timing clusters are synchronized. The first working cycle includes working cycle 1, which can be the first sub-working cycle, and timing cluster 1 and timing cluster 2 exchange data in the first working cycle; the second working cycle can include working cycle 2 and working cycle 3, working cycle 2 and working cycle 3 can be the second sub-working cycle, and timing cluster 1 and timing cluster 2 perform different computing tasks in the second working cycle.

[0064] In one possible implementation, Figure 7As shown, core 1 in timing cluster 1 exchanges data with core 2, core 3 and core 4 in timing cluster 2, and each performs a computing task after the data exchange. In this case, when core 1 in timing cluster 1 and core 2, core 3 and core 4 in timing cluster 2 are synchronized by counter delay in working cycle 1, the time length of counter delay is greater than the time length taken by core 1 in timing cluster 1 and core 2, core 3 and core 4 in timing cluster 2 to perform data exchange. After the single core in timing cluster 1 and the multi-core in timing cluster 2 complete the data exchange synchronously, they start to synchronously execute computing tasks in working cycle 2. Core 2, core 3 and core 4 in timing cluster 2 synchronously end the sub-computing task in working cycle 2, and the end time point may be different from the end time point of working cycle 2 in timing cluster 1, that is, the computing tasks within the timing cluster are synchronous, and the computing tasks between timing clusters are asynchronous.

[0065] Figure 8 A schematic diagram showing synchronization between multiple cores and a single core of two clusters according to an embodiment of the present disclosure.

[0066] In one possible implementation, Figure 8 As shown, Figure 8 and Figure 7 The working process is the reverse transmission process, that is, Figure 7 If we can represent the situation where a single core in timing cluster 1 sends data to multiple cores in timing cluster 2, then Figure 8 This can represent the situation where the multi-cores of timing cluster 1 send data to the single core of timing cluster 2; Figure 7 If we can represent the situation where a single core of timing cluster 1 receives data from multiple cores of timing cluster 2, then Figure 8 This can represent the situation where the multi-cores of timing cluster 1 receive data from the single core of timing cluster 2. Figure 7 and Figure 8 The direction of data exchange between timing cluster 1 and timing cluster 2 is consistent, and the two can be equivalent.

[0067] Fig. 9 A schematic diagram showing synchronization between multiple cores of two clusters according to an embodiment of the present disclosure.

[0068] In one possible implementation, Fig. 9 As shown, the multi-cores of the two timing clusters are synchronized with each other. The first working cycle includes working cycle 1, which may be the first sub-working cycle, and timing cluster 1 and timing cluster 2 exchange data in the first working cycle; the second working cycle may include working cycle 2 and working cycle 3, which may be the second sub-working cycle, and timing cluster 1 and timing cluster 2 perform different computing tasks in the second working cycle.

[0069] In one possible implementation, Fig. 9 As shown, timing cluster 1 includes core 1, core 2 and core 3, and timing cluster 2 includes core 4, core 5 and core 6. After completing data exchange, core 1, core 2 and core 3 jointly perform sub-computing tasks in working cycle 2. Similarly, after completing data exchange, core 4, core 5 and core 6 jointly perform sub-computing tasks different from those of core 1, core 2 and core 3 in working cycle 2. Core 1, core 2 and core 3 of timing cluster 1 exchange data with core 4, core 5 and core 6 in working cycle 1, and still use counter delay for synchronization. The time length of counter delay is greater than the maximum time length taken by core 1 to core 6 to complete data exchange. After completing data exchange in working cycle 1, the multi-cores in timing cluster 1 and the multi-cores in timing cluster 2 start to execute computing tasks in working cycle 2 synchronously.

[0070] Fig.10 A schematic diagram showing synchronization between single cores of three clusters according to an embodiment of the present disclosure.

[0071] In one possible implementation, Fig.10 As shown, the single cores of the three timing clusters are synchronized with each other. For core 1 and core 2, the first duty cycle includes duty cycle 1, duty cycle 2 and duty cycle 3, duty cycle 1, duty cycle 2 and duty cycle 3 can be the first sub-duty cycle, and the second duty cycle includes duty cycle 4 and duty cycle 5, duty cycle 4 and duty cycle 5 can be the second sub-duty cycle; for core 3, the first duty cycle includes duty cycle 1 and duty cycle 2, duty cycle 1 and duty cycle 2 can be the first sub-duty cycle, the second duty cycle includes duty cycle 3, duty cycle 4 and duty cycle 5, duty cycle 3, duty cycle 4 and duty cycle 5 can be the second sub-duty cycle.

[0072] In one possible implementation, Fig.10 As shown, for core 1 and core 2, the first working cycle of the two cores includes three first sub-working cycles, and each first sub-working cycle starts and ends synchronously when core 1 and core 2 exchange data. The second working cycle of the two cores includes two second sub-working cycles, where the first executed second sub-working cycle starts synchronously and ends asynchronously, and the second sub-working cycle executed later starts and ends asynchronously. This situation is similar to Figure 6 .

[0073] In one possible implementation, Fig.10As shown, for core 1 and core 3, the first working cycle of core 1 includes 3 first sub-working cycles, and the first working cycle of core 3 includes 2 first sub-working cycles. In the first two sub-working cycles (i.e., working cycle 1 and working cycle 2), core 1 and core 3 start and end synchronously. Starting from working cycle 3, since core 1 still needs to continue data exchange and core 3 has completed data exchange, core 1 still needs to use the counter to continue delaying in working cycle 3, and execute the calculation task after the end of working cycle 3, while core 3 executes the calculation task at the beginning of working cycle 3. Similarly, the working process of core 1 and core 2 is similar to that of core 1 and core 3, which will not be repeated here.

[0074] In the actual working process, the data exchange and computing tasks are complex and varied. In addition to the six situations described above, the data exchange method based on the many-core architecture can also have more variations or more complex combinations. For example, synchronization can also be performed between multiple cores of multiple clusters, and its essential working mechanism is the same as the above six situations. This disclosure will not go into details.

[0075] In a possible implementation, the present disclosure also provides a data exchange device based on a many-core architecture. The device is applied to a many-core processor, the many-core processor includes multiple cores, the multiple cores are divided into multiple clusters according to different computing tasks, and the device includes: a data exchange unit, which is used to exchange data between the cores in the multiple clusters in a first working cycle, wherein the first working cycle corresponding to each cluster includes one or more first sub-working cycles, in each first sub-working cycle, data is exchanged between the cores of all or part of the multiple clusters, and the cores performing data exchange start and end synchronously; a computing unit, which is used for the cores of each cluster to perform computing tasks in a second working cycle adjacent to the first working cycle after the first working cycle ends, wherein the second working cycle corresponding to each cluster includes one or more second sub-working cycles, the computing tasks performed by each cluster include one or more sub-computing tasks, each sub-computing task is assigned to different second sub-cycles for execution, and each second sub-cycle between the clusters ends asynchronously.

[0076] In a possible implementation, for the device, among the cores in the same cluster, each first sub-working cycle and each second sub-working cycle start and end synchronously.

[0077] In a possible implementation, for the device, the first sub-working cycle is synchronized through a counter delay, and the time length for the counter to synchronize the first sub-working cycle is greater than the time length occupied by data exchange in the first sub-working cycle.

[0078] In one possible implementation, for the device, when the lengths of the first working cycles of each cluster are equal, the first working cycle ends synchronously, and the cores of different clusters start computing tasks synchronously in the second working cycle; when the lengths of the first working cycles of each cluster are not equal, the first working cycle ends asynchronously, and the cores of different clusters start computing tasks asynchronously in the second working cycle.

[0079] In a possible implementation, for the device, different clusters perform different computing tasks, and the same computing tasks are performed within a cluster.

[0080] The present disclosure also provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions, when executed by a processor, implement the data exchange method based on the many-core architecture.

[0081] The data exchange method based on the many-core architecture proposed in the present disclosure divides the cores of the many-core processor into different clusters, and the cores in the same cluster can perform the same task. The clusters perform a streamlined data exchange, and the data exchange between the clusters can be related to the adjacent clusters. The data exchange can include the reception and transmission of data. Each cluster can first perform data exchange and then perform data calculation. The data exchange is started synchronously, and the data calculation can be started and executed asynchronously. Each cluster can receive the output data of the previous cluster while sending the data to the next cluster for processing. When the cores in different clusters start to execute the computing task, there is no need to wait until the cores of all clusters complete the data exchange synchronously. The cores in the cluster can start to execute the computing task after the data exchange is completed.

[0082] The present disclosure solves the problem of low utilization and execution efficiency of the many-core processor by starting to execute computing tasks for the cores of different clusters after data exchange synchronization is completed, thereby ensuring the integrity of data transmission. After adopting this method, the many-core processor no longer needs to execute the local tasks of each core and the data exchange between cores according to global synchronization, and the overall waiting time of the many-core processor is reduced, thereby improving the utilization and execution efficiency of the many-core processor. At the same time, the data exchange method performs synchronization in a decentralized manner, retains the high parallelism of the many-core processor, can improve the processing speed, and does not need to add an additional controller for timing cluster synchronization. In addition, the method can support a variety of application scenarios, such as a complex computing system composed of multiple neural networks.

[0083] In a possible implementation, when dividing the timing clusters, the cores within the timing clusters can centrally process large-capacity data, and small-capacity data with long time intervals can be transmitted between different clusters, thereby increasing the processing speed of the multi-core processor.

[0084] It should be noted that although the data exchange method and device are introduced with various scenarios as examples, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, users can flexibly set the data exchange method and device according to personal preferences and / or actual application scenarios, as long as the technical solution of the present disclosure is used to achieve equivalent technical effects.

[0085] In this way, by starting to execute computing tasks for cores of different clusters after data exchange synchronization is completed, the data exchange method and device according to the above embodiments of the present disclosure can improve the utilization rate and execution efficiency of the many-core processor.

[0086] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A data exchange method based on many-core architecture, It is characterized in that The method is applied to a many-core processor, the many-core processor includes multiple cores, the multiple cores are divided into multiple clusters according to different computing tasks, and the method includes: The cores in the plurality of clusters exchange data in a first working cycle, wherein the first working cycle corresponding to each cluster includes one or more first sub-working cycles, and in each first sub-working cycle, the cores in all or part of the plurality of clusters exchange data, and the cores that perform data exchange start and end synchronously; After the first working cycle ends, the cores of each cluster perform computing tasks in a second working cycle adjacent to the first working cycle, wherein the second working cycle corresponding to each cluster includes one or more second sub-working cycles, and the computing tasks performed by each cluster include one or more sub-computing tasks, each sub-computing task is assigned to a different second sub-cycle for execution, and each second sub-working cycle between clusters ends asynchronously, and the first sub-working cycle is synchronized through a counter delay, and the time length for the counter to synchronize the first sub-working cycle is greater than the time length occupied by data exchange in the first sub-working cycle.

2. The method according to claim 1, It is characterized in that Among the cores in the same cluster, each first sub-working cycle and each second sub-working cycle start and end synchronously.

3. The method according to claim 1, It is characterized in that When the lengths of the first working cycles of the clusters are equal, the first working cycles end synchronously, and the cores of different clusters start computing tasks synchronously in the second working cycle; When the lengths of the first working cycles of the clusters are not equal, the first working cycle ends asynchronously, and the cores of different clusters start computing tasks asynchronously in the second working cycle.

4. The method according to claim 1, It is characterized in that Different clusters perform different computing tasks, and the same computing tasks are performed within a cluster.

5. A data exchange device based on many-core architecture, It is characterized in that The device is applied to a many-core processor, the many-core processor includes multiple cores, the multiple cores are divided into multiple clusters according to different computing tasks, and the device includes: A data exchange unit, configured to perform data exchange between the cores in the plurality of clusters in a first working cycle, wherein the first working cycle corresponding to each cluster includes one or more first sub-working cycles, and in each first sub-working cycle, data exchange is performed between the cores in all or part of the plurality of clusters, and the data exchange is started and ended synchronously between the cores; A computing unit is used for, after the first working cycle ends, the cores of each cluster execute computing tasks in a second working cycle adjacent to the first working cycle, wherein the second working cycle corresponding to each cluster includes one or more second sub-working cycles, the computing tasks executed by each cluster include one or more sub-computing tasks, each sub-computing task is assigned to a different second sub-cycle for execution, each second sub-cycle between clusters ends asynchronously, the first sub-working cycle is synchronized by a counter delay, and the time length for the counter to synchronize the first sub-working cycle is greater than the time length occupied by data exchange in the first sub-working cycle.

6. The device according to claim 5, It is characterized in that Among the cores in the same cluster, each first sub-working cycle and each second sub-working cycle start and end synchronously.

7. The device according to claim 5, It is characterized in that When the lengths of the first working cycles of the clusters are equal, the first working cycles end synchronously, and the cores of different clusters start computing tasks synchronously in the second working cycle; When the lengths of the first working cycles of the clusters are not equal, the first working cycle ends asynchronously, and the cores of different clusters start computing tasks asynchronously in the second working cycle.

8. The device according to claim 5, It is characterized in that Different clusters perform different computing tasks, and the same computing tasks are performed within a cluster.

9. A non-volatile computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Distributed, event-based computation using neuromorphic cores

    US20190266481A1