Data synchronization method, device, electronic device and computer-readable storage medium
By using the coordinated work of the command processor and the scheduling unit in the graphics processor, data synchronization is directly performed within the hierarchical synchronization range, solving the problem of low synchronization efficiency between computing units and achieving efficient data synchronization operations.
Patent Information
- Application Number
- CN202510941129.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-09
AI Technical Summary
In the graphics processor, data synchronization operations between computing units need to be fed back to the upper host layer, resulting in long information transmission paths and low synchronization efficiency.
By commanding the processor to receive the task data packet and convert it into an operation data packet according to the barrier object arrival range information. The scheduling unit performs task execution processing based on the operation data packet, realizing data synchronization within the hierarchical synchronization range, and avoiding the synchronization information being fed back to the upper host layer.
Shorten the information feedback path, improve the efficiency of data synchronization, and ensure efficient data synchronization within a specified level.
Smart Images

Figure CN120429370B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data synchronization, and in particular to a data synchronization method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In a modern graphics processing unit (GPU), each compute unit (CU) is an independently executed computational processing unit in the GPU, with its own registers, cache, and execution resources. Different CUs usually cannot directly access each other's local memory or registers. To achieve larger-scale parallel processing, multiple CUs can form a block processing cluster (BPC). A GPU can include multiple BPCs, which can greatly improve the efficiency of data exchange and communication.
[0003] In the prior art, when the tasks performed by different CUs or BPCs have data dependencies, data synchronization operations are often required; however, in the process of existing data synchronization operations, the synchronization information between different CUs or BPCs often needs to be fed back to the upper host layer, and the host layer is used to analyze the relevant synchronization information for further scheduling or decision-making. The relevant synchronization information needs to pass through multiple different levels during the information transmission process, which will result in a longer information feedback path and lower synchronization efficiency. Summary of the Invention
[0004] The embodiments of the present disclosure provide a data synchronization method, device, electronic device, and computer-readable storage medium, which can avoid the problems of long information feedback paths and low synchronization efficiency.
[0005] According to one aspect of the present disclosure, a data synchronization method is provided, which is applied to a chip system. The chip system includes a command processor and multiple block processing clusters, each of which is data-connected to the command processor. Each of the block processing clusters includes a scheduling unit and multiple computing units, each of which is data-connected to the scheduling unit. The data synchronization method includes:
[0006] Receiving a task data packet based on the command processor, wherein the task data packet includes barrier object arrival range information, and the barrier object arrival range information is used to represent the hierarchical synchronization range of the chip system;
[0007] converting the task data packet into an operation data packet according to the barrier object arrival range information by the command processor;
[0008] The scheduling unit performs task execution processing according to the operation data packet, so that the block processing cluster performs data synchronization within the hierarchical synchronization range.
[0009] Optionally, converting the task data packet into an operation data packet according to the barrier object arrival range information by the command processor includes:
[0010] When the barrier object reach range information is first-level information, converting the task data packet into the operation data packet according to the first-level information by the command processor, wherein the first-level information represents synchronization between the command processor and the block processing cluster or synchronization between a plurality of the block processing clusters;
[0011] When the barrier object reach range information is second-level information, converting the task data packet into the operation data packet according to the second-level information by the command processor, wherein the second-level information represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster;
[0012] In a case where the barrier object reach range information is third-level information, the command processor converts the task data packet into the operation data packet according to the third-level information, wherein the third-level information represents synchronization within the computing unit.
[0013] Optionally, performing task execution processing according to the operation data packet by the scheduling unit includes:
[0014] In a case where the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet;
[0015] In a case where the operation data packet is a kernel loading packet, the scheduling unit performs task execution processing according to first barrier arrival mark information of the kernel loading packet;
[0016] In a case where the operation data packet is a data transport packet, the scheduling unit performs task execution processing according to the second barrier arrival mark information of the data transport packet.
[0017] Optionally, the operation data packet is obtained by converting the second-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including:
[0018] In a case where the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit receives the barrier synchronization packet and enters a waiting state;
[0019] When the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information, the scheduling unit initializes the value of the received barrier object, and when the barrier arrival information is received, counts the value of the barrier object. When a preset first comparison condition is met, the scheduling unit exits the waiting state.
[0020] Optionally, the operation data packet is obtained by converting the second-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including:
[0021] When the operation data packet is the kernel load packet and the first barrier arrival flag information of the kernel load packet indicates synchronization within the computing unit, the scheduling unit sends the first preset barrier arrival flag value to the corresponding computing unit so that the computing unit performs task execution processing;
[0022] When the operation data packet is the kernel load packet and the first barrier arrival mark information of the kernel load packet represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster, the scheduling unit divides and processes the workgroup sets, workgroup clusters, and workgroups in the block processing cluster; and when the execution of the divided workgroup clusters or the workgroup tasks is completed, the command scheduling subunit of the scheduling unit generates a barrier synchronization signal and sends the barrier synchronization signal and the first barrier arrival mark information to the task scheduling subunit of the scheduling unit in the block processing cluster.
[0023] Optionally, the operation data packet is obtained by converting the second-level information. When the operation data packet is a data transport packet, the scheduling unit performs task execution processing according to the second barrier arrival mark information of the data transport packet, including:
[0024] The command scheduling subunit of the scheduling unit sends the data transport packet to the task scheduling subunit of the scheduling unit;
[0025] The data replication module in the block processing cluster performs data transfer processing according to the data transfer packet, and when the data transfer is completed, performs a barrier arrival operation according to the second barrier arrival mark information, and sends a synchronization signal to the command processor.
[0026] Optionally, the operation data packet is obtained by converting the third-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including:
[0027] In a case where the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier wait information, the scheduling unit sends the barrier synchronization packet to the computing unit;
[0028] When the barrier arrival information is received, the task scheduling module of the computing unit counts the values of the barrier objects of the barrier synchronization packet until a preset second comparison condition is met.
[0029] Optionally, the operation data packet is obtained by converting the third-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including:
[0030] The task scheduling module of the computing unit records the first barrier arrival mark information;
[0031] When the kernel in the computing unit completes the corresponding task according to the first barrier arrival mark information, a subtraction operation is performed on the value of the barrier object corresponding to the kernel load package.
[0032] Optionally, the operation data packet is obtained by converting the second-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including:
[0033] The computing unit sends the barrier synchronization packet to the scheduling unit, wherein the operation type information of the barrier synchronization packet is barrier initialization information, and the scheduling unit initializes the value of the received barrier object;
[0034] The command scheduling subunit of the scheduling unit sends the barrier synchronization packet whose operation type information is the barrier initialization information to the task scheduling subunit of the scheduling unit;
[0035] The computing unit sends the barrier synchronization packet whose operation type information is barrier waiting information to the command scheduling subunit for storage, so that the command scheduling subunit enters a waiting state;
[0036] When the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit feeds back a barrier arrival signal to the command scheduling subunit, and the command scheduling subunit counts the value of the barrier object until a preset third comparison condition is met;
[0037] The command scheduling subunit clears the barrier synchronization packet whose operation type information is the barrier waiting information, so that the command scheduling subunit exits the waiting state.
[0038] Optionally, the operation data packet is obtained by converting the second-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including:
[0039] The command scheduling subunit of the scheduling unit sends a barrier synchronization signal to the task scheduling subunit of the scheduling unit according to the first barrier arrival flag information of the kernel loading package, wherein the barrier synchronization signal carries the barrier arrival flag information;
[0040] The command scheduling subunit divides the workgroup in the block processing cluster, and when the divided workgroup tasks are completed, the task scheduling subunit performs barrier arrival feedback processing on the task scheduling subunit according to the barrier arrival mark information, so that the task scheduling subunit feeds back a barrier synchronization signal to the command processor.
[0041] Optionally, the operation data packet is obtained by converting the third-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including:
[0042] The command scheduling sub-unit of the scheduling unit divides the work groups in the block processing cluster according to the first barrier arrival mark information of the kernel loading package, and when the execution of the divided work group tasks is completed, the command scheduling sub-unit of the scheduling unit performs barrier arrival feedback processing to the task scheduling sub-unit of the scheduling unit, so that the task scheduling sub-unit feeds back a barrier synchronization signal to the command processor.
[0043] According to one aspect of the present disclosure, an electronic device is proposed, characterized in that the electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program is executed by the processor to realize the data synchronization method described above.
[0044] According to one aspect of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium may store one or more programs. The one or more programs may be executed by one or more processors to implement the data synchronization method described above.
[0045] The present disclosure proposes a data synchronization method, device, electronic device and computer-readable storage medium, the method comprising: a command processor based on a chip system receives a task data packet, wherein the task data packet includes barrier object arrival range information, and the barrier object arrival range information is used to characterize the hierarchical synchronization range of the chip system; then the command processor converts the received task data packet into an operation data packet according to the barrier object arrival range information; then the scheduling unit in the block processing cluster performs task execution processing according to the operation data packet, thereby enabling the block processing cluster to perform data synchronization within the hierarchical synchronization range. In the present disclosure, barrier object arrival range information is provided in the task data packet sent down, and the hierarchical synchronization range of the chip system can be limited according to the barrier object arrival range information; subsequently, the task data packet is converted into an operation data packet, and the scheduling unit is used to perform task execution processing according to the converted operation data packet, so that the block processing cluster can synchronize data between the same layer units specified by the hierarchical synchronization range, and there is no need to feed back the relevant synchronization information to the upper host layer at any level during the data synchronization process of the chip system as in the past, so that the host layer can analyze and schedule the relevant synchronization information; through the above technical solution, during the data synchronization process of the chip system, the synchronization information is allowed to be transmitted only in the corresponding level, and does not need to be transmitted to the upper host layer for analysis and scheduling, which greatly shortens the information feedback path and improves the efficiency of data synchronization.
[0046] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present disclosure. The purposes and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are used to provide a further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation to the technical solution of the present disclosure.
[0048] Figure 1 is a system architecture diagram of a system applying the data synchronization method of an embodiment of the present disclosure;
[0049] Figure 2 This is a main flow chart of a data synchronization method according to an embodiment of the present disclosure;
[0050] Figure 3 yes Figure 2 A sub-flowchart of step S202;
[0051] Figure 4 yes Figure 2 A sub-flowchart of step S203;
[0052] Figure 5 yes Figure 4 A sub-flowchart of step S401;
[0053] Figure 6 yes Figure 4 A sub-flowchart of step S402;
[0054] Figure 7 yes Figure 4 A sub-flowchart of step S403;
[0055] Figure 8 yes Figure 4 Another sub-flowchart of step S401;
[0056] Figure 9 yes Figure 4 Another sub-flowchart of step S402;
[0057] Figure 10 yes Figure 4 A sub-flowchart of a specific embodiment of step S401;
[0058] Figure 11 yes Figure 4 A sub-flowchart of a specific embodiment of step S402;
[0059] Figure 12 yes Figure 4 A sub-flowchart of another specific embodiment of step S402;
[0060] Figure 13 is a signal transmission diagram of a data synchronization method according to a third specific embodiment of the present disclosure;
[0061] Figure 14 It is a structural diagram of an electronic device proposed according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not intended to limit the present disclosure.
[0063] Before further explaining the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are explained. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0064] Host: In a computer network, a host refers to the host device at the bottom layer of a network architecture. These host devices are the terminal nodes of the network, such as personal computers, servers, mobile devices, etc., which are connected to the network through a network interface to send and receive data. The host layer in the embodiment of the present disclosure may refer to a server, which may include a central processing unit (CPU), memory, storage devices, and network interfaces, etc. The CPU is the core component of computer hardware, responsible for executing program instructions, performing arithmetic and logical operations, and controlling the coordinated operation of other components of the computer. Host layer synchronization in the embodiment of the present disclosure is synchronization between different hosts.
[0065] Semihosting: Semihosting is a debugging mechanism commonly used in embedded system development. It allows code on the target device to communicate with the host running the debugger and use the host's input / output ports. The program on the target device triggers a debug interrupt by executing specific instructions. After the debugger captures the interrupt, it pauses the execution of the target device and reads the register status of the target device. The debugger forwards the target device's request to the host, which performs the corresponding operation. The host returns the operation result to the target device through the debugger, and the target device continues execution. In the disclosed embodiments, synchronization at the semihost layer refers to synchronization between different chips or between the host and the chip, and synchronization is achieved through synchronization data packets in the host memory, events, barrier objects, etc. The synchronization information is stored in the host's memory. During the synchronization operation, synchronization commands and instructions need to be sent to the command processor, and the synchronization operator is the command processor.
[0066] Chip: A chip usually refers to an integrated circuit, a miniature electronic device that integrates circuits on a tiny silicon wafer. Chips are widely used in various electronic devices, such as computers, mobile phones, and automobiles, to perform various functions such as computing, storage, and communication. A chip is a packaged bare die that can be used in actual electronic systems. A chip can include a command processor and multiple block processing modules, each of which is data-connected to the command processor.
[0067] Command Processor (CP): The command processor is the command processing unit in the chip, responsible for processing and executing various instructions or commands to ensure that the various modules within the chip can operate efficiently and orderly. In the disclosed embodiment, synchronization at the CP layer mainly refers to synchronization within the chip or between different block processing clusters. The synchronization information is stored in the memory of the command processor, and the synchronization operator is the command processor. The command processor may include a task packet cache, a parsing module, and a segmentation module. The task packet cache is used to store and process information sent from the host layer. The parsing module is used to parse and process the information stored in the task packet cache. The segmentation module is used to divide and process the task information parsed by the parsing module so as to send the relevant task information to the relevant block processing cluster for execution.
[0068] Block Processing Cluster (BPC): A processing cluster within a graphics processing unit (GPU) consisting of multiple compute units (CUs) that are physically adjacent within the BPC and can share certain resources, such as memory and synchronization mechanisms. The primary purpose of a BPC is to enable larger-scale parallel processing and exploit data locality. All threads within a BPC are scheduled for execution on different streaming multiprocessors within the same GPU, improving the efficiency of data exchange and communication. In the disclosed embodiment, a BPC may include a command scheduling unit, a task scheduling unit, a data replication module, and multiple compute units, all of which are data-connected to the command scheduling unit. Synchronization at the BPC level refers to synchronization within the BPC and between different compute units within the same BPC, and is achieved through the command scheduling unit and the task scheduling unit. The data replication module within a BPC can perform data transfer processing, for example, transferring data from one BPC to another.
[0069] Command Dispatch (CD): In a block processing cluster, the main function of the dispatch unit is to efficiently manage and allocate tasks, ensuring that each processing unit in the cluster can fully utilize resources while avoiding task backlogs or resource waste. In a block processing cluster, the dispatch unit is key to ensuring efficient task allocation and execution. It optimizes the cluster's resource utilization and performance through functions such as task reception, parsing, scheduling, distribution, and monitoring. In an embodiment of the present disclosure, the dispatch unit may include an operation packet cache, a parsing module, and a segmentation module. The operation packet cache is used to receive information sent by the CP, the parsing module is used to parse the information sent by the CP to obtain task information, and the segmentation module is used to divide the task information so that the corresponding tasks can be sent to the corresponding computing units for execution. It is worth noting that the dispatch unit in the embodiment of the present disclosure may include a command scheduling subunit and a task scheduling subunit. The command scheduling subunit is used to perform command scheduling processing, and the task scheduling subunit is used to perform task scheduling processing.
[0070] Compute Unit (CU): In the graphics processor architecture, a compute unit (CU) is the basic unit for executing computing tasks. When a workgroup runs on a graphics processor, it actually executes on a compute unit. A compute unit is the basic unit used to execute parallel computing tasks on a graphics processor. It contains a certain number of processing elements, which can execute multiple threads in parallel. A block processing cluster can include multiple compute units. In the embodiments of the present disclosure, CU-level synchronization refers to synchronization within the same CU, synchronization between different workgroups within the CU, or synchronization between different cores, and is implemented through data packets and cores during the synchronization process. A compute unit may include a workgroup cluster data cache, a synchronization engine, a splitting module, a task scheduling module, and multiple execution units. The workgroup cluster data cache is used to receive information sent by the command scheduling unit. The synchronization engine is used to parse and synchronize the information in the workgroup cluster data cache to obtain task information. The splitting module is used to split the task information and send the corresponding task information to the execution units for task execution.
[0071] Barrier Object: A barrier object is a synchronization mechanism, commonly used in multithreaded or concurrent programming, to control the execution order of multiple threads or processes, ensuring they execute synchronously at a certain point. The main function of a barrier object is to make a group of threads "wait" at a certain point until all threads reach this point, and then allow them to continue execution.
[0072] In the prior art, when the tasks performed by different CUs or BPCs have data dependencies, data synchronization operations are often required; however, during the data synchronization operation, the synchronization information between different CUs or BPCs often needs to be fed back to the upper host layer, which results in a longer information feedback path and lower synchronization efficiency.
[0073] Based on this, the present disclosure proposes a data synchronization method, device, electronic device and computer-readable storage medium, which can avoid a long information feedback path and low synchronization efficiency.
[0074] Description of the system architecture used in the embodiments of the present disclosure
[0075] Figure 1 1 is a diagram of the system architecture for executing the data synchronization method according to an embodiment of the present disclosure. The system architecture is a hierarchical structure including a host 100 and multiple chips 200. The multiple chips 200 are all data-connected to the host 100. Each chip 200 can receive task data packets issued by the host 100. It is worth noting that the diagram only shows an example of four chips 200, which does not mean that the system architecture can only include four chips 200. The number of chips 200 can also be 5, 6, 7, etc., which is not limited here. Each chip 200 can also include a command processor 300 and multiple block processing clusters 400. Each block processing cluster 400 is data-connected to the command processor 300. The command processor 300 can send relevant information to each block processing cluster 400 within the chip 200, so that the block processing cluster 400 can complete the corresponding task according to the information issued by the command processor 300. It is worth noting that the figure only shows three block processing clusters 400 as an example, which does not mean that the chip 200 can only include three block processing clusters 400. The number of block processing clusters 400 can also be 4, 6, 7, etc., which is not limited here.
[0076] It is worth noting that the command processor 300 includes a task data packet cache 310, a first parsing module 320 and a first splitting module 330, wherein the first parsing module 320 is represented in the figure as "parsing module 1", the first splitting module 330 is represented in the figure as "splitting module 1", and there is also a first synchronization engine 321 inside the first parsing module 320, and the first synchronization engine 321 is represented in the figure as "synchronization engine 1"; the task data packet cache 310 can be used to receive task data packets sent by the upper-level host 100, the first parsing module 320 can parse and process the task data packets in the task data packet cache 310 to obtain task information, and the first splitting module 330 can divide and process the task information parsed by the first parsing module 320 to determine that the corresponding task information can be sent to the corresponding block processing cluster 400, so as to use the corresponding block processing cluster 400 to complete the corresponding task.
[0077] It is worth noting that a block processing cluster 400 may include a scheduling unit 500, a data replication module 600, and multiple computing units 700, each of which is data-connected to the scheduling unit 500. It is worth noting that the figure only shows an example of three computing units 700, which does not mean that the block processing cluster 400 can only include three computing units 700. The number of computing units 700 can also be 5, 7, 8, etc., which is not limited here. The scheduling unit 500 may include an operation data packet cache 510, a second parsing module 520, and a second segmentation module 530, wherein the second parsing module 520 is represented in the figure as "parsing module 2", the second segmentation module 530 is represented in the figure as "segmentation module 2", and the second parsing module 520 also has a second synchronization engine inside, which is represented in the figure as "synchronization engine 2". The operation data packet buffer 510 can be used to receive operation data packets sent by the upper-layer command processor 300. The second parsing module 520 can parse the operation data packets in the operation data packet buffer 510 to obtain task information. The second segmentation module 530 can divide the task information parsed by the second parsing module 520 to determine whether the corresponding task information can be sent to the data replication module 600 or the corresponding computing unit 700, so as to use the data replication module 600 or the corresponding computing unit 700 to complete the corresponding task. The scheduling unit 500 may include a command scheduling subunit and a task scheduling subunit. The command scheduling subunit is used to perform command scheduling processing, and the task scheduling subunit is used to perform task scheduling processing.
[0078] It is worth noting that a computing unit 700 may include a workgroup cluster data cache 810, a third synchronization engine 820, a third segmentation module 830, a task scheduling module 850 and multiple execution units 840; it is worth noting that the figure only shows an example of four execution units 840, which does not mean that the computing unit 700 can only include four execution units 840, and the number of execution units 840 is not limited. Among them, the third synchronization engine 820 is represented as "synchronization engine 3" in the figure, and the third segmentation module 830 is represented as "segmentation module 3" in the figure. The workgroup cluster data cache 810 is used to receive information sent by the scheduling unit 500, the third synchronization engine 820 is used to parse and synchronize the information in the workgroup cluster data cache 810 to obtain task information, and the third segmentation module 830 is used to segment the task information and send the corresponding task information to the execution unit 840 for task execution processing.
[0079] Overall implementation of the data synchronization method in the disclosed embodiment
[0080] The embodiment of the present disclosure proposes a data synchronization method for a chip system, which includes a command processor and multiple block processing clusters, each of which is in communication with the command processor, and each of which includes a scheduling unit and multiple computing units, each of which is in data connection with the scheduling unit. Figure 2 , data synchronization methods include:
[0081] Step S201: receiving a task data packet based on a command processor, wherein the task data packet includes barrier object arrival range information, and the barrier object arrival range information is used to represent the hierarchical synchronization range of the chip system;
[0082] Step S202 , converting the task data packet into an operation data packet according to the barrier object arrival range information through the command processor;
[0083] In step S203 , the scheduling unit performs task execution processing according to the operation data packet, so that the block processing cluster performs data synchronization within the hierarchical synchronization range.
[0084] Specifically, in the present disclosure, the chip system includes a command processor and multiple block processing clusters. Each block processing cluster is data-connected to the command processor. The command processor can receive task data packets sent from the upper host layer. The command processor can also convert and process the task data packets to obtain operation data packets; each block processing cluster is also provided with a scheduling unit, and each block processing cluster also includes multiple computing units. Each computing unit in the same block processing cluster is connected to the scheduling unit, and the scheduling unit can perform task execution processing according to the operation data packet.
[0085] In step S201, the command processor in the chip system can receive a task data packet sent by the upper host layer, wherein the task data packet is used to indicate the task that the chip system needs to perform; the task data packet is provided with barrier object arrival range information, and the barrier object arrival range information is used to characterize the hierarchical synchronization range of the chip system, that is, the specific hierarchical synchronization range of the subsequent chip system can be determined based on the barrier object arrival range information. In the embodiment of the present disclosure, the hierarchical synchronization range of the chip system can include CP layer synchronization, BPC layer synchronization and CU layer synchronization; and CP layer synchronization mainly refers to the synchronization within the chip or between different BPCs; BPC layer synchronization refers to the synchronization within the BPC and the synchronization between different CUs within the same BPC; CU layer synchronization refers to the synchronization within the same CU, the synchronization between different work groups or different cores within the CU. It can be understood that in the process of achieving synchronization at each level, it is often necessary to synchronize the relevant data because there is a dependency between the data processed by the relevant modules during the execution of the task.
[0086] For example, in a chip system, the command processor receives a task data packet sent by the upper host layer, and the barrier object arrival range information in the task data packet is used to characterize the BPC layer synchronization, and then in the subsequent synchronization operation process, the BPC internal synchronization and the synchronization between different CUs within the same BPC will be realized; or, the command processor receives a task data packet sent by the upper host layer, and the barrier object arrival range information in the task data packet is used to characterize the CU layer synchronization, and then in the subsequent synchronization operation process, the synchronization within the same CU and the synchronization between different work groups or different cores within the CU will be realized.
[0087] In the embodiment of the present disclosure, Figure 1 As shown, "Chip 1", "Chip 2", "Chip 3" and "Chip 4" are four chip systems, and the host can independently send corresponding task data packets to each chip system; for example, the host can send a first task data packet to "Chip 1", and the barrier object arrival range information in the first task data packet is used to characterize CP layer synchronization; the host can send a second task data packet to "Chip 2", and the barrier object arrival range information in the second task data packet is used to characterize BPC layer synchronization; the host can send a third task data packet to "Chip 4", and the barrier object arrival range information in the third task data packet is used to characterize CU layer synchronization; however, the host does not send a task data packet to "Chip 3".
[0088] In step S202, after the command processor receives the task data packet sent by the host layer, it can convert the task data packet into an operation data packet according to the barrier object arrival range information; subsequently, the command scheduling unit in the block processing cluster can perform task execution processing according to the converted operation data packet; wherein, the command processor may include a task data packet cache, a first parsing module and a first segmentation module, the task data packet cache is used to receive the task data packet sent by the host, and the task data packet carries the barrier object arrival range information, then the first parsing module can convert the task data packet in the task data packet cache into an operation data packet according to the barrier object arrival range information, then the first segmentation module can divide the operation data packet so that the operation data packet can be sent to the corresponding block processing cluster, so that the corresponding block processing cluster can perform task execution processing.
[0089] For example, when data synchronization between two block processing clusters in a chip system needs to be controlled, the first segmentation module distributes the operation data packet to the two corresponding block processing clusters, while the block processing cluster that does not need to participate in the synchronization operation will not receive the operation data packet sent by the first segmentation module. When data synchronization within a block processing cluster needs to be controlled, the first segmentation module sends the operation data packet to the corresponding block processing cluster, while other block processing clusters in the chip system will not receive the operation data packet sent by the first segmentation module.
[0090] It is worth noting that, due to the different barrier object arrival range information in the task data packet, the converted operation data packet will be different; for example, when the barrier object arrival range information represents BPC-level synchronization, the converted operation data packet will indicate the task execution processing at the BPC level; when the barrier object arrival range information represents CU-level synchronization, the converted operation data packet will indicate the task execution processing at the CU level.
[0091] In step S203, after the block processing cluster receives the operation data packet sent by the command processor, it can control the scheduling unit in the block processing cluster to perform task execution processing according to the operation data packet, so that the block processing cluster can synchronize data within the hierarchical synchronization range specified by the barrier object arrival range information.
[0092] In an embodiment of the present disclosure, task execution processing is performed according to an operation data packet through a scheduling unit; in the process of task execution, according to different settings of the barrier object arrival range information, the block processing cluster can perform data synchronization within the hierarchical synchronization range specified by the barrier object arrival range information; the block processing cluster performs data synchronization within the hierarchical synchronization range, which may include the following: synchronization between different block processing clusters, or synchronization within the same block processing cluster, or synchronization between different computing units of the same block processing cluster, or synchronization within the same computing unit, or synchronization between different workgroups or cores within the same computing unit.
[0093] Exemplarily, the scheduling unit in the block processing cluster includes an operation data packet cache, a second parsing module and a second segmentation module. The operation data packet cache can store and process the operation data packets issued by the first segmentation module. The second parsing module can parse and convert the operation data packets in the operation data packet cache to obtain task execution information. The second segmentation module can divide and process the task execution information parsed by the second parsing module so that the task execution information can be sent to the corresponding computing unit, so that the corresponding computing unit executes the corresponding task to realize the synchronous operation of the CU layer.
[0094] In steps S201 to S203, the command processor based on the chip system receives a task data packet, wherein the task data packet includes barrier object arrival range information, and the barrier object arrival range information is used to characterize the hierarchical synchronization range of the chip system; then the command processor converts the received task data packet into an operation data packet according to the barrier object arrival range information; then the scheduling unit in the block processing cluster performs task execution processing according to the operation data packet, thereby enabling the block processing cluster and / or the computing unit in the block processing cluster to perform data synchronization. In the present disclosure, barrier object arrival range information is provided in the task data packet sent down to limit the subsequent hierarchical synchronization range of the chip system; subsequently, the task data packet is converted into an operation data packet, and the scheduling unit performs task execution processing according to the converted operation data packet, thereby enabling the block processing cluster to perform data synchronization at the corresponding level, without the need to feed back the relevant synchronization information to the upper host layer as in the past, thus shortening the information feedback path and improving the efficiency of data synchronization.
[0095] For example, a chip system receives a task data packet sent by the host, and the barrier object arrival range information in the task data packet represents the BPC layer synchronization; the task data packet cache in the command processor will store and process the task data packet, and then the first parsing module in the command processing processor will convert and process the task data packet in the task data packet cache to obtain an operation data packet, and then the first segmentation module will divide and process the operation data packet to select the corresponding block processing cluster. After the scheduling unit in the corresponding block processing cluster receives the operation data packet sent by the first segmentation module, it can perform task execution processing according to the operation data packet to realize the data synchronization operation within the block processing cluster.
[0096] In one embodiment, referring to Figure 3 , step S202 includes:
[0097] Step S301 , when the barrier object reach range information is first-level information, converting a task data packet into an operation data packet according to the first-level information by a command processor, wherein the first-level information represents synchronization between the command processor and a block processing cluster or synchronization between multiple block processing clusters;
[0098] Step S302 , when the barrier object reach range information is second-level information, converting the task data packet into an operation data packet according to the second-level information by the command processor, wherein the second-level information represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster;
[0099] Step S303 : when the barrier object reach range information is third-level information, the command processor converts the task data packet into an operation data packet according to the third-level information, wherein the third-level information represents synchronization within the computing unit.
[0100] In step S301, when the barrier object arrival range information is first-level information, the command processor will convert the task data packet into an operation data packet based on the first-level information. Since the first-level information represents the synchronization between the command processor and the block processing cluster or the synchronization between multiple block processing clusters, the subsequent operation data packet obtained by conversion can realize CP-level synchronization operations.
[0101] Exemplarily, the barrier object reach range information may be a two-bit information. For example, when the first-level information is "01", it indicates that a data synchronization operation is performed at the CP layer. The synchronization at the CP layer includes synchronization between the command processor and the block processing cluster or synchronization between multiple block processing clusters.
[0102] In step S302, when the barrier object arrival range information is the second-level information, the command processor will convert the task data packet into an operation data packet according to the second-level information. Since the second-level information represents the synchronization within the block processing cluster or the synchronization between different computing units within the same block processing cluster, the subsequent operation data packet obtained by conversion can realize BPC-level synchronization operations.
[0103] Exemplarily, the barrier object reach range information can be a two-bit information. For example, when the second-level information is "10", it means that data synchronization operation is performed at the BPC layer. The synchronization at the BPC layer includes synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster.
[0104] In step S303, when the barrier object arrival range information is third-level information, the command processor will convert the task data packet into an operation data packet according to the third-level information. Since the third-level information represents the synchronization within the computing unit, the subsequent operation data packet obtained by conversion can realize CU-level synchronization operations.
[0105] Exemplarily, the barrier object reaching range information may be a two-bit information. For example, when the third-level information is "11", it indicates that data synchronization operation is performed at the CU layer, and synchronization at the CU layer includes synchronization within the computing unit.
[0106] It is worth noting that the barrier object arrival range information is represented by a two-bit information. When the barrier object arrival range information is "00", the operation data packet obtained by the conversion has no barrier, and no data synchronization operation is required in the subsequent execution of the operation data packet.
[0107] By setting different values for the barrier object reach range information in steps S301 to S303, synchronization operations can be achieved at different levels within the chip system during subsequent data packet conversion. This eliminates the need to feed back relevant synchronization information to the host layer, shortening the synchronization information feedback path and improving data synchronization efficiency. Furthermore, simply setting the barrier object reach range information allows synchronization at different levels within the chip system, making the entire setting process simple and efficient, and enabling greater flexibility in subsequent data synchronization. It is worth noting that the specific settings for the barrier object reach range information and the level of synchronization each setting refers to can be pre-set. For example, the barrier object reach range information can be represented using two bits, with "01" representing CP-layer synchronization, "10" representing BPC-layer synchronization, and "11" representing CU-layer synchronization. Alternatively, the barrier object reach range information can be represented using a single decimal digit, with "6" representing CP-layer synchronization, "7" representing BPC-layer synchronization, and "8" representing CU-layer synchronization. Users can set these values based on actual needs and are not limited here.
[0108] In one embodiment, referring to Figure 4 , step S203 includes:
[0109] Step S401: When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet;
[0110] Step S402: When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet;
[0111] Step S403 : when the operation data packet is a data transport packet, the scheduling unit performs task execution processing according to the second barrier arrival mark information of the data transport packet.
[0112] In step S401, the scheduling unit in the block processing cluster can perform different task execution processes based on the different operation data packets during the process of performing task execution processing based on the operation data packets. If the operation data packet is a barrier synchronization packet, the scheduling unit can perform task execution processing based on the operation type information in the barrier synchronization packet. The operation type information of the barrier synchronization packet can include barrier waiting information and barrier initialization information, etc. Different task operations can be performed based on different operation type information. For example, the task data packet cache in the command processor in the chip system receives the task data packet sent by the host, and then the first parsing module converts the task data packet to obtain a barrier synchronization packet. The barrier synchronization packet carries the operation type information, and the task execution processing can be performed subsequently based on the operation type information.
[0113] In step S402, if the operation data packet is a kernel load packet, the scheduling unit can perform task execution processing based on the first barrier arrival marker information in the kernel load packet; and different values of the first barrier arrival marker information can limit the synchronization of different levels within the chip system. For example, the task data packet cache in the command processor in the chip system receives the task data packet sent by the host, and then the first parsing module converts the task data packet to obtain a kernel load packet; the kernel load packet carries the first barrier arrival marker information, and the task execution processing can then be performed based on the first barrier arrival marker information.
[0114] In step S403, when the operation data packet is a data transport packet, the scheduling unit can perform task execution processing based on the second barrier arrival mark information in the data transport packet; wherein, the data transport packet is used by the data replication module in the indicator block processing cluster to perform data replication and transport processing; the first barrier arrival mark information and the second barrier arrival mark information in the embodiment of the present disclosure are only used to distinguish the belonging objects, and do not mean that the data types of the two are different. For example, the task data packet cache in the command processor in the chip system receives the task data packet sent by the host, and then the first parsing module converts the task data packet to obtain a data transport packet; the data transport packet carries the second barrier arrival mark information, and then the task execution processing can be performed based on the second barrier arrival mark information.
[0115] In steps S401 to S403, the scheduling unit in the block processing cluster can perform different task execution processing according to the different operation data packets during the process of performing task execution processing according to the operation data packet; in the embodiment of the present disclosure, the operation data packet can be a barrier synchronization packet, a kernel loading packet and a data transport packet; in the subsequent task execution process, the task execution processing can be performed according to the operation type information in the barrier synchronization packet, or the task execution processing can be performed according to the first barrier arrival mark information in the kernel loading packet, or the task execution processing can be performed according to the second barrier arrival mark information in the data transport packet. Performing task execution processing according to different types of operation data packets makes the entire task execution process more simple and flexible. For example, the task data packet cache in the command processor in the chip system receives the task data packet sent by the host, and then the first parsing module converts the task data packet to obtain the operation data packet, and then the task execution processing can be performed according to the operation data packet obtained by the conversion, so that the task execution process can be more flexible.
[0116] In one embodiment, referring to Figure 5 , step S401 includes:
[0117] Step S501: When the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit receives the barrier synchronization packet and enters a waiting state;
[0118] In step S502, when the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information, the scheduling unit initializes the value of the received barrier object, and when the barrier arrival information is received, the value of the barrier object is counted. When the preset first comparison condition is met, the scheduling unit exits the waiting state.
[0119] In step S501, the operation data packet is obtained by converting the second-level information. Then, in the subsequent process of performing task execution based on the operation data packet, BPC-level synchronization processing can be achieved, that is, synchronization between different computing units within the block processing cluster or within the same block processing cluster. When the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit in the block processing cluster will receive the barrier synchronization packet and make the scheduling unit enter a waiting state. When all barrier objects subsequently feedback that the task is completed, the barrier object will be released and the scheduling unit will exit the waiting state. For example, the command processor in the chip system receives the task data packet sent by the host, and then the command processor can convert the received task data packet to obtain an operation data packet, and then the command processor sends the operation data packet to the corresponding block processing cluster. When the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit in the block processing cluster will enter a waiting state when it receives the barrier synchronization packet.
[0120] In step S502, if the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information, the scheduling unit in the block processing cluster will initialize the value of the received barrier object. When the barrier arrival information is subsequently received, the value of the barrier object will be decremented by one until the value of the barrier object is zero, so that the scheduling unit exits the waiting state and achieves data synchronization. The scheduling unit initializes the value of the received barrier object. That is, when the scheduling unit receives 5 barrier objects, the value of the barrier object obtained by initialization is 5. When the task corresponding to each barrier object is completed, the barrier arrival information is sent to the scheduling unit. The scheduling unit will decrement the value of the previously initialized barrier object by one until the value of the previous barrier object is reduced to 0. Only then will the scheduling unit exit the waiting state and achieve data synchronization. Alternatively, when the task corresponding to each barrier object is completed, a barrier arrival message is sent to the scheduling unit. The scheduling unit then increments the barrier object's value from zero until it equals the previously initialized barrier object's value. For example, if the barrier object's value is 6, when the task corresponding to each barrier object is completed, a barrier arrival message is sent to the scheduling unit. The scheduling unit then increments the barrier object's value from zero until it equals the previously initialized barrier object's value of 6. Only then does the scheduling unit exit the waiting state to synchronize the data. The counting process in the disclosed embodiment can be performed by decrementing the barrier object's value from zero until it equals zero, or by incrementing the barrier object's value from zero until it equals the initialized barrier object's value. Both methods implement barrier object value comparison, and the principles of both are similar and are not limited herein. The first comparison condition of the disclosed embodiment can be "decrementing the barrier object's value from zero until it equals zero" or "incrementing the barrier object's value from zero until it equals the initialized barrier object's value."
[0121] Exemplarily, the scheduling unit in the block processing cluster receives an operation data packet sent by the command processor, and the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information. The scheduling unit in the block processing cluster will initialize the value of the received barrier object. For example, the number of received barrier objects is 6, and the value of the barrier object at this time is 6; subsequently, when the task corresponding to the barrier object is completed, the barrier arrival information will be fed back to the scheduling unit, and each time a barrier arrival information is received, the value of the barrier object will be reduced by one; when 6 barrier arrival information are received, the value of the barrier object will become 0, and the scheduling unit will exit the waiting state and execute subsequent tasks to ensure that the data is processed synchronously. Alternatively, the scheduling unit in the block processing cluster receives an operation data packet sent by the command processor, and the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information. The scheduling unit in the block processing cluster will initialize the value of the received barrier object. For example, the number of barrier objects received is 7, and the value of the barrier object at this time is 7; subsequently, when the task corresponding to the barrier object is completed, the barrier arrival information will be fed back to the scheduling unit, and each time a barrier arrival information is received, the value of the barrier object will be increased by one starting from zero; when 7 barrier arrival information are received, the calculated value of the barrier object will become 7, and the value of the barrier object at this time will be equal to the value of the initialized barrier object. At this time, the scheduling unit will also exit the waiting state and execute subsequent tasks to ensure that the data is processed synchronously.
[0122] In steps S501 and S502, if the operation data packet is a barrier synchronization packet, task execution processing can be performed according to the operation type information of the barrier synchronization packet. If the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier wait information, the scheduling unit will enter a wait state upon receiving such a barrier synchronization packet. If the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information, the scheduling unit will initialize the value of the received barrier object. When the scheduling unit receives barrier arrival information, it will decrement the value of the barrier object by one until the value of the barrier object is reduced to 0. When the value of the barrier object is reduced to 0, the scheduling unit will exit the wait state to achieve data synchronization. Alternatively, when the scheduling unit receives barrier arrival information, it will increment the value of the barrier object from zero by one until the obtained value of the barrier object is equal to the value of the initialized barrier object. The scheduling unit will then exit the wait state to achieve data synchronization. The above technical solution makes the data synchronization process simpler and faster.
[0123] In one embodiment, referring to Figure 6 , step S402 includes:
[0124] Step S601: When the operation data packet is a kernel load packet and the first barrier arrival flag information of the kernel load packet indicates synchronization within the computing unit, the scheduling unit sends the first barrier arrival flag information to the corresponding computing unit so that the computing unit performs task execution processing.
[0125] Step S602: When the operation data packet is a kernel load packet and the first barrier arrival mark information of the kernel load packet represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster, the scheduling unit divides the workgroup set, workgroup cluster and workgroup in the block processing cluster; and when the execution of the divided workgroup cluster or workgroup task is completed, the command scheduling subunit of the scheduling unit generates a barrier synchronization signal and sends the barrier synchronization signal and the first barrier arrival mark information to the task scheduling subunit of the scheduling unit.
[0126] In step S601, the operation data packet is obtained by converting the second-level information. Then, in the subsequent process of performing task execution processing based on the operation data packet, BPC-level synchronization processing can be achieved, that is, synchronization between different computing units within the block processing cluster or within the same block processing cluster. When the operation data packet is a kernel load packet and the first barrier arrival mark information of the kernel load packet indicates synchronization within the computing unit, it indicates that a CU-level synchronization operation is required, so the command scheduling unit will send the first barrier arrival mark information to the corresponding computing unit to enable the computing unit to perform the corresponding task execution processing.
[0127] Exemplarily, the first barrier arrival mark information representation is synchronized within the computing unit. At this time, the barrier arrival mark value corresponding to the first barrier arrival mark information can be set within a certain interval; for example, the set interval range is 0-126, and the barrier arrival mark value corresponding to the first barrier arrival mark information is 100. Since 100 is within the set interval, the CU layer synchronization operation will be performed subsequently, and the command scheduling unit will send the barrier arrival mark value 100 corresponding to the first barrier arrival mark information to the corresponding computing unit so that the computing unit can perform task execution processing.
[0128] In step S602, when the operation data packet is a kernel load packet and the first barrier arrival mark information of the kernel load packet represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster, it indicates that BPC layer synchronization operation is required; the scheduling unit will divide and process the workgroup sets, workgroup clusters and workgroups in the block processing cluster; and when the divided workgroup clusters or workgroup tasks are executed, the command scheduling subunit of the scheduling unit will generate a barrier synchronization signal and send the barrier synchronization signal and the first barrier arrival mark information to the task scheduling subunit of the scheduling unit of the block processing cluster for record processing, in order to prepare for BPC layer synchronization.
[0129] Exemplarily, the first barrier arrival mark information represents the synchronization within the block processing cluster or the synchronization between different computing units within the same block processing cluster. At this time, the barrier arrival mark value corresponding to the first barrier arrival mark information can also be set within a certain interval; for example, the set interval is 128-254, and the barrier arrival mark value corresponding to the first barrier arrival mark information is 150. Since 150 is within the set interval, the BPC layer synchronization operation must be performed subsequently. The scheduling unit divides and processes the workgroup sets, workgroup clusters, and workgroups in the block processing cluster, and when the divided workgroup clusters or workgroup tasks are executed, the command scheduling subunit of the scheduling unit will generate a barrier synchronization signal and send the barrier synchronization signal and the barrier arrival mark value corresponding to the first barrier arrival mark information to the task scheduling subunit of the scheduling unit of the block processing cluster for recording and processing, in order to prepare for BPC layer synchronization.
[0130] In steps S601 to S602, when the operation data packet is a kernel load packet, the kernel load packet carries first barrier arrival mark information. By setting the first barrier arrival mark information to different values, different levels of synchronization operations can be limited. For example, when the barrier arrival mark value corresponding to the first barrier arrival mark information is within the range of 0-126, the CU layer synchronization operation will be performed subsequently; when the barrier arrival mark value corresponding to the first barrier arrival mark information is within the range of 128-254, the BPC layer synchronization operation will be performed subsequently; therefore, it is only necessary to set and process the barrier arrival mark value corresponding to the first barrier arrival mark information to achieve synchronization operations at different levels.
[0131] In one embodiment, referring to Figure 7 , step S403 includes:
[0132] Step S701: The command scheduling subunit of the scheduling unit sends a data transport packet to the task scheduling subunit of the scheduling unit;
[0133] In step S702 , the data replication module in the block processing cluster performs data transfer processing according to the data transfer packet, and when the data transfer is completed, performs a barrier arrival operation according to the second barrier arrival mark information, and sends a synchronization signal to the command processor.
[0134] In step S701, the operation data packet is obtained by converting the second-level information. Then, in the subsequent process of performing task execution processing based on the operation data packet, BPC-level synchronization processing can be achieved, that is, synchronization between different computing units within the block processing cluster or within the same block processing cluster. In the case where the operation data packet is a data transport packet, the command scheduling subunit of the scheduling unit can send the data transport packet received from the command processor to the task scheduling subunit of the scheduling unit. Among them, the data transport packet is used to instruct the data replication module in the block processing cluster to perform data replication and transport processing; in the block processing cluster, the task scheduling subunit can realize functions such as task reception, parsing, scheduling, allocation and monitoring.
[0135] In step S702, the data replication module in the block processing cluster performs data transfer processing according to the data transfer packet, and when the data transfer is completed, it also performs a barrier arrival operation according to the second barrier arrival mark information, and then sends a synchronization signal to the command processor; the data replication module can perform data transfer processing according to the received data transfer packet; and when the data transfer is completed, it performs a barrier arrival operation according to the second barrier arrival mark information, and then sends a synchronization signal to the command processor to inform the command processor that the synchronization operation is completed.
[0136] In steps S701 and S702, if the operation data packet is a data transfer packet, the command scheduling subunit of the scheduling unit will send the received data transfer packet to the task scheduling subunit of the scheduling unit. The data replication module in the block processing cluster will then perform data transfer processing based on the data transfer packet. When the data transfer is complete, a barrier arrival operation can be performed and a synchronization signal can be sent to the command processor to inform the command processor that the data synchronization operation is complete. Through the above technical solution, even if the operation data packet is a data transfer packet, a data synchronization operation can be performed based on the second barrier arrival marker information, making the entire process simple and fast.
[0137] In one embodiment, referring to Figure 8 , step S401 may further include:
[0138] Step S801: When the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit sends the barrier synchronization packet to the computing unit;
[0139] Step S802 : When the barrier arrival information is received, the task scheduling module of the computing unit counts the values of the barrier objects of the barrier synchronization packet until a preset second comparison condition is met.
[0140] In step S801, the operation data packet is obtained by converting the third-level information. Then, in the subsequent process of performing task execution processing based on the operation data packet, CU-level synchronization processing can be achieved, that is, synchronization within the same CU and between different work groups or different cores within the CU; when the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier wait information, the scheduling unit in the block processing cluster will send a barrier synchronization packet to the computing unit. For example, the command processor in the chip system receives the task data packet sent by the host, and then the command processor can convert and process the received task data packet to obtain an operation data packet, and the operation data packet is converted from the third-level information; then the command processor sends the operation data packet to the corresponding block processing cluster; when the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier wait information, when the scheduling unit in the block processing cluster receives the barrier synchronization packet, the scheduling unit will send the barrier synchronization packet to the computing unit.
[0141] In step S802, after the corresponding task is executed, a barrier arrival message is generated. Upon receiving the barrier arrival message, the task scheduling module of the computing unit decrements the barrier object's value by one until the barrier object's value reaches zero, causing the scheduling unit to exit the waiting state and achieve data synchronization. For example, when the scheduling unit receives five barrier objects, the barrier object's value is initialized to 5. When the task corresponding to each barrier object is completed, a barrier arrival message is sent to the task scheduling module of the computing unit. The task scheduling module decrements the barrier object's value in the barrier synchronization packet by one until the previous barrier object's value reaches 0, at which point the scheduling unit exits the waiting state and achieves data synchronization. Alternatively, after the corresponding task is executed, a barrier arrival message is generated. Upon receiving the barrier arrival message, the task scheduling module of the computing unit increments the barrier object's value from zero by one until the resulting barrier object's value equals the initialized barrier object's value, causing the scheduling unit to exit the waiting state and achieve data synchronization. For example, when the scheduling unit receives six barrier objects, the value of the initialized barrier object is 6. When the task corresponding to each barrier object is completed, a barrier arrival message is sent to the task scheduling module of the computing unit. The task scheduling module then increments the value of the barrier object in the barrier synchronization packet by one until the value of the obtained barrier object equals the value of the initialized barrier object, which is 6. Only then does the scheduling unit exit the waiting state to synchronize the data. The second comparison condition in the disclosed embodiment is "decrementing the value of the initialized barrier object by one until it reaches zero" or "incrementing the value of the barrier object by one until it equals the value of the initialized barrier object."
[0142] For example, the number of barrier objects received is 7, and the value of the barrier object at this time is 7; subsequently, when the task corresponding to the barrier object is completed, the barrier arrival information will be fed back to the task scheduling module of the computing unit, and the value of the barrier object will be reduced by one each time a barrier arrival information is received; when 7 barrier arrival information are received, the value of the barrier object will become 0, and the scheduling unit will exit the waiting state and execute subsequent tasks to ensure that the data is processed synchronously.
[0143] In steps S801 to S802, the operation data packet is obtained through the third-level information conversion. When the operation data packet is a barrier synchronization packet, the task execution processing can be performed according to the operation type information of the barrier synchronization packet. When the operation data packet is a barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit sends the barrier synchronization packet to the computing unit. Then, when the barrier arrival information is received, the task scheduling module of the computing unit subtracts one from the value of the barrier object of the barrier synchronization packet until the value of the barrier object becomes zero. When the value of the barrier object is reduced to 0, the scheduling unit will exit the waiting state to achieve data synchronization operation. Alternatively, when the barrier arrival information is received, the value of the barrier object will be increased by one starting from zero until the obtained value of the barrier object is equal to the value of the initialized barrier object. The scheduling unit will also exit the waiting state to achieve data synchronization operation. Through the above technical solution, the CU layer synchronization process is made simpler and faster.
[0144] In one embodiment, referring to Figure 9 , step S402 may further include:
[0145] Step S901: The task scheduling module of the computing unit records the first barrier arrival mark information;
[0146] Step S902 : When the kernel in the computing unit completes the corresponding task according to the first barrier arrival mark information, a subtraction operation is performed on the value of the barrier object corresponding to the kernel loading package.
[0147] In step S901, the operation data packet is obtained by converting the third-level information. Subsequently, in the process of performing task execution based on the operation data packet, CU-level synchronization processing can be achieved, that is, synchronization within the same CU and between different work groups or different cores within the CU; in the case that the operation data packet is a kernel loading packet, the task scheduling module of the computing unit records the first barrier arrival mark information, and then the value of the barrier object corresponding to the kernel loading packet can be subtracted according to the completion status of the task.
[0148] In step S902, during the CU layer synchronization operation, after the task scheduling module of the computing unit records the first barrier arrival mark information, when the kernel in the computing unit completes the corresponding task work according to the first barrier arrival mark information, the value of the barrier object corresponding to the kernel loading package can be subtracted; exemplarily, the number of barrier objects received is 4, and the value of the barrier object at this time is 4; subsequently, when the kernel in the computing unit completes the corresponding task work according to the first barrier arrival mark information, the value of the barrier object corresponding to the kernel loading package will be subtracted until the value of the barrier object corresponding to the kernel loading package becomes 0, at which time the scheduling unit will exit the waiting state and execute subsequent tasks to ensure that the data is processed synchronously.
[0149] In steps S901 to S902, when the operation data packet is a kernel load packet and the operation data packet is obtained by converting the third-level information, the task scheduling module of the computing unit will record the first barrier arrival mark information; then, when the kernel of the computing unit completes the corresponding task work according to the first barrier arrival mark information, it will perform a subtraction operation on the value of the barrier object corresponding to the kernel load packet; illustratively, the task scheduling module of the computing unit records the first barrier arrival mark information 125, and then the kernel in the computing unit completes the corresponding task work according to the first barrier arrival mark information 125; for example, the value of the barrier object corresponding to the kernel load packet is 7, and the value of the barrier object at this time is 7; subsequently, when the kernel in the computing unit completes the corresponding task work according to the first barrier arrival mark information, it will perform a subtraction operation on the value of the barrier object corresponding to the kernel load packet until the value of the barrier object corresponding to the kernel load packet becomes 0, at which time the scheduling unit will exit the waiting state and execute subsequent tasks to ensure that the data is processed synchronously.
[0150] In one embodiment, referring to Figure 10 , step S401 may further include:
[0151] Step S1001: The computing unit sends a barrier synchronization packet to the scheduling unit, wherein the operation type information of the barrier synchronization packet is barrier initialization information, and the scheduling unit initializes the value of the received barrier object;
[0152] Step S1002 , the command scheduling subunit of the scheduling unit sends a barrier synchronization packet whose operation type information is barrier initialization information to the task scheduling subunit of the scheduling unit;
[0153] Step S1003: The computing unit sends a barrier synchronization packet with operation type information of barrier waiting information to the command scheduling sub-unit for storage, so that the command scheduling sub-unit enters a waiting state.
[0154] Step S1004: When the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit feeds back a barrier arrival signal to the command scheduling subunit, and the command scheduling subunit counts the value of the barrier object until a preset third comparison condition is met.
[0155] Step S1005 : The command scheduling subunit clears the barrier synchronization packet whose operation type information is barrier waiting information, so that the command scheduling subunit exits the waiting state.
[0156] In step S1001, when the operation data packet is a barrier synchronization packet, the computing unit may send the barrier synchronization packet to the scheduling unit, wherein the operation type information of the barrier synchronization packet is barrier initialization information, and the scheduling unit initializes the value of the received barrier object to prepare for subsequent data synchronization operations.
[0157] It is worth noting that in the disclosed example, the data synchronization process can be initiated by the upper layer module or the lower layer module. In this embodiment, it is initiated by the lower layer computing unit.
[0158] In step S1002, after the command scheduling subunit of the scheduling unit initializes the value of the received barrier object, the command scheduling subunit can send the barrier synchronization packet with the operation type information as barrier initialization information to the task scheduling subunit; based on the task scheduling subunit, a hardware foundation can be provided for subsequent barrier arrival signal feedback.
[0159] In step S1003 , the computing unit sends a barrier synchronization packet whose operation type information is barrier waiting information to the command scheduling subunit for storage, so that the command scheduling subunit enters a waiting state and prepares for subsequent data synchronization.
[0160] In step S1004, when the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit feeds back a barrier arrival signal to the command scheduling subunit. The command scheduling subunit then decrements the barrier object's value by one until the barrier object's value is zero, or increments the barrier object's value by one from zero until the calculated barrier object's value is equal to the initialized barrier object's value. For example, the initial barrier object's value is 5. When the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit feeds back a barrier arrival signal to the command scheduling subunit. Upon receiving a barrier arrival signal, the barrier object's value 5 is decremented by one until the barrier object's value changes from 5 to 0. Alternatively, upon receiving a barrier arrival signal, the barrier object's value is incremented by one from 0 until the calculated barrier object's value changes from 0 to 5. The third comparison condition in the disclosed embodiment is "decrementing the initialized barrier object's value by one until it becomes zero" or "incrementing the barrier object's value by one from zero until it becomes equal to the initialized barrier object's value."
[0161] In step S1005, when the value of the barrier object becomes 0, the command scheduling subunit will clear the barrier synchronization packet whose operation type information is barrier waiting information, so that the command scheduling subunit exits the waiting state and can continue to execute subsequent tasks.
[0162] In step S1001 to step S1005, this embodiment is initiated by the computing unit at the lower layer to the scheduling unit at the upper layer. The computing unit first sends a barrier synchronization packet to the scheduling unit, wherein the operation type information of the barrier synchronization packet is barrier initialization information. The scheduling unit initializes the value of the received barrier object to determine the value of the barrier object and prepare for subsequent data synchronization. The command scheduling subunit then sends the barrier synchronization packet with the operation type information of barrier initialization information to the task scheduling subunit. The computing unit then sends the barrier synchronization packet with the operation type information of barrier wait information to the command scheduling subunit for storage, so that the command scheduling subunit enters a wait state. Then, when the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit will feedback a barrier arrival signal to the command scheduling subunit. The command scheduling subunit will then decrement the value of the barrier object by one until the value of the barrier object becomes 0, or the command scheduling subunit will increment the value of the barrier object from zero by one until the calculated value of the barrier object is equal to the value of the initialized barrier object. The command scheduling subunit will also clear the barrier synchronization packet with the operation type information of barrier wait information, so that the command scheduling subunit can exit the wait state and achieve data synchronization.
[0163] It is worth noting that the embodiments of the present disclosure perform synchronization operations by decrementing the initial value of the barrier object. When the task corresponding to the barrier synchronization package is completed, the initial value of the barrier object is decremented. Alternatively, the embodiments of the present disclosure perform synchronization operations by incrementing the initial value of the barrier object. When the task corresponding to the barrier synchronization package is completed, the value of the barrier object is incremented from zero. In addition, the synchronization method of the embodiments of the present disclosure is initiated by the lower-level computing unit to the upper-level command scheduling unit.
[0164] In one embodiment, referring to Figure 11 , step S402 may further include:
[0165] Step S1101: The command scheduling subunit of the scheduling unit sends a barrier synchronization signal to the task scheduling subunit of the scheduling unit according to the first barrier arrival mark information of the kernel loading package, wherein the barrier synchronization signal carries the barrier arrival mark information;
[0166] In step S1102, the command scheduling sub-unit divides the work group in the block processing cluster, and when the divided work group tasks are completed, the task scheduling sub-unit performs barrier arrival feedback processing on the task arrival mark information, so that the task scheduling sub-unit feeds back the barrier synchronization signal to the command processor.
[0167] In step S1101, when the operation data packet is a kernel loading packet, the command scheduling sub-unit of the scheduling unit sends a barrier synchronization signal to the task scheduling sub-unit of the scheduling unit according to the first barrier arrival mark information of the kernel loading packet, wherein the barrier synchronization signal carries the barrier arrival mark information; based on the barrier arrival mark information in the barrier synchronization signal, an object basis can be provided for subsequent barrier arrival feedback.
[0168] It is worth noting that the embodiment of the present disclosure performs data synchronization by transmitting synchronization signals between different modules, and the synchronization is initiated by an upper-layer command scheduling unit.
[0169] In step S1102, the command scheduling sub-unit divides the workgroups in the block processing cluster, and when the divided workgroup tasks are completed, barrier arrival feedback processing can be performed to the task scheduling sub-unit based on the barrier arrival mark information, so that the task sub-scheduling unit can feedback the relevant barrier synchronization signal to the command processor. Specifically, when the divided workgroup tasks are completed, barrier arrival feedback can be performed to the task scheduling sub-unit based on the barrier arrival mark information, so that the synchronization information stored in the task scheduling sub-unit is updated, and when the data synchronization operation is completed, barrier synchronization signal feedback processing will also be performed to the command processor to inform the command processor that the relevant data synchronization operation has been completed.
[0170] In steps S1101 to S1102, this embodiment is initiated by the command scheduling subunit to the task scheduling subunit. In the case where the operation data packet is a kernel loading packet, the command scheduling subunit can send a barrier synchronization signal to the task scheduling subunit of the block processing cluster based on the first barrier arrival mark information in the kernel loading packet, wherein the barrier synchronization signal carries the barrier arrival mark information; then the command scheduling subunit divides the work groups in the block processing cluster, and when the divided work group tasks are executed, it can perform barrier arrival feedback processing to the task scheduling subunit based on the barrier arrival mark information to update the synchronization information in the task scheduling subunit. Finally, the barrier synchronization signal is fed back to the command processor to inform the command processor that the data synchronization operation has been performed according to the kernel loading packet.
[0171] In one embodiment, referring to Figure 12 , step S402 may further include:
[0172] In step S1201, the command scheduling sub-unit of the scheduling unit divides the work group in the block processing cluster according to the first barrier arrival mark information of the kernel loading package, and when the execution of the divided work group tasks is completed, the barrier arrival feedback processing is performed to the task scheduling sub-unit of the scheduling unit, so that the task scheduling sub-unit feeds back the barrier synchronization signal to the command processor.
[0173] In step S1201, when the operation data packet is converted from the third-level information and the operation data packet is a kernel loading packet, the command scheduling sub-unit of the scheduling unit can divide the work groups in the block processing cluster according to the first barrier arrival mark information of the kernel loading packet, and when the execution of the divided work group tasks is completed, the barrier arrival feedback processing is performed to the task scheduling sub-unit, and the task scheduling sub-unit is used to record the synchronization status of the data. Subsequently, the task scheduling sub-unit can be used to feedback the barrier synchronization signal to the command processor to inform the command processor to complete the data synchronization.
[0174] It is worth noting that in the disclosed embodiment, the command scheduling subunit provides barrier arrival feedback to the task scheduling subunit, and data synchronization is initiated by the upper-level command scheduling subunit. After updating the relevant synchronization information, the task scheduling subunit will provide feedback to the command processor to inform the upper-level command processor of the data synchronization status.
[0175] Exemplarily, the command scheduling sub-unit divides the work groups in the block processing cluster according to the first barrier arrival mark information of the kernel loading package. When three work groups need to be divided, when the work group cluster is divided into three work groups and the tasks corresponding to the three work groups are completed, the barrier arrival signal will be fed back to the task scheduling sub-unit, and then the task scheduling sub-unit can update the relevant synchronization information, and finally, it can feed back the barrier synchronization signal to the command processor according to the updated synchronization information.
[0176] For example, referring to Figure 13 , Figure 13 A signal transmission diagram for a data synchronization method that implements synchronization by sending data synchronization packets between layers is disclosed. The "Sync Engineer" in the command processor (CP) and the scheduling unit (CD) is a synchronization module, responsible for receiving and analyzing synchronization packets. TS is the task scheduling subunit in the scheduling unit (CD). DU is the data replication module, and CU is the computing unit. "CIM_packet" indicates that the command processor (CP) sends an operation data packet to the scheduling unit (CD) in the block processing cluster (BPC). In the embodiment of the present application, the operation data packet can be a "data transfer packet / kernel load packet / task load packet," such as Movedata / kernelload / taskload shown in the figure. When the data replication module completes the corresponding data transfer operation, the BPC sends a data transfer completion packet back to the CP. When the BPC completes the corresponding computing task, the BPC also sends a computing completion packet back to the CP.
[0177] like Figure 13As shown, the BPC includes four CUs, namely CU0, CU1, CU2 and CU3. During a synchronization operation, it is stipulated that CU0, CU1 and CU2 must all complete the first stage of calculation before CU3 can restart the second stage of calculation. CP sends a bo.init synchronization package to the scheduling unit, which is forwarded to the task scheduling subunit through the command scheduling subunit in the scheduling unit CD to create / initialize the synchronization object; after CU0, CU1, and CU2 complete the first-stage calculation, the bo.arrival synchronization package is sent to the task scheduling subunit through the command scheduling subunit. When all bo.arrivals are received, the waiting queue is checked. If no CU is waiting, no wake-up operation is performed temporarily; before CU3 starts the second-stage calculation, the bo.wait package is sent to the task scheduling subunit through the command scheduling subunit, and then the bo.id status of the synchronization object is checked. If the synchronization object status is found to be satisfied, a completion package is sent to CU3 to release the wait, and then the second-stage task is executed; if the status is waiting (indicating that there are still bo.arrivals that have not arrived, that is, there are still CUs that have not completed the first-stage calculation task), CU3 will continue to be in the waiting state; the above scheme is used to implement BPC-level synchronization operations.
[0178] like Figure 13As shown, during a synchronization operation, it is stipulated that all computing units must complete the first-stage tasks before they can synchronously start executing the second-stage tasks. The CP level initializes the global barrier and creates a global synchronization object ID; the CP sends a local barrier initialization bo.init synchronization package to the scheduling units of all BPCs to coordinate the CUs within each BPC to complete the first-stage tasks, or the CP sends a global blocking command, and the CP sends a bo.wait package to the scheduling units of all BPCs. The scheduling units of the BPCs suspend the distribution of the second-stage tasks to all CUs (the first-stage tasks continue to execute); at this time, all BPCs are globally blocked, but the first-stage tasks within the BPCs are still being executed; the scheduling units of the BPCs receive the bo.init synchronization package sent to initialize the local synchronization object, and then distribute it to the CUs. After the CU completes the first-phase task, it sends a bo.arrival synchronization packet to the scheduling unit. The scheduling unit counts the number of bo.arrivals. If it matches the initial value, it sends a bo.arrival synchronization packet to the CP, reporting that the BPC has completed the first-phase task. The CU receives bo.arrival synchronization packets from all BPCs. When a BPC's bo.arrival is reached, it sends a completion packet to all BPCs to unblock the BPC's scheduling unit and execute the second-phase task. This immediately resumes distributing the second-phase task to the CU, which then executes the second-phase task, achieving CP-level synchronization. Alternatively, if BPC2 requires data from BPC1 to execute a task, the CP sends an active bo.wait command to block the dependent party, BPC2, until the producer, BPC1, sends a bo.arrival to the CP, then unblocks BPC2. This also achieves CP-level synchronization.
[0179] It is worth noting that bo.wait can be actively sent by the superior to the subordinate. For example, in the above embodiment, the CP sends bo.wait to the scheduling units of all BPCs. It can also be sent by the subordinate to the superior. For example, in the above embodiment, before CU3 starts the second stage of calculation, the bo.wait package is sent to the task scheduling subunit through the command scheduling subunit.
[0180] The present disclosure also provides an electronic device 1400, including:
[0181] at least one processor, and
[0182] a memory communicatively connected to at least one processor; wherein,
[0183] The memory stores instructions, and the instructions are executed by at least one processor, so that the at least one processor implements the method as described in any one of the above embodiments of the present disclosure when executing the instructions.
[0184] The following combination Figure 14The hardware structure of the electronic device is described in detail. The electronic device includes: a processor 1410 , a memory 1420 , an input / output interface 1430 , a communication interface 1440 , and a bus 1450 .
[0185] The processor 1410 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure.
[0186] The memory 1420 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1420 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1420 and is called by the processor 1410 to execute the data synchronization method of the embodiments of the present disclosure.
[0187] Input / output interface 1430, used to implement information input and output;
[0188] Communication interface 1440, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.); and
[0189] Bus 1450 , which transmits information between various components of the device (e.g., processor 1410 , memory 1420 , input / output interface 1430 , and communication interface 1440 );
[0190] The processor 1410 , the memory 1420 , the input / output interface 1430 , and the communication interface 1440 are communicatively connected to each other within the device via a bus 1450 .
[0191] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the data synchronization method of the above embodiment, which will not be repeated here.
[0192] The terms "first," "second," "third," "fourth," and the like (if any) in the specification of the present disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present disclosure described herein, for example, can be implemented in orders other than those illustrated or described herein. In addition, the terms "comprises" and "comprising," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.
[0193] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0194] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to exclude the number itself, and above, below, within, etc. are understood to include the number itself.
[0195] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0196] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0197] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0198] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0199] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A data synchronization method, characterized in that: Applied to a chip system, the chip system includes a command processor and multiple block processing clusters, the multiple block processing clusters are data-connected to the command processor, each block processing cluster includes a scheduling unit and multiple computing units, the multiple computing units are data-connected to the scheduling unit, the data synchronization method includes: receiving a task data packet based on the command processor, wherein the task data packet includes barrier object arrival range information, and the barrier object arrival range information is used to represent the hierarchical synchronization range of the chip system; converting the task data packet into an operation data packet according to the barrier object arrival range information by the command processor; performing, by the scheduling unit, task execution processing according to the operation data packet, so that the block processing cluster performs data synchronization within the hierarchical synchronization range; The step of converting the task data packet into an operation data packet according to the barrier object arrival range information by the command processor includes: When the barrier object reach range information is first-level information, converting the task data packet into the operation data packet according to the first-level information by the command processor, wherein the first-level information represents synchronization between the command processor and the block processing cluster or synchronization between a plurality of the block processing clusters; When the barrier object reach range information is second-level information, converting the task data packet into the operation data packet according to the second-level information by the command processor, wherein the second-level information represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster; In a case where the barrier object reach range information is third-level information, the command processor converts the task data packet into the operation data packet according to the third-level information, wherein the third-level information represents synchronization within the computing unit.
2. The data synchronization method according to claim 1, characterized in that: The step of performing task execution processing according to the operation data packet by the scheduling unit includes: In a case where the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet; In a case where the operation data packet is a kernel loading packet, the scheduling unit performs task execution processing according to first barrier arrival mark information of the kernel loading packet; In a case where the operation data packet is a data transport packet, the scheduling unit performs task execution processing according to the second barrier arrival mark information of the data transport packet.
3. The data synchronization method according to claim 2, wherein: The operation data packet is obtained by converting the second-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including: In a case where the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier waiting information, the scheduling unit receives the barrier synchronization packet and enters a waiting state; When the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier initialization information, the scheduling unit initializes the value of the received barrier object, and when the barrier arrival information is received, counts the value of the barrier object. When a preset first comparison condition is met, the scheduling unit exits the waiting state.
4. The data synchronization method according to claim 2, wherein: The operation data packet is obtained by converting the second-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including: When the operation data packet is the kernel load packet and the first barrier arrival flag information of the kernel load packet indicates synchronization within the computing unit, the scheduling unit sends the first barrier arrival flag information to the corresponding computing unit so that the computing unit performs task execution processing; When the operation data packet is the kernel load packet and the first barrier arrival mark information of the kernel load packet represents synchronization within the block processing cluster or synchronization between different computing units within the same block processing cluster, the scheduling unit divides and processes the workgroup sets, workgroup clusters, and workgroups in the block processing cluster; and when the execution of the divided workgroup clusters or the workgroup tasks is completed, the command scheduling subunit of the scheduling unit generates a barrier synchronization signal and sends the barrier synchronization signal and the first barrier arrival mark information to the task scheduling subunit of the scheduling unit in the block processing cluster.
5. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the second-level information. When the operation data packet is a data transport packet, the scheduling unit performs task execution processing according to the second barrier arrival mark information of the data transport packet, including: The command scheduling subunit of the scheduling unit sends the data transport packet to the task scheduling subunit of the scheduling unit; The data replication module in the block processing cluster performs data transfer processing according to the data transfer packet, and when the data transfer is completed, performs a barrier arrival operation according to the second barrier arrival mark information, and sends a synchronization signal to the command processor.
6. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the third-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including: In a case where the operation data packet is the barrier synchronization packet and the operation type information of the barrier synchronization packet is barrier wait information, the scheduling unit sends the barrier synchronization packet to the computing unit; When the barrier arrival information is received, the task scheduling module of the computing unit counts the values of the barrier objects of the barrier synchronization packet until a preset second comparison condition is met.
7. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the third-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to first barrier arrival mark information of the kernel load packet, including: The task scheduling module of the computing unit records the first barrier arrival mark information; When the kernel in the computing unit completes the corresponding task according to the first barrier arrival mark information, a subtraction operation is performed on the value of the barrier object corresponding to the kernel load package.
8. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the second-level information. When the operation data packet is a barrier synchronization packet, the scheduling unit performs task execution processing according to the operation type information in the barrier synchronization packet, including: The computing unit sends the barrier synchronization packet to the scheduling unit, wherein the operation type information of the barrier synchronization packet is barrier initialization information, and the scheduling unit initializes the value of the received barrier object; The command scheduling subunit of the scheduling unit sends the barrier synchronization packet whose operation type information is the barrier initialization information to the task scheduling subunit of the scheduling unit; The computing unit sends the barrier synchronization packet whose operation type information is barrier waiting information to the command scheduling subunit for storage, so that the command scheduling subunit enters a waiting state; When the task corresponding to the barrier synchronization packet is completed, the task scheduling subunit feeds back a barrier arrival signal to the command scheduling subunit, and the command scheduling subunit counts the value of the barrier object until a preset third comparison condition is met; The command scheduling subunit clears the barrier synchronization packet whose operation type information is the barrier waiting information, so that the command scheduling subunit exits the waiting state.
9. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the second-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to the first barrier arrival mark information of the kernel load packet, including: The command scheduling subunit of the scheduling unit sends a barrier synchronization signal to the task scheduling subunit of the scheduling unit according to the first barrier arrival flag information of the kernel loading package, wherein the barrier synchronization signal carries the barrier arrival flag information; The command scheduling subunit divides the workgroup in the block processing cluster, and when the divided workgroup tasks are completed, the task scheduling subunit performs barrier arrival feedback processing on the task scheduling subunit according to the barrier arrival mark information, so that the task scheduling subunit feeds back a barrier synchronization signal to the command processor.
10. The data synchronization method according to claim 2, characterized in that: The operation data packet is obtained by converting the third-level information. When the operation data packet is a kernel load packet, the scheduling unit performs task execution processing according to first barrier arrival mark information of the kernel load packet, including: The command scheduling sub-unit of the scheduling unit divides the work groups in the block processing cluster according to the first barrier arrival mark information of the kernel loading package, and when the execution of the divided work group tasks is completed, the command scheduling sub-unit of the scheduling unit performs barrier arrival feedback processing to the task scheduling sub-unit of the scheduling unit, so that the task scheduling sub-unit feeds back a barrier synchronization signal to the command processor.
11. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the data synchronization method according to any one of claims 1 to 10 is realized.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data synchronization method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Multi-core processor, synchronization method for multi-core processor and corresponding product
CN114281559A
Heterogeneous computing process synchronization method and system based on barrier instruction
CN117407181A