Processor and kernel synchronization method for processor
By periodically querying the processor core and managing the routing cross-switch, the problem of core synchronous occupation of on-chip bandwidth is solved, thus improving the processor's transmission efficiency.
Patent Information
- Application Number
- CN202511535303.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-10-27
AI Technical Summary
Multiple processor cores requesting specific data consume a significant amount of on-chip bandwidth, leading to reduced on-chip transmission efficiency.
The processor core periodically sends query requests to the routing crossbar switch for data cache units. The routing crossbar switch detects and manages the routing forwarding and delay of query requests, ensuring that data value comparison and response transmission are only performed when the kernel synchronization conditions are met.
This reduces the on-chip bandwidth usage of query requests and responses within the processor, thereby improving the processor's transmission efficiency.
Smart Images

Figure CN120994613A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence chips, and in particular to a processor and a kernel synchronization method for the processor. Background Technology
[0002] Processors used for artificial intelligence typically employ out-of-order read and write operations across multiple processing cores to achieve higher overall processor efficiency. These out-of-order read and write operations also require synchronization, which can be achieved by querying the value of specified data.
[0003] However, multiple processor cores initiating query requests for the same data will consume a significant amount of on-chip bandwidth, thereby reducing the on-chip transmission efficiency of the processor.
[0004] Therefore, how to reduce the on-chip bandwidth occupied by kernel synchronization in the processor has become a technical problem that needs to be solved in the existing technology. Summary of the Invention
[0005] This application provides a processor and a kernel synchronization method for the processor, which helps to reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0006] In one embodiment of this application, a processor is provided, including a plurality of processing cores, each of the plurality of processing cores being configured to: periodically initiate a query request to a routing cross switch for specified data in a data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing core;
[0007] The routing crossover switch is configured as follows:
[0008] When any of the plurality of processing kernels initiates a query request for the specified data, it is detected whether a query request for the specified data has already been routed to the data cache unit and whether the data cache unit has not yet generated a corresponding query response;
[0009] If not, the query request is routed and forwarded to the data cache unit;
[0010] If so, the query request will be deferred by canceling the routing forwarding of the query request;
[0011] When the data caching unit generates a corresponding query response for a routed query request, it checks whether there are any pending query requests; if so, it generates a corresponding query response based on the received query response being a pending query request.
[0012] The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
[0013] In some examples, optionally, each of the plurality of processing kernels initiates a query request carrying its target value, and the corresponding query response generated by the data caching unit for the routed query request carries the current value of the specified data; the routing crossover switch is further configured to: retain queries that have been routed to the data caching unit and are waiting for the data caching unit to generate a corresponding query request; when the data caching unit generates a corresponding query response for the routed query request, compare the current value of the specified data carried in the received query response with the target value of the corresponding processing kernel carried in each retained or delayed query request, and generate indication information for the corresponding processing kernel indicating whether the current value of the specified data is the same as the target value of the processing kernel; in response to the generation of the indication information of the corresponding processing kernel of any retained or delayed query request, delete the query request.
[0014] In some examples, the routing crossover switch is optionally further configured to provide the indication information of the corresponding processing kernel of any retained or delayed query request, together with the current value of the specified data carried in the received query response, to the corresponding processing kernel of the query request.
[0015] In some examples, optionally, the routing crossover switch is further configured to: maintain a first request list and a second request list, wherein the first request list is used to cache retained query requests, and the second request list is used to cache delayed query requests; the routing crossover switch is specifically configured to: determine whether a query request for the specified data has been routed to the data caching unit and wait for the data caching unit to generate a corresponding query response by detecting the first request list; determine whether there are delayed query requests by detecting the second request list; and delete query requests by clearing the query requests in the first request list and the second request list.
[0016] In some examples, optionally, the routing crossover switch is further configured to: if a query request for the specified data has already been routed to the data cache unit and a corresponding query response has not yet been received from the data cache unit, then check whether the second request list is full; if the second request list is currently full, then discard the query request and send a request failure message to the corresponding processing kernel that generated the query request.
[0017] Optionally, in some examples, the routing crossover switch is further configured to: fill the current value of the specified data carried in the received query response into the corresponding empty field of the query request in the first request list, and return the query request in the first request list with the current value of the specified data filled in it, together with the indication information generated for the corresponding processing kernel of the query request, to the corresponding processing kernel of the query request; fill the current value of the specified data filled in the query request in the first request list into the corresponding empty field of the query request in the second request list, and return the query request in the second request list with the current value of the specified data filled in it, together with the indication information generated for the corresponding processing kernel of the query request, to the corresponding processing kernel of the query request.
[0018] In some examples, the routing crossover switch is optionally configured to broadcast the current value of the specified data of the query request in the first request list to the corresponding empty field of each query request in the second request list.
[0019] In some examples, optionally, each of the plurality of processing kernels initiates a query request carrying its target value, and the data caching unit generates a corresponding query response for the routed query request carrying the current value of the specified data and indication information indicating whether the current value of the specified data is the same as the target value carried in the query request routed to the data caching unit; the routing crossover switch is further configured to: when receiving a corresponding query response generated by the data caching unit for the routed query request, provide the indication information carried in the received query response to the corresponding processing kernel of the query request; compare the current value of the specified data carried in the received query response with the target value of the corresponding processing kernel carried in each of the retained query requests, and generate indication information for the corresponding processing kernel of the retained query request indicating whether the current value of the specified data is the same as the target value of the processing kernel; and delete the query request in response to the generation of the indication information of the corresponding processing kernel of any retained query request.
[0020] In some examples, optionally, the routing crossover switch is further configured to: provide the indication information carried in the received query response together with the current value of the specified data carried in the query response to the corresponding processing kernel of the query request; and provide the indication information of the corresponding processing kernel of any pending query request together with the current value of the specified data carried in the received query response to the corresponding processing kernel of the query request.
[0021] In some examples, optionally, the data caching unit is configured to: when receiving a query request for specified data routed and forwarded by the routing cross-switch for any of the plurality of processing kernels, detect whether the current value of the specified data is the same as the target value of the processing kernel; if so, generate a corresponding query response to the routing cross-switch for the query request initiated by the processing kernel; if not, delay generating a corresponding query response to the routing cross-switch for the query request initiated by the processing kernel until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data continues to be different from the target value of the processing kernel.
[0022] In another embodiment of this application, a processor is provided, including a plurality of processing cores, each of the plurality of processing cores being configured to: periodically initiate a query request to a routing cross switch for specified data in a data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing core;
[0023] The data caching unit is configured as follows:
[0024] When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel.
[0025] If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch;
[0026] If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data is continuously different from the target value of the processing kernel;
[0027] The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
[0028] In some examples, optionally, the query request initiated by any of the plurality of processing kernels carries the target value of that processing kernel; the data caching unit is further configured to: if it is detected that the current value of the specified data is different from the target value of the corresponding processing kernel that initiated the received query request, then retain the received query request; before the preset time expires, perform at least one comparison between the current value of the specified data and the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0029] In some examples, the data caching unit is optionally configured to: in response to each change in the value of the specified data before the preset time expires, perform a comparison between the current value of the specified data and the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0030] In some examples, optionally, the data caching unit generates a corresponding query response for a received query request, which carries at least one of the following: indication information indicating whether the current value of the specified data is the same as the target value carried in the query request; and the current value of the specified data.
[0031] In another embodiment of this application, a kernel synchronization method for a processor is provided, the processor including a plurality of processing kernels, each of the plurality of processing kernels being configured to: periodically initiate a query request to a routing cross switch for specified data in a data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing kernel;
[0032] The kernel synchronization method includes the following steps performed by the routing cross switch:
[0033] When any of the plurality of processing kernels initiates a query request for the specified data, it is detected whether a query request for the specified data has already been routed to the data cache unit and whether the data cache unit has not yet generated a corresponding query response;
[0034] If not, the query request is routed and forwarded to the data cache unit;
[0035] If so, the query request will be deferred by canceling the routing forwarding of the query request;
[0036] When the data caching unit generates a corresponding query response for a routed query request, it checks whether there are any pending query requests; if so, it generates a corresponding query response based on the received query response being a pending query request.
[0037] The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
[0038] In some examples, optionally, each of the plurality of processing kernels initiates a query request carrying its target value, and the corresponding query response generated by the data caching unit for the routed query request carries the current value of the specified data; the kernel synchronization method further includes the following steps performed by the routing crossover switch: retaining queries that have been routed to the data caching unit and are waiting for the data caching unit to generate a corresponding query request; when the data caching unit generates a corresponding query response for the routed query request, comparing the current value of the specified data carried in the received query response with the target value of the corresponding processing kernel carried in each retained or delayed query request, and generating indication information for the corresponding processing kernel indicating whether the current value of the specified data is the same as the target value of the processing kernel; in response to the generation of the indication information of the corresponding processing kernel of any retained or delayed query request, deleting the query request.
[0039] In some examples, the kernel synchronization method may optionally further include the following steps performed by the routing crossover switch: providing the indication information of the corresponding processing kernel of any retained or delayed query request, together with the current value of the specified data carried in the received query response, to the corresponding processing kernel of the query request.
[0040] Optionally, in some examples, the kernel synchronization method further includes the following steps performed by the routing crossover switch: maintaining a first request list and a second request list, the first request list being used to cache retained query requests and the second request list being used to cache delayed query requests; detecting whether a query request for the specified data has been routed to the data cache unit and a corresponding query response has not yet been received from the data cache unit includes: determining whether a query request for the specified data has been routed to the data cache unit by detecting the first request list and waiting for the data cache unit to generate a corresponding query response; detecting whether a delayed query request exists includes: determining whether a delayed query request exists by detecting the second request list; and deleting the query request in response to the generation of the indication information of the corresponding processing kernel for any retained or delayed query request includes: deleting the query request by clearing the query requests in the first request list and the second request list.
[0041] In some examples, optionally, the kernel synchronization method further includes the following steps performed by the routing crossover switch: if a query request for the specified data has already been routed to the data cache unit and a corresponding query response has not yet been received from the data cache unit, then it is detected whether the second request list is full; if the second request list is currently full, then the query request is discarded and a request failure message is sent to the corresponding processing kernel that generated the query request.
[0042] Optionally, in some examples, the kernel synchronization method further includes the following steps performed by the routing cross switch: filling the current value of the specified data carried in the received query response into the corresponding empty field of the query request in the first request list, and returning the query request in the first request list with the current value of the specified data filled in, together with the indication information generated for the corresponding processing kernel of the query request, to the corresponding processing kernel of the query request; filling the current value of the specified data filled in the query request in the first request list into the corresponding empty field of the query request in the second request list, and returning the query request in the second request list with the current value of the specified data filled in, together with the indication information generated for the corresponding processing kernel of the query request, to the corresponding processing kernel of the query request.
[0043] In some examples, optionally, filling the current value of the specified data of the query request in the first request list into the corresponding empty field of the query request in the second request list includes: broadcasting the current value of the specified data of the query request in the first request list into the corresponding empty field of each query request in the second request list.
[0044] In some examples, optionally, each of the plurality of processing kernels initiates a query request carrying its target value, and the data caching unit generates a corresponding query response for the routed query request carrying the current value of the specified data and indication information indicating whether the current value of the specified data is the same as the target value carried in the query request routed to the data caching unit; the kernel synchronization method further includes the following steps performed by the routing crossover switch: when the data caching unit generates a corresponding query response for the routed query request, the indication information carried in the received query response is provided to the corresponding processing kernel of the query request; the current value of the specified data carried in the received query response is compared with the target value of the corresponding processing kernel carried in each of the retained query requests, to generate indication information for the corresponding processing kernel of the retained query request indicating whether the current value of the specified data is the same as the target value of the processing kernel; in response to the generation of the indication information of the corresponding processing kernel of any retained query request, the query request is deleted.
[0045] In some examples, optionally, the kernel synchronization method further includes the following steps performed by the routing cross switch: providing the indication information carried in the received query response together with the current value of the specified data carried in the query response to the corresponding processing kernel of the query request; providing the indication information of the corresponding processing kernel of any pending query request together with the current value of the specified data carried in the received query response to the corresponding processing kernel of the query request.
[0046] Optionally, in some examples, the kernel synchronization method further includes the following steps performed by the data caching unit: when a query request for specified data is received from the routing cross-switch for any of the plurality of processing kernels, the current value of the specified data is detected as being the same as the target value of the processing kernel; if so, a corresponding query response is generated to the routing cross-switch for the query request initiated by the processing kernel; if not, the generation of a corresponding query response to the routing cross-switch for the query request initiated by the processing kernel is delayed until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data remains different from the target value of the processing kernel.
[0047] In another embodiment of this application, a kernel synchronization method for a processor is provided, the processor including a plurality of processing kernels, each of the plurality of processing kernels being configured to: periodically initiate a query request to a routing cross switch for specified data in a data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing kernel;
[0048] The kernel synchronization method includes the following steps performed by the data cache unit:
[0049] When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel.
[0050] If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch;
[0051] If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data is continuously different from the target value of the processing kernel;
[0052] The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
[0053] In some examples, optionally, a query request initiated by any of the plurality of processing kernels carries the target value of that processing kernel; the kernel synchronization method further includes the following steps performed by the data caching unit: if it is detected that the current value of the specified data is different from the target value of the corresponding processing kernel that initiated the received query request, then the received query request is retained; before the preset time expires, at least one comparison is performed between the current value of the specified data and the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0054] In some examples, optionally, performing at least one comparison of the current value of the specified data with the target value in the retained query request before the preset time expires, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires, includes: in response to each change in the value of the specified data before the preset time expires, performing a comparison of the current value of the specified data with the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0055] In some examples, optionally, the data caching unit generates a corresponding query response for a received query request, which carries at least one of the following: indication information indicating whether the current value of the specified data is the same as the target value carried in the query request; and the current value of the specified data.
[0056] Based on the above embodiments of this application, query requests initiated by multiple processing cores in the processor for the same specified data can be selectively routed and forwarded to the data cache unit where the specified data resides. Therefore, this not only reduces the on-chip bandwidth usage of query requests but also indirectly reduces the number of query responses that consume processor bandwidth. Alternatively, the data cache unit where the specified data resides can reduce the generation of query responses that prompt the processing cores to continue initiating query requests. Therefore, this not only reduces the on-chip bandwidth usage of query responses but also indirectly reduces the number of query requests that consume processor bandwidth. Thus, the embodiments of this application can suppress the on-chip bandwidth usage of query requests and responses used for kernel synchronization from the source of query request routing or the source of query response generation, thereby helping to reduce the on-chip bandwidth usage of kernel synchronization in the processor. Attached Figure Description
[0057] The following figures are for illustrative purposes only and do not limit the scope of this application:
[0058] Figure 1This is a schematic diagram of the internal architecture of the processor in the embodiments of this application;
[0059] Figure 2 This is a schematic diagram of an extended structure of the internal architecture of the processor in the embodiments of this application;
[0060] Figure 3 This is a schematic diagram illustrating the principle of processor kernel synchronization in the embodiments of this application;
[0061] Figure 4 This is a schematic diagram of a first device embodiment for reducing on-chip bandwidth usage by a processor in this application.
[0062] Figure 5 This is a schematic diagram of an example embodiment of a first device for reducing on-chip bandwidth usage by a processor in this application.
[0063] Figure 6 This is a schematic diagram of a second device embodiment for reducing on-chip bandwidth usage by the processor in this application.
[0064] Figure 7 This is a schematic diagram of an example embodiment of a second device for reducing on-chip bandwidth usage by a processor in this application.
[0065] Figure 8 This is a schematic diagram of a third device embodiment for reducing on-chip bandwidth usage by the processor in this application.
[0066] Figure 9 This is a flowchart illustrating a first method embodiment of the kernel synchronization method for a processor according to the present application.
[0067] Figure 10 This is a flowchart illustrating a second method example of a kernel synchronization method for a processor according to an embodiment of this application. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments.
[0069] For example, in the embodiments of this application, the processor can be any one of the following integrated circuit chips suitable for artificial intelligence: GPU (Graphics Processing Unit), TPU (Tensor Processing Unit), NPU (Neural Network Processing Unit), DPU (Deep Learning Processing Unit), APU (Accelerated Processing Unit), and GPGPU (General-Purpose computing on Graphics Processing Units).
[0070] Figure 1 This is a schematic diagram of the internal architecture of the processor in an embodiment of this application. Please refer to [link / reference]. Figure 1 In embodiments of this application, the processor may include multiple processing cores 10_1 to 10_m, a routing crossbar 30, and a data cache unit 50. Here, m represents the number of processing cores 10_1 to 10_m, and m is a positive integer greater than 1. Furthermore, the multiple processing cores 10_1 to 10_m can be used for artificial intelligence; in this case, the multiple processing cores 10_1 to 10_m can all be referred to as artificial intelligence cores (AI cores).
[0071] For example, in the embodiments of this application, the routing crossbar 30 can be interconnected with the data cache unit 50 via a network on chip (NOC) 60, and the interconnection between the multiple processing cores 10_1~10_m and the routing crossbar 30 can be a local interconnection that does not depend on the NOC.
[0072] Figure 2 This is a schematic diagram of an extended internal architecture of the processor in an embodiment of this application. Please refer to... Figure 2 In embodiments of this application, the processor may include one or more Streaming Processor Clusters (SPCs) 70 for kernel computing, and any one or each SPC 70 may include multiple processing cores 10_1 to 10_m and routing crossover switches 30. That is, the aforementioned multiple processing cores 10_1 to 10_m and routing crossover switches 30 may be included in the same SPC 70, and... Figure 1The internal architecture of the processor shown may be a local architecture that only reflects a part of the processor (e.g., a cluster of stream processors).
[0073] For example, in embodiments of this application, the data cache unit 50 may be included in the same stream processor cluster 70 as multiple processing cores 10_1~10_m and routing crossover switch 30, or the data cache unit 50 may be located outside the stream processor cluster 70 to which the multiple processing cores 10_1~10_m and routing crossover switch 30 belong. Wherein, if the data cache unit 50 is included in the same stream processor cluster 70 as multiple processing cores 10_1~10_m and routing crossover switch 30, and the processor also includes at least one main memory 90 independent of the stream processor cluster 70, then the data cache unit 50 may be a last-level cache (LLC) corresponding to any one of the main memories 90. It is understood that whether the data cache unit 50 is located within the stream processor cluster 70 or is located outside the stream processor cluster 70 as a last-level cache corresponding to any one of the main memories 90, the stream processor cluster 70 may further include other cache units not shown in the figures.
[0074] For example, in the embodiments of this application, any one of the multiple processing kernels 10_1 to 10_m, processing kernel 10_p, can perform read and write operations out of order, where p is a positive integer greater than or equal to 1 and less than or equal to m.
[0075] For example, when the processor is a GPGPU, a relaxed memory consistency model can be used in the GPGPU to support out-of-order read and write operations. Furthermore, in the embodiments of this application, out-of-order read and write operations of any processing kernel 10_p can be synchronized in stages.
[0076] For example, in the embodiments of this application, any one of the multiple processing kernels 10_1 to 10_m, processing kernel 10_p, can execute read and write instructions sequentially in stages to achieve out-of-order read and write operations in the processor. Furthermore, in the embodiments of this application, memory fence instructions can be set between the read and write instructions of each stage of any processing kernel 10_p, so that when the processing kernel 10_p reaches the fence instruction, a synchronization will be triggered.
[0077] Figure 3 This is a schematic diagram illustrating the principle of processor kernel synchronization in an embodiment of this application.
[0078] Please see Figure 3In the embodiments of this application, when any one of the multiple processing kernels 10_p from 10_1 to 10_m triggers synchronization by running the fence instruction (e.g. Figure 3 In the “①”, the processing kernel 10_p can determine whether all out-of-order read and write operations prior to the fence instruction have been completed.
[0079] See also Figure 3 In embodiments of this application, any one of the multiple processing kernels 10_1 to 10_m, processing kernel 10_p, can respond to a request for an atomic operation (such as...) on specified data 20 in data cache unit 50 in response to a read / write operation completion determined by executing a fence instruction. Figure 3 The "②" in the text triggers the data cache unit 50 to perform an atomic operation on the specified data 20 and changes the current value of the specified data 20 through the atomic operation.
[0080] For example, in an embodiment of this application, each of the plurality of processing kernels 10_p among the processing kernels 10_1 to 10_m can be configured to initiate an atomic operation request to the routing crossover switch 30 for a specified data 20 in the data cache unit 50. Thus, any atomic operation request initiated by any processing kernel 10_p can be routed and forwarded by the routing crossover switch 30 to the data cache unit 50, triggering the data cache unit 50 to perform an atomic operation on the specified data 20 and change the current value of the specified data 20 through the atomic operation.
[0081] For example, in an embodiment of this application, the data caching unit 50 can perform an atomic operation on the specified data 20 to increment the current value of the specified data 20 by 1. In this case, the value of the specified data 20 can be used to characterize the number of kernels that have completed the current stage among the multiple processing kernels 10_1 to 10_m, and the upper limit of the value of the specified data 20 can be m.
[0082] For example, in an embodiment of this application, the synchronization condition of any processing kernel 10_p among the plurality of processing kernels 10_1 to 10_m at the current stage may include: the number of kernels among the plurality of processing kernels 10_1 to 10_m that have completed the current stage reaches a target value, that is, the target value of each processing kernel 10_p among the plurality of processing kernels 10_1 to 10_m is used to characterize the synchronization condition of the processing kernel 10_p, and the target values of the plurality of processing kernels 10_1 to 10_m may all be the same or not all be the same.
[0083] For example, the target value of each processing kernel 10_p in the multiple processing kernels 10_1~10_m can be m. That is, each processing kernel 10_p in the multiple processing kernels 10_1~10_m can determine that the synchronization of the current stage is completed and can start the read and write operation of the next stage when the number of kernels that have completed the current stage in the multiple processing kernels 10_1~10_m reaches m. That is, one kernel synchronization of the processing kernel 10_p is completed.
[0084] For example, the target value of any processing kernel 10_p among the multiple processing kernels 10_1~10_m can be m. That is, when the number of kernels among the multiple processing kernels 10_1~10_m that have completed the current stage reaches m, the processing kernel 10_p completes the synchronization of the current stage and can start the read and write operation of the next stage. At the same time, the target value of another processing kernel 10_q among the multiple processing kernels 10_1~10_m can be mn, where q is a positive integer greater than or equal to 1, less than or equal to m and not equal to p, and n is a positive integer greater than or equal to 1 and less than m. That is, when the number of kernels among the multiple processing kernels 10_1~10_m that have completed the current stage reaches mn, the processing kernel 10_q completes the synchronization of the current stage and can start the read and write operation of the next stage.
[0085] See also Figure 3 In embodiments of this application, any (or each) of the plurality of processing kernels 10_1 to 10_m, processing kernel 10_p, may initiate a polling process for the current value of specified data 20 in data cache unit 50 in response to the completion of an atomic operation initiated by processing kernel 10_p. Figure 3 The "③" in the text is used to determine whether the current value of the specified data 20 is the same as the target value of the processing kernel 10_p. The query for the current value of the specified data 20 by each of the multiple processing kernels 10_1 to 10_m can be a periodic loop until it is determined that the current value of the specified data 20 is the same as the target value of the processing kernel 10_p.
[0086] For example, in an embodiment of this application, if the data cache unit 50 serves as the last-level cache for any corresponding main memory 90, then the specified data 20 may be normally stored in the corresponding main memory 90, and the specified data 20 in the data cache unit 50 may not be normally stored in the data cache unit 50. In this case, when any processing kernel 10_p among multiple processing kernels 10_1~10_m initiates an atomic operation or query on the specified data 20, the data cache unit 50 will first determine whether the atomic operation or query can be locally hit in the data cache unit 50. If it is hit, the atomic operation or query will be executed directly. If it is not hit, the specified data 20 will be read from the main memory 90 into the data cache unit 50, and then the atomic operation or query will be executed.
[0087] For example, in an embodiment of this application, any (or each) of the plurality of processing kernels 10_1 to 10_m can be configured to periodically initiate a query request to the routing cross switch 30 for a specified data 20 in the data cache unit 50 until it is determined (e.g., based on the query response corresponding to the query request) that the current value of the specified data 20 is the same as the target value of the processing kernel 10_p.
[0088] In this scenario, if each query request initiated by a processing kernel 10_p among multiple processing kernels 10_1~10_m is routed and forwarded by the routing cross switch 30 to the data cache unit 50 via the on-chip network 60, and the data cache unit 50 generates a corresponding query response for each received query request, which is then transmitted to the routing cross switch 30 via the on-chip network 60, then the on-chip bandwidth occupied by kernel synchronization in the processor is relatively large. Therefore, embodiments of this application aim to reduce the number of query requests routed and forwarded to the data cache unit 50 via the on-chip network 60, thereby indirectly reducing the number of query responses generated by the data cache unit 50 and transmitted to the routing cross switch 30 via the on-chip network 60, and / or, by reducing the number of substandard query responses generated by the data cache unit 50 and transmitted to the routing cross switch 30 via the on-chip network 60, thereby indirectly reducing the number of query requests routed and forwarded to the data cache unit 50 via the on-chip network 60. In this document, a "non-compliant query response" refers to a query response generated when the current value of specified data 20 differs from the target value of processing kernel 10_p for any query request generated by processing kernel 10_p. Such a response can also be referred to as a "non-ready" query response indicating that synchronization preparation (ready) is not yet complete. Conversely, a query response generated when the current value of specified data 20 is the same as the target value of processing kernel 10_p for any query request generated by processing kernel 10_p can be considered a compliant query response. Furthermore, a "compliant query response" as described in this document can be referred to as a "ready" query response indicating that synchronization preparation is complete.
[0089] Figure 4 This is a schematic diagram of a first device embodiment for reducing on-chip bandwidth usage by the processor in this application. Figure 4 The first device embodiment shown can reduce query requests routed to the data cache unit 50 via the on-chip network 60 by improving the routing crossover switch 30, and thereby indirectly reduce query responses generated by the data cache unit 50 and transmitted to the routing crossover switch 30 via the on-chip network 60.
[0090] Please see Figure 4 In the first device embodiment of this application, the routing crossover switch 30 can be configured as follows:
[0091] When any processing kernel 10_p or 10_q among multiple processing kernels 10_1 to 10_m initiates a query request Poll_req_p or Poll_req_q for specified data 20 in data cache unit 50, it is checked whether a query request for the specified data 20 has already been routed to data cache unit 50 and whether a corresponding query response has been received from data cache unit 50. Each of the multiple processing kernels 10_1 to 10_m will initiate a query request. Therefore, the arbitrary processing kernel represented by 10_p or 10_q in this paper is intended to indicate that the technical solution involves not only one processing kernel but can involve multiple different processing kernels when describing the technical solution by focusing on only one processing kernel. That is, processing kernel 10_p or 10_q generally refers to any one or any multiple processing kernels among multiple processing kernels 10_1 to 10_m.
[0092] If not (i.e., if no query request for the specified data 20 has been routed to the data cache unit 50 and no corresponding query response has been received from the data cache unit 50), for example, if the query request Poll_req_p initiated by kernel 10_p is processed earlier than the query request Poll_req_q initiated by kernel 10_q, and a query request for the specified data 20 has already been routed to the data cache unit 50 and no corresponding query response has been received from the data cache unit 50 when the query request Poll_req_p is initiated by kernel 10_p, then the query request Poll_req_q currently initiated by kernel 10_p will be routed to the data cache unit 50.
[0093] If (i.e., if a query request for the specified data 20 has already been routed to the data cache unit 50 and a corresponding query response has not yet been received from the data cache unit 50), for example, if the query request Poll_req_p initiated by kernel 10_p is processed earlier than the query request Poll_req_q initiated by kernel 10_q, and when the query request Poll_req_q initiated by kernel 10_q has already been routed to the data cache unit 50 and a corresponding query response has not yet been received from the data cache unit 50, then the query request Poll_req_q will be retained by canceling the route forwarding of the query request Poll_req_q currently initiated by kernel 10_q.
[0094] When the data caching unit 50 receives the query request Poll_req_p forwarded by the route and generates the corresponding query response Poll_rsp_p, it checks whether there is a pending query request; if so (i.e., if there is a pending query request Poll_req_q), it generates the corresponding query response Poll_rsp_q for the pending query request Poll_req_q based on the query response Poll_rsp_p corresponding to the received query request Poll_req_p.
[0095] For example, in the first device embodiment of this application, the query response Poll_rsp_p or Poll_rsp_q corresponding to any query request Poll_req_p or Poll_req_q can be used to: determine whether the current value of the specified data 20 is the same as the target value of the processing kernel 10_p or 10_q among the multiple processing kernels 10_1 to 10_m that initiated the query request Poll_req_p or Poll_req_q.
[0096] Based on the first device embodiment described above in this application, query requests initiated by multiple processing cores 10_1 to 10_m in the processor for the same specified data 20 can be selectively routed and forwarded to the data cache unit 50 where the specified data 20 is located. Therefore, not only can the occupation of the processor's on-chip bandwidth (e.g., the bandwidth of the on-chip network 60) by query requests be reduced, but the occupation of the processor's on-chip bandwidth by query responses can also be indirectly reduced. Thus, the first device embodiment described above in this application can suppress the occupation of the processor's on-chip bandwidth by query requests and query responses used to achieve kernel synchronization from the source of query request routing and forwarding, thereby helping to reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0097] Figure 5 This is a schematic diagram of an example embodiment of a first device for reducing on-chip bandwidth usage by a processor in this application. Please refer to... Figure 5In the first device embodiment of this application, in each of the multiple processing kernels 10_p or 10_q, among the processing kernels 10_1 to 10_m, the query request Poll_req_p or Poll_req may carry, in addition to carrying address information Addr representing the storage address of the specified data 20 (e.g., the storage address of the specified data 20 in the data cache unit 50 or main memory 90), the target value Val_obj_p or Val_obj_q of the processing kernel 10_p or 10_q. Furthermore, the corresponding query response Poll_rsp_p generated by the data cache unit 50 for the routed query request Poll_req_p may carry the current value Val_atm of the specified data 20. In this case, the routing crossover switch 30 can be further configured to retain queries that have been routed to the data cache unit 50 and are waiting for the data cache unit 50 to generate a corresponding query request Poll_req_p.
[0098] For example, in the first device embodiment of this application, the routing crossover switch 30 can be further configured to: when the data buffer unit 50 generates a corresponding query response Poll_rsp_p for the route forwarding query request Poll_req_p, compare the current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p with the target value Val_obj_p of the corresponding processing kernel 10_p carried in the retained query request (i.e., the query request corresponding to the query response Poll_rsp_p) Poll_req_p.
[0099] For example, in the first device embodiment of this application, the routing crossover switch 30 may be further configured to: compare the current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p with the query response Poll_rsp_q corresponding to each delayed query request (i.e., the query request whose routing forwarding has been revoked) Poll_req_q, and compare it with the target value Val_obj_q of the corresponding processing kernel 10_q carried in each delayed query request Poll_req_q.
[0100] Therefore, in the first device embodiment of this application, the routing crossover switch 30 can generate indication information cmp or cmp_q for each corresponding processing kernel 10_p or 10_q that initiates a query request Poll_req_p or Poll_req_q among the multiple processing kernels 10_1 to 10_m: indicating whether the current value Val_atm of the specified data 20 is the same as the target value Val_obj_p or Val_obj_q of the processing kernel 10_p or 10_q.
[0101] For example, in the first device embodiment of this application, the routing crossover switch 30 may be further configured to: in response to the generation of indication information cmp_p or cmp_q of the corresponding processing kernel 10_p or 10_q for any retained or delayed query request Poll_req_p or Poll_req_q, delete the retained or delayed query request Poll_req_p or Poll_req_q, so as to accurately perform the detection for determining whether to route forward for subsequent query requests.
[0102] For example, in the first device embodiment of this application, the routing crossover switch 30 can be further configured to maintain a first request list Tab_31 and a second request list Tab_32, wherein the first request list Tab_31 is used to cache the retained query request Poll_req_p, and the second request list Tab_32 is used to cache the delayed query request Poll_req_q.
[0103] For example, in the first device embodiment of this application, if the routing cross switch 30 further maintains a first request list Tab_31 and a second request list Tab_32, then the routing cross switch 30 can be specifically configured as follows:
[0104] By detecting the first request list Tab_31, it is determined whether a query request for the specified data 20 has been routed to the data cache unit 50 and whether the corresponding query response has not yet been received from the data cache unit 50;
[0105] By examining the second request list Tab_32, it is determined whether there are any pending query requests; and,
[0106] The deletion of the query request Poll_req_p or Poll_req_q is achieved by clearing the query requests Poll_req_p or Poll_req_q in the first request list Tab_31 and the second request list Tab_32.
[0107] For example, in the first device embodiment of this application, if the routing cross switch 30 further maintains a first request list Tab_31 and a second request list Tab_32, then the routing cross switch 30 can be further configured as follows:
[0108] When any one of the multiple processing kernels 10_q from 10_1 to 10_m initiates a query request Poll_req_q for a specified data 20 in the data cache unit 50, if a query request for the specified data 20 has already been routed to the data cache unit 50 and no corresponding query response has been received from the data cache unit 50, then it is checked whether the second request list Tab_32 is full.
[0109] If the second request list Tab_32 is currently full, the query request Poll_req_q is discarded, and a request failure message is sent to the corresponding processing kernel 10_q that generated the query request Poll_req_q, so that the processing kernel 10_q waits for a certain period of time before re-initiating the query request Poll_req_q.
[0110] For example, in the first device embodiment of this application, the routing crossover switch 30 may be further configured to: provide the indication information cmp or cmp_q of the corresponding processing kernel 10_p or 10_q of any retained or delayed query request Poll_req_p or Poll_req_q, together with the current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p or Poll_rsp_q, to the corresponding processing kernel 10_p or 10_q of the retained or delayed query request Poll_req_p or Poll_req_q.
[0111] Exemplarily, in the first device embodiment of this application, the routing crossover switch 30 can be further configured as follows:
[0112] The current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p is filled into the corresponding empty field of the retained query request (e.g., the query request retained in the first request list Tab_31) Poll_req_p. Furthermore, the retained (e.g., the query request retained in the first request list Tab_31) query request Poll_req_p with the current value Val_atm of the specified data 20 filled in, along with the indication information cmp generated by the corresponding processing kernel 10_p for the query request Poll_req_p, is returned to the corresponding processing kernel 10_p of the query request Poll_req_p; and...
[0113] The current value Val_atm of the specified data 20 of the retained query request (e.g., the query request retained in the first request list Tab_31) Poll_req_p is filled (e.g., broadcast) into the corresponding empty field of each retained query request (e.g., the query request retained in the second request list Tab_32) Poll_req_q. The retained query request Poll_req_q (e.g., the query request retained in the second request list Tab_32) that has been filled with the current value Val_atm of the specified data 20 is returned to the corresponding processing kernel 10_q of the query request Poll_req_q, together with the indication information cmp_q generated for the corresponding processing kernel 10_q of the query request Poll_req_q.
[0114] For example, in the first device embodiment of this application, the comparison function for generating indication information cmp_p or cmp_q can be implemented by adding a comparison engine to the routing cross switch 30.
[0115] For example, in the first device embodiment of this application, the data caching unit 50 may further include in its query response Poll_rsp_p, which generates a corresponding query response Poll_req_p for the route-forwarded query request, whether the current value Val_atm of the specified data 20 is the same as the target value Val_obj_p of the corresponding processing kernel 10_p, as indicated by the information cmp_p. In this case, the route crossover switch 30 may be further configured as follows:
[0116] When the data buffer unit 50 receives a query request Poll_req_p for routing forwarding and generates a corresponding query response Poll_rsp_p, the received query response Poll_rsp_p or the indication information cmp carried in the query response Poll_rsp_p is provided to the corresponding processing kernel 10_p of the query request Poll_req_p. That is, the routing cross switch 30 can directly forward the query response Poll_rsp_p or the local information in the query response Poll_rsp_p to the corresponding processing kernel 10_p. Furthermore, in the case of directly providing the query response Poll_rsp_p, it can be considered that the indication information cmp carried in the received query response Poll_rsp_p and the current value Val_atm of the specified data 20 carried in the query response Poll_rsp_p are provided together to the corresponding processing kernel 10_p of the query request Poll_req_p.
[0117] The current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p is compared with the target value Val_obj_q of the corresponding processing kernel 10_q carried in each delayed query request Poll_req_q. This comparison generates an indication message cmp_q for the corresponding processing kernel 10_q of the delayed query request Poll_req_q, indicating whether the current value Val_atm of the specified data 20 is the same as the target value Val_obj_q of the processing kernel 10_q. In other words, the routing crossover switch 30 can generate the corresponding indication message cmp_q for the query request Poll_req_q whose route forwarding has been revoked simply by performing the comparison. Alternatively, the indication message cmp_q of the corresponding processing kernel 10_q of any delayed query request Poll_req_q can be provided together with the current value Val_atm of the specified data 20 carried in the received query response Poll_rsp_p to the corresponding processing kernel 10_q of the query request Poll_req_q.
[0118] For example, in the first device embodiment of this application, the query response Poll_rsp_p generated by the data caching unit 50 may not include the indication information cmp_p. Furthermore, the routing crossover switch 30 may not need to perform the comparison for generating the indication information cmp_p or cmp_q. Instead, the routing crossover switch 30 forwards the current value Val_atm of the specified data 20 carried in the query response Poll_rsp_p to the corresponding processing kernel 10_p or 10_q that initiated the query request Poll_req_p or Poll_req_q. Thus, the processing kernel 10_p or 10_q can determine on its own whether the current value Val_atm of the specified data 20 is the same as the target value Val_obj_p or Val_obj_q of the processing kernel 10_p or 10_q.
[0119] Figure 6 This is a schematic diagram illustrating the principle of a second device embodiment for reducing on-chip bandwidth usage by the processor in this application. Figure 6 The second device embodiment shown can reduce the generation of query responses (i.e., "not ready" query responses) that cause the processing kernel 10_p to continue initiating query requests by improving the data cache unit 50, and thereby indirectly reduce the number of query requests routed to the data cache unit 50 via the on-chip network 60.
[0120] Please see Figure 6 In the second device embodiment of this application, the data cache unit 50 can be configured as follows:
[0121] When a query request Poll_req_p for specified data 20 is received from the routing cross switch 30, which routes the request to any processing kernel 10_p among the multiple processing kernels 10_1 to 10_m, it is checked whether the current value of the specified data 20 is the same as the target value Val_obj_p of the processing kernel 10_p; for example, this check can be performed by the comparison engine E_50 built into the data cache unit 50.
[0122] If (i.e., if the current value Val_atm of the specified data 20 is the same as the target value Val_obj_p of the processing kernel 10_p), then the query request Poll_req_p initiated by the processing kernel 10_p generates a corresponding query response Poll_rsp_p to the routing cross switch 30, and the query response Poll_rsp_p is a valid response (i.e., a "ready" query response).
[0123] If not (i.e., if the current value Val_atm of specified data 20 is different from the target value Val_obj_p of processing kernel 10_p), then it is determined that a corresponding query response will be generated for the query request Poll_req_p initiated by processing kernel 10_p to the routing crossover switch 30. To prevent processing kernel 10_p from continuing to initiate query requests Poll_req_p with unqualified query responses (i.e., "not ready" responses), the generation of a corresponding query response for the query request Poll_req_p initiated by processing kernel 10_p to the routing crossover switch 30 is delayed until: the value Val_atm of specified data 20 changes to be the same as the target value Val_obj_p of processing kernel 10_p within a preset time period, or the preset time period expires if the value Val_atm of specified data 20 remains different from the target value Val_obj_p of processing kernel 10_p. For example, whether the preset time period has expired can be determined using a timer T_50 in the data buffer unit 50.
[0124] For example, in the second device embodiment of this application, if the data caching unit 50 generates a corresponding query response Poll_rsp_p to the routing cross switch 30 for a query request Poll_req_p initiated by any processing kernel 10_p, and the response is delayed until the value Val_atm of the specified data 20 changes to be the same as the target value Val_obj_p of the processing kernel 10_p within a preset time period, then the query response Poll_rsp_p generated at this time is a valid response (i.e., a "ready" query response); if the data caching unit 50 generates a corresponding query response Poll_rsp_p to the routing cross switch 30 for a query request Poll_req_p initiated by any processing kernel 10_p, and the response is delayed until the preset time period expires, then the query response Poll_rsp_p generated at this time is a substandard query response (i.e., a "not ready" response).
[0125] Based on the second device embodiment described above in this application, the data cache unit 50 where the specified data 20 is located can reduce the generation of query responses (i.e., "not ready" query responses) that cause the processing kernel 10_p to continue initiating query requests. Therefore, it can not only reduce the occupation of the processor's on-chip bandwidth (e.g., the bandwidth of the on-chip network 60) by query responses, but also indirectly reduce the query requests that occupy the processor's on-chip bandwidth. Thus, the second device embodiment described above in this application can suppress the occupation of the processor's on-chip bandwidth by query requests and query responses used to achieve kernel synchronization from the source of query response generation, thereby helping to reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0126] For example, in the second device embodiment of this application, the query request Poll_req_p initiated by any processing kernel 10_p among the plurality of processing kernels 10_1~10_m may carry the target value Val_obj_p of the processing kernel 10_p, and the data cache unit 50 may be further configured as follows:
[0127] If the current value Val_atm of the specified data 20 is detected to be different from the target value Val_obj_p of the corresponding processing kernel 10_p that initiated the received query request Poll_req_p, then the received query request Poll_req_p will be retained.
[0128] Before the preset time expires, perform at least one comparison between the current value Val_atm of the specified data 20 and the target value Val_obj_p in the retained query request Poll_req_p, until the current value Val_atm of the specified data 20 becomes the same as the target value Val_obj_p in the retained query request Poll_req_p, or the preset time expires.
[0129] For example, in the second device embodiment of this application, the data caching unit 50 can be specifically configured as follows:
[0130] In response to each change in the value Val_atm of specified data 20 before the preset time expires (e.g., due to changes caused by atomic operations initiated by other processing kernels 10_q among multiple processing kernels 10_1~10_m), a comparison is performed between the current value Val_atm of specified data 20 and the target value Val_obj_p in the retained query request Poll_req_p, until the current value Val_atm of specified data 20 becomes the same as the target value Val_obj_p in the retained query request Poll_req_p, or the preset time expires.
[0131] Figure 7 This is a schematic diagram illustrating an example of a second device embodiment for reducing on-chip bandwidth usage by the processor in this application. Please refer to... Figure 7 In the second device embodiment of this application, the data cache unit 50 may include, in addition to the comparison engine E_50 and the timer T_50, a hit-miss check pipeline P_50, a schedule queue Q_50, an arithmetic and logic unit (ALU) A_50, and a cache C_50 using a storage medium such as random access memory (RAM).
[0132] For example, in the second device embodiment of this application, the hit detection pipeline P_50 can be used to detect whether the query request Poll_req_p received from the routing cross switch 30 through the on-chip network 60 hits the cache C_50, that is, whether the specified data 20 queried by the query request Poll_req_p is currently stored in the cache C_50. Specifically, as described above, the query request Poll_req_p can carry address information Addr representing the storage address of the specified data 20, and the result of the hit detection can be determined using this address information Addr. If it does not hit the cache C_50, it indicates that the specified data 20 may currently be stored in the main memory 90, and the specified data 20 in the main memory 90 can be loaded into the planning queue Q_50 and passed to the cache C_50 through the planning queue Q_50 at the same time as the query request Poll_req_p is sent to the planning queue Q_50.
[0133] For example, in the second device embodiment of this application, the query request Poll_req_p initiated by any processing kernel 10_p among the plurality of processing kernels 10_1 to 10_m may include, in addition to carrying address information Addr and target value Val_obj_p, the kernel identifier Cord_id of the corresponding processing kernel 10_p that initiated the query request Poll_req_p. It is understood that the scheme of carrying the kernel identifier Cord_id in the query request Poll_req_p is also applicable to the first device embodiment.
[0134] For example, in the second device embodiment of this application, the arithmetic logic unit A_50 can be used to execute atomic operations initiated by any of the processing kernels 10_p among the multiple processing kernels 10_1 to 10_m, that is, to perform atomic operations on specified data 20 in cache C_50. Furthermore, the specified data 20 in cache C_50 that has undergone atomic operations by the arithmetic logic unit A_50 can be synchronized to main memory 90 and can be deleted from cache C_50 when needed.
[0135] For example, in the second device embodiment of this application, the data caching unit 50 can be specifically configured to: if the comparison engine E_50 detects that the current value Val_atm of the specified data 20 (e.g., the current value Val_atm of the specified data 20 currently stored in the cache C_50) is different from the target value Val_obj_p of the corresponding processing kernel 10_p that initiated the received query request Poll_req_p, then the received query request Poll_req_p is stored in the comparison engine E_50.
[0136] For example, in the second device embodiment of this application, for the retained query request Poll_req_p, the data cache unit 50 (i.e., the comparison engine E_50) may, in response to the change in the specified data 20 caused by the atomic operation performed by the arithmetic logic unit A_50, perform a comparison between the current value Val_atm of the specified data 20 (e.g., the current value Val_atm of the specified data 20 currently output by the arithmetic logic unit A_50) and the target value Val_obj_p in the retained query request Poll_req_p.
[0137] For example, in the second device embodiment of this application, the query request Poll_req_p initiated by any of the multiple processing kernels 10_p 10_1 to 10_m may initially carry, or be added while being retained, a timing field Timer. The timing field Timer is used to characterize whether the delay duration of the query response Poll_rsp_p corresponding to the query request Poll_req_p has reached a preset duration. For example, timer T_50 may set the timing field Timer from a first value indicating no timeout to a second value indicating timeout when the delay duration of the query response Poll_rsp_p corresponding to the query request Poll_req_p reaches the preset duration (i.e., when the preset duration is exhausted). Furthermore, the jump of the timing field Timer from the first value to the second value will trigger the data cache unit 50 (i.e., the comparison engine E_50) to generate the corresponding query response Poll_rsp_p.
[0138] For example, in the second device embodiment of this application, the query response Poll_rsp_p generated by the data caching unit 50 (whether generated immediately or delayed) may carry at least one of the indication information cmp_p described above and the current value Val_atm of the specified data 20.
[0139] Figure 8 This is a schematic diagram illustrating the principle of a third device embodiment for reducing on-chip bandwidth usage by the processor in this application. Figure 8 The third device embodiment shown can reduce query requests routed to the data cache unit 50 via the on-chip network 60 by improving the routing crossover switch 30, and thereby indirectly reduce query responses generated by the data cache unit 50 and transmitted to the routing crossover switch 30 via the on-chip network 60; moreover, as Figure 8 The third device embodiment shown can also reduce the generation of query responses (i.e., "not ready" query responses) that cause the processing kernel 10_p to continue initiating query requests by improving the data cache unit 50, and thereby indirectly reduce the number of query requests routed to the data cache unit 50 through the on-chip network 60.
[0140] That is, such as Figure 8 The third device embodiment shown may include, for example: Figure 4 The first device embodiment shown and as such Figure 6 The combination scheme of the second device embodiment shown. Therefore, with... Figure 4 The first device embodiment shown and as such Figure 6 The details of the second device embodiment shown will not be repeated here.
[0141] In addition, in such Figure 8In the third device embodiment shown, the query response Poll_rsp_p generated by the data caching unit 50 (whether generated immediately or delayed) must at least carry the current value Val_atm of the specified data 20, and as an optional scheme, it may further carry the indication information cmp described above.
[0142] Based on the third device embodiment described above in this application, query requests initiated by multiple processing cores 10_1 to 10_m in the processor for the same specified data 20 can be selectively routed and forwarded to the data cache unit 50 where the specified data 20 is located. Therefore, this not only reduces the occupation of the processor's on-chip bandwidth (e.g., the bandwidth of the on-chip network 60) by query requests, but also indirectly reduces the number of query responses occupying the processor's on-chip bandwidth. In this case, the data cache unit 50 where the specified data 20 is located can also reduce the generation of query responses that prompt the processing core 10_p to continue initiating query requests. Therefore, this not only reduces the occupation of the processor's on-chip bandwidth (e.g., the bandwidth of the on-chip network 60) by query responses, but also indirectly reduces the number of query requests occupying the processor's on-chip bandwidth. Thus, the third device embodiment of this application can suppress the occupation of the processor's on-chip bandwidth by query requests and query responses used for kernel synchronization from the source of query request routing and the source of query response generation. Therefore, compared to each of the first and second device embodiments, it can further reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0143] For example, in any embodiment of this application, the query request Poll_req_p initiated by any of the multiple processing kernels 10_p among the processing kernels 10_1 to 10_m can adopt an extended encoding other than the existing instruction encoding (hint). Thus, the embodiments of this application can be applied to any processor through the extension of instruction encoding without making special improvements to the overall software architecture.
[0144] In another embodiment of this application, a kernel synchronization method for a processor is also provided. The processor to which this kernel synchronization method is applied may include multiple processing kernels, and each of the multiple processing kernels may be configured to: periodically initiate a query request to a routing cross switch for specified data in a data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing kernel.
[0145] Figure 9 This is a flowchart illustrating a first embodiment of a kernel synchronization method for a processor according to an embodiment of this application. Figure 9In the first method embodiment shown, the kernel synchronization method for the processor may include the following steps performed by a routing crossbar switch:
[0146] S910: When any processing kernel among multiple processing kernels initiates a query request for specified data, it checks whether a query request for the specified data has already been routed to the data cache unit and whether a corresponding query response has not yet been received from the data cache unit.
[0147] If not, that is, if no query request for the specified data has been routed to the data cache unit and no corresponding query response has been received from the data cache unit, then proceed to S930;
[0148] If so, that is, if a query request for the specified data has been routed to the data cache unit and no corresponding query response has been received from the data cache unit, then proceed to S950;
[0149] S930: The currently initiated query request is routed to the data cache unit, for example, via the on-chip network, and then jumps to S970;
[0150] S950: Delay the query request by canceling the routing forwarding of the currently initiated query request, and then jump to S970;
[0151] S970: When the data cache unit generates a corresponding query response for a query request that has already been routed and forwarded, it checks whether there are any pending query requests.
[0152] If so, that is, if there are pending query requests waiting for a response, then proceed to S990:
[0153] If not, that is, if there are no pending query requests waiting for a query response, then the current iteration of the S910~S990 loop process will end directly.
[0154] S990: Generate a corresponding query response based on the received query response being a pending query request, and then end the current iteration of the loop process in S910~S990.
[0155] Based on the first method embodiment described above in this application, query requests initiated by multiple processing cores in the processor for the same specified data can be selectively routed and forwarded to the data cache unit where the specified data resides. Therefore, this not only reduces the on-chip bandwidth (e.g., bandwidth of the on-chip network) occupied by query requests, but also indirectly reduces the on-chip bandwidth occupied by query responses. Thus, the first method embodiment described above can suppress the on-chip bandwidth occupied by query requests and responses used for kernel synchronization from the source of query request routing, thereby helping to reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0156] For example, in the first method embodiment of this application, the query request initiated by each of the plurality of processing kernels may carry the target value of that processing kernel, and the corresponding query response generated by the data caching unit for the routed query request may carry the current value of the specified data. In this case:
[0157] The kernel synchronization method for the processor may further include the following steps performed by the routing cross switch (e.g., the following steps performed in association with the S930): forwarding the data to the data cache unit and waiting for the data cache unit to generate a corresponding query request and retaining it;
[0158] The kernel synchronization method for the processor may further include the following steps performed by the routing cross switch (e.g., the following steps performed in association with S970): when a corresponding query response is generated by the data cache unit for a query request forwarded by the routing, the current value of the specified data carried in the received query response is compared with the target value of the corresponding processing kernel carried in each retained or delayed query request, so as to generate indication information for the corresponding processing kernel indicating whether the current value of the specified data is the same as the target value of the processing kernel; and, in response to the generation of the indication information of the corresponding processing kernel for any retained or delayed query request, the query request is deleted.
[0159] For example, in the first method embodiment of this application, the kernel synchronization method for the processor may further include the following steps performed by the routing cross switch (e.g., the following steps performed in association with S970): providing the indication information of the corresponding processing kernel of any query request that is retained or delayed, together with the current value of the specified data carried in the received query response, to the corresponding processing kernel of the query request.
[0160] For example, in the first method embodiment of this application, the kernel synchronization method for the processor may further include the following steps performed by the routing crossover switch (e.g., the following steps performed as needed during the execution of the S910~S990 loop): maintaining a first request list and a second request list, the first request list being used to cache query requests retained due to the execution of routing forwarding, and the second request list being used to cache query requests held up due to the cancellation of routing forwarding.
[0161] For example, in the first method embodiment of this application, if the routing cross switch further maintains a first request list and a second request list, then S910 may include: determining whether a query request for specified data has been routed to the data cache unit by detecting the first request list, and waiting for the data cache unit to generate a corresponding query response; S970 may include: determining whether there are any pending query requests by detecting the second request list; and after S970, the query request can be deleted by clearing the query requests in the first request list and the second request list.
[0162] For example, in the first method embodiment of this application, if the routing cross switch further maintains the first request list and the second request list, the kernel synchronization method for the processor may further include the following steps performed by the routing cross switch (e.g., the following steps performed before executing S950): detecting whether the second request list is full; if the second request list is currently full, discarding the query request and generating a request failure prompt to the corresponding processing kernel that generated the query request, and then directly ending the current loop in the loop process of executing S910~S990 without executing S950.
[0163] For example, in the first method embodiment of this application, the kernel synchronization method for the processor may further include the following steps performed by the routing crossbar switch (e.g., steps associated with the S970):
[0164] The current value of the specified data carried in the received query response is filled into the corresponding empty field of the retained (e.g., retained in the first request list) query request, and the retained (e.g., retained in the first request list) query request with the current value of the specified data filled in, together with the indication information generated for the corresponding processing kernel of the query request, is returned to the corresponding processing kernel of the query request.
[0165] The current value of the specified data that was filled into the retained (e.g., retained in the first request list) query request is filled into the corresponding empty field of the retained (e.g., retained in the second request list) query request (e.g., filled in via broadcast) query request (e.g., retained in the second request list) query request that has been filled with the current value of the specified data, together with the indication information generated for the corresponding processing kernel of the query request, is returned to the corresponding processing kernel of the query request.
[0166] For example, in the first method embodiment of this application, the data caching unit generates a corresponding query response for a routed query request, which, in addition to carrying the current value of the specified data, may further carry indication information indicating whether the current value of the specified data is the same as the target value carried in the query request routed to the data caching unit. In this case, the kernel synchronization method for the processor may further include the following steps performed by the routing crossover switch (e.g., steps associated with S970):
[0167] When the data caching unit generates a corresponding query response for the routed query request, the received query response or the indication information carried in the query response is provided to the corresponding processing kernel of the query request. That is, the query response or the local information in the query response can be directly forwarded to the corresponding processing kernel. In the case of directly providing the query response, it can be considered that the indication information carried in the received query response and the current value of the specified data carried in the query response are provided to the corresponding processing kernel of the query request.
[0168] The current value of the specified data carried in the received query response is compared with the target value of the corresponding processing kernel carried in each pending query request. This comparison generates an indication for the corresponding processing kernel of the pending query request indicating whether the current value of the specified data is the same as the target value of the processing kernel. In other words, the corresponding indication can be generated for the query request whose route forwarding has been revoked simply by performing the comparison. Alternatively, the indication information of the corresponding processing kernel of any pending query request can be provided to the corresponding processing kernel of the query request together with the current value of the specified data carried in the received query response.
[0169] For example, in the first method embodiment of this application, the query response generated by the data caching unit may not include indication information, and the routing cross switch may not need to perform the comparison for generating indication information, but instead forward the current value of the specified data carried in the query response to the corresponding processing kernel that initiated the query request, so that the processing kernel can determine whether the current value of the specified data is the same as the target value of the processing kernel.
[0170] Figure 10This is a flowchart illustrating a second method embodiment of the kernel synchronization method for a processor according to this application. Figure 10 In the second method embodiment shown, the kernel synchronization method for the processor may include the following steps performed by the data cache unit:
[0171] S1010: When a query request for specified data is received from a routing crossover switch that routes and forwards the data to any of the multiple processing kernels, check whether the current value of the specified data is the same as the target value of the processing kernel.
[0172] If so, that is, if the current value of the specified data is the same as the target value of the processing kernel, then jump to S1050;
[0173] If not, that is, if the current value of the specified data is different from the target value of the processing kernel, then jump to S1030;
[0174] S1030: Delay the generation of a corresponding query response to the routing cross switch for the query request initiated by the processing kernel until the following conditions are met before jumping to S1050: The value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data continues to be different from the target value of the processing kernel.
[0175] S1050: Generates a corresponding query response to the routing cross switch for the query request initiated by the processing kernel, and then ends the response to a query request.
[0176] Based on the second method embodiment described above in this application, the data cache unit where the specified data resides can reduce the generation of query responses (i.e., "not ready" query responses) that prompt the processing kernel to continue initiating query requests. Therefore, it can not only reduce the occupation of the processor's on-chip bandwidth (e.g., the bandwidth of the on-chip network) by query responses, but also indirectly reduce the query requests that occupy the processor's on-chip bandwidth. Thus, the second method embodiment described above in this application can suppress the occupation of the processor's on-chip bandwidth by query requests and query responses used to achieve kernel synchronization from the source of query response generation, thereby helping to reduce the on-chip bandwidth occupied by kernel synchronization in the processor.
[0177] For example, in the second method embodiment of this application, the query request initiated by each of the plurality of processing kernels may carry the target value of that processing kernel. In this case, the kernel synchronization method for the processor may further include the following steps performed by the data cache unit (e.g., steps performed in association with S1030):
[0178] If the current value of the specified data is detected to be different from the target value of the corresponding processing kernel that initiated the received query request, then the received query request will be retained.
[0179] Before the preset time expires, perform at least one comparison between the current value of the specified data and the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0180] For example, in the second method embodiment of this application, the process of comparing the current value of the specified data with the target value in the retained query request at least once may include: in response to each change in the value of the specified data before the preset time expires (e.g., a change caused by the execution of an atomic operation), performing a comparison of the current value of the specified data with the target value in the retained query request until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
[0181] For example, in the second method embodiment of this application, the data caching unit may carry at least one of the indication information described above and the current value of the specified data in the corresponding query response generated by the received query request.
[0182] In the third method embodiment of this application, as Figure 9 The steps in the first method embodiment shown, and as... Figure 10 The steps in the second method embodiment shown can be further extended steps to each other, and can be executed concurrently by the routing cross switch and the data buffer unit, respectively.
[0183] It is understood that, in the embodiments of this application, the various parts described by example may be related by an "and / or" relationship. In this document, "and / or" means that the contexts connected by it may be a common "and" relationship or an alternative "or" relationship. Therefore, the various parts having an "and / or" relationship can be understood to include different combinations of situations where the "and / or" between each pair of parts represents a common "and" relationship or an alternative "or" relationship, and such combinations of different situations can be considered substantially equivalent to the scope of "at least one of the parts".
[0184] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A processor, characterized in that, It includes multiple processing kernels, each of which is configured to periodically initiate a query request to the routing cross switch for specified data in the data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing kernel. The routing crossover switch is configured as follows: When any of the plurality of processing kernels initiates a query request for the specified data, it is detected whether a query request for the specified data has already been routed to the data cache unit and whether the data cache unit has not yet generated a corresponding query response; If not, the query request is routed and forwarded to the data cache unit; If so, the query request will be deferred by canceling the routing forwarding of the query request; When the data caching unit generates a corresponding query response for a routed query request, it checks whether there are any pending query requests; if so, it generates a corresponding query response based on the received query response being a pending query request. The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
2. The processor according to claim 1, characterized in that, The query request initiated by each of the plurality of processing kernels carries the target value of that processing kernel, and the corresponding query response generated by the data caching unit for the routed query request carries the current value of the specified data. The routing crossover switch is further configured as follows: The data that has been routed to the data cache unit and is waiting for the data cache unit to generate a corresponding query request will be retained. When the data caching unit generates a corresponding query response for a routed query request, it compares the current value of the specified data carried in the received query response with the target value of the corresponding processing kernel carried in each retained or delayed query request, and generates an indication message for the corresponding processing kernel indicating whether the current value of the specified data is the same as the target value of the processing kernel. In response to the generation of the indication information by the corresponding processing kernel for any retained or delayed query request, the query request is deleted.
3. The processor according to claim 2, characterized in that, The routing crossover switch is further configured to provide the indication information of the corresponding processing kernel of any retained or delayed query request, together with the current value of the specified data carried in the received query response, to the corresponding processing kernel of the query request.
4. The processor according to claim 2, characterized in that, The routing crossover switch is further configured to maintain a first request list and a second request list, wherein the first request list is used to cache retained query requests and the second request list is used to cache delayed query requests. The routing crossover switch is specifically configured as follows: By detecting the first request list, it is determined whether a query request for the specified data has been routed to the data cache unit, and the system waits for the data cache unit to generate a corresponding query response. By inspecting the second request list, it can be determined whether there are any pending query requests; The deletion of a query request is achieved by clearing the query requests from the first request list and the second request list.
5. The processor according to claim 4, characterized in that, The routing crossover switch is further configured as follows: The current value of the specified data carried in the received query response is filled into the corresponding empty field of the query request in the first request list. The query request in the first request list that has been filled with the current value of the specified data, together with the indication information generated by the corresponding processing kernel of the query request, is returned to the corresponding processing kernel of the query request. The current value of the specified data in the query request in the first request list is filled into the corresponding empty field of the query request in the second request list. The query request in the second request list that has been filled with the current value of the specified data, together with the indication information generated by the corresponding processing kernel of the query request, is returned to the corresponding processing kernel of the query request.
6. The processor according to claim 1, characterized in that, Each of the plurality of processing kernels initiates a query request carrying the target value of that processing kernel. Furthermore, the data caching unit generates a corresponding query response for the routed query request, which carries the current value of the specified data and an indication of whether the current value of the specified data is the same as the target value carried in the query request routed to the data caching unit. The routing crossover switch is further configured as follows: When the data caching unit generates a corresponding query response for a routed query request, the indication information carried in the received query response is provided to the corresponding processing kernel of the query request. The current value of the specified data carried in the received query response is compared with the target value of the corresponding processing kernel carried in each pending query request, so as to generate an indication message for the corresponding processing kernel of the pending query request indicating whether the current value of the specified data is the same as the target value of the processing kernel. In response to the generation of the indication information by the corresponding processing kernel for any pending query request, the query request is deleted.
7. The processor according to claim 6, characterized in that, The routing crossover switch is further configured as follows: The indication information carried in the received query response, together with the current value of the specified data carried in the query response, is provided to the corresponding processing kernel of the query request; The indication information of the corresponding processing kernel for any pending query request is provided to the corresponding processing kernel for that query request, together with the current value of the specified data carried in the received query response.
8. The processor according to any one of claims 1 to 7, characterized in that, The data caching unit is configured as follows: When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel. If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch; If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data continues to be different from the target value of the processing kernel.
9. A processor, characterized in that, It includes multiple processing kernels, each of which is configured to periodically initiate a query request to the routing cross switch for specified data in the data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing kernel. The data caching unit is configured as follows: When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel. If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch; If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data is continuously different from the target value of the processing kernel; The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
10. The processor according to claim 9, characterized in that, The query request initiated by any of the multiple processing kernels carries the target value of that processing kernel. The data caching unit is further configured as follows: If the current value of the specified data is detected to be different from the target value of the corresponding processing kernel that initiated the received query request, then the received query request will be retained. Before the preset time expires, at least one comparison is performed between the current value of the specified data and the target value in the retained query request, until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
11. The processor according to claim 10, characterized in that, The data caching unit is specifically configured as follows: In response to each change in the value of the specified data before the preset time expires, a comparison is performed between the current value of the specified data and the target value in the retained query request until the current value of the specified data is the same as the target value in the retained query request, or the preset time expires.
12. The processor according to any one of claims 9 to 11, characterized in that, The data caching unit generates a query response for a received query request that carries at least one of the following: Indication information used to characterize whether the current value of the specified data is the same as the target value carried in the query request; and The current value of the specified data.
13. A kernel synchronization method for a processor, characterized in that, The processor includes multiple processing cores, each of which is configured to periodically initiate a query request to the routing cross switch for specified data in the data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing core. The kernel synchronization method includes the following steps performed by the routing cross switch: When any of the plurality of processing kernels initiates a query request for the specified data, it is detected whether a query request for the specified data has already been routed to the data cache unit and whether the data cache unit has not yet generated a corresponding query response; If not, the query request is routed and forwarded to the data cache unit; If so, the query request will be deferred by canceling the routing forwarding of the query request; When the data caching unit generates a corresponding query response for a routed query request, it checks whether there are any pending query requests; if so, it generates a corresponding query response based on the received query response being a pending query request. The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
14. The kernel synchronization method according to claim 13, characterized in that, The kernel synchronization method further includes the following steps performed by the data caching unit: When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel. If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch; If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data continues to be different from the target value of the processing kernel.
15. A kernel synchronization method for a processor, characterized in that, The processor includes multiple processing cores, each of which is configured to periodically initiate a query request to the routing cross switch for specified data in the data cache unit until it is determined that the current value of the specified data is the same as the target value of the processing core. The kernel synchronization method includes the following steps performed by the data cache unit: When a query request for the specified data is received from the routing crossover switch, which routes and forwards the request to any of the multiple processing kernels, it is checked whether the current value of the specified data is the same as the target value of the processing kernel. If so, then the query request initiated by the processing kernel will generate a corresponding query response to the routing cross switch; If not, the corresponding query response will be generated for the query request initiated by the processing kernel to the routing cross switch until: the value of the specified data changes to be the same as the target value of the processing kernel within a preset time period, or the preset time period is exhausted when the value of the specified data is continuously different from the target value of the processing kernel; The query response corresponding to any query request is used to: determine whether the current value of the specified data is the same as the target value of the processing kernel among the plurality of processing kernels; and the target value of each processing kernel among the plurality of processing kernels is used to characterize the synchronization condition of the processing kernel.
Citation Information
Patent Citations
Method, programmable logic device, system and apparatus for checking memory data
CN101377749A
Data storage structure of Flash memory and data manipulation mode thereof
CN102081577A
Control method and device for ensuring shared cache consistency of heterogeneous multi-core processor
CN115373877A
Thread synchronization across memory synchronization domains
CN115640139A
Memory access method and device, electronic equipment and readable storage medium
CN117271389A
Cited By
Artificial intelligence chip and operation method thereof, non-transient computer readable storage medium and electronic equipment
CN121681456A
Artificial intelligence chip and operation method thereof
CN121681457A
Artificial intelligence chip and operating method thereof
CN121681457B