Non-blocking graphics processor communication method and device, equipment, medium and product

By using the central processor to perform communication operations in the graphics processor calculation module, data sharing and task splitting between the computing module and the communication module are realized, which solves the problem of low GPU computing and communication efficiency and improves task execution efficiency.

CN120492387APending Publication Date: 2025-08-15PURPLE MOUNTAIN LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510656444.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, the partial overlap of GPU computing and communication time results in low computing and communication efficiency, making it difficult to effectively improve the utilization rate of GPU computing power.

Method used

By using the central processor to perform communication operations in the graphics processor calculation module, data sharing and task splitting processing between the computing module and the communication module are realized, avoiding occupancy of graphics processor resources and improving execution efficiency.

Benefits of technology

It realizes that without occupying graphics processor resources, improves task execution efficiency, reduces communication waiting time, and improves the overall efficiency of GPU computing and communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492387A_ABST
    Figure CN120492387A_ABST
Patent Text Reader

Abstract

The invention discloses a non-blocking graphics processor communication method, device and equipment, a medium and a product, and relates to the technical field of communication. The method comprises the steps of obtaining task data according to a current task, determining a target storage area corresponding to the task data in a calculation module, and storing the task data according to the target storage area; generating a communication starting signal according to the current task, and sending the communication starting signal to a communication module, so that the communication module executes communication operation according to the task data in the target storage area and the communication starting signal; wherein the communication module is executed by the central processing unit; determining an initial calculation result of the current task according to the task data, obtaining a communication operation result fed back by the communication module, and determining a target calculation result according to the initial calculation result and the communication operation result. According to the embodiment of the invention, the communication task and the calculation task are split, the communication operation only depends on the central processing unit and does not occupy the graphic processor, and the execution efficiency of the to-be-executed task is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a non-blocking graphics processor communication method, apparatus, device, medium and product. Background Art

[0002] Parallel computing using multiple graphics processing units (GPUs) is a commonly used method for accelerating artificial intelligence (AI) model training and inference. In recent years, as the number of AI model parameters continues to grow, the amount of communication between GPUs during AI model training and inference has increased, and GPU communication time has also increased. This increased GPU communication time increases GPU computing latency, which in turn reduces GPU computing power utilization.

[0003] Existing non-blocking GPU communication technology is implemented by creating independent communication streams on the same GPU card. Since GPU computing and GPU communication still use the same GPU card, GPU communication will be affected by GPU computing. Specifically, when GPU communication and GPU computing are executed overlappingly, the GPU communication time will increase significantly (compared to the GPU communication time when GPU communication is executed independently). When the GPU communication time increases to exceed the GPU computing time, the use of existing non-blocking GPU communication technology can only achieve partial overlap in the time execution of GPU computing and GPU communication, making it difficult to effectively improve the utilization of GPU computing power. Therefore, how to reduce the waiting time of GPU computing and improve the computing and communication efficiency of GPUs has become an urgent problem that needs to be solved. Summary of the Invention

[0004] The present invention provides a non-blocking graphics processor communication method, apparatus, device, medium and product to solve the problem in the prior art of partial temporal overlap between GPU computing and GPU communication, resulting in low computing and communication efficiency.

[0005] According to one aspect of the present invention, a non-blocking graphics processor communication method is provided, wherein the method is applied to a computing module accelerated by a graphics processor, and the method comprises:

[0006] Acquire task data according to the current task, determine the target storage area corresponding to the computing module for the task data, and store the task data in the target storage area;

[0007] generating a communication start signal according to the current task, and sending the communication start signal to a communication module so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal; wherein the communication module is executed by a central processing unit;

[0008] An initial calculation result of the current task is determined according to the task data, a communication operation result fed back by the communication module is obtained, and a target calculation result is determined according to the initial calculation result and the communication operation result.

[0009] According to another aspect of the present invention, a non-blocking graphics processor communication device is provided, wherein the device comprises:

[0010] A data storage module is used to obtain task data according to the current task, determine the target storage area corresponding to the calculation module for the task data, and store the task data according to the target storage area;

[0011] a communication execution module, configured to generate a communication start signal according to the current task, and send the communication start signal to the communication module, so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal; wherein the communication module is executed by a central processing unit;

[0012] The result determination module is used to determine the initial calculation result of the current task according to the task data, obtain the communication operation result fed back by the communication module, and determine the target calculation result according to the initial calculation result and the communication operation result.

[0013] According to another aspect of the present invention, an electronic device is provided, comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the non-blocking graphics processor communication method according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the non-blocking graphics processor communication method according to any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements a non-blocking graphics processor communication method according to any embodiment of the present invention.

[0019] The technical solution of the embodiment of the present invention realizes data sharing between the computing module and the communication module by acquiring task data according to the current task, determining the target storage area corresponding to the computing module for the task data, and storing the task data according to the target storage area; generates a communication start signal according to the current task, sends the communication start signal to the communication module, so that the communication module performs a communication operation according to the task data and the communication start signal in the target storage area, determines the initial calculation result of the current task according to the task data, obtains the communication operation result fed back by the communication module, and determines the target calculation result according to the initial calculation result and the communication operation result, thereby realizing the split processing of the communication task and the computing task, the communication operation only relies on the central processing unit without occupying the graphics processing unit, and improves the execution efficiency of the current task.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1 This is a flowchart of a non-blocking graphics processor communication method provided according to the first embodiment of the present invention;

[0023] Figure 2 This is a flowchart of a non-blocking graphics processor communication method provided according to the second embodiment of the present invention;

[0024] Figure 3 This is a flowchart of a non-blocking graphics processor communication method provided in accordance with a third embodiment of the present invention;

[0025] Figure 4 is a flowchart of another non-blocking graphics processor communication method provided according to embodiment 3 of the present invention;

[0026] Figure 5 2 is a schematic structural diagram of a non-blocking graphics processor communication device provided according to a fourth embodiment of the present invention;

[0027] Figure 6 The present invention is a schematic structural diagram of an electronic device for implementing a non-blocking graphics processor communication method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Example 1

[0031] Figure 1 This is a flowchart of a non-blocking GPU communication method provided according to the first embodiment of the present invention. This embodiment is applicable to reducing the waiting time caused by communication during GPU computing. The method can be performed by a non-blocking GPU communication device. The non-blocking GPU communication device can be implemented in the form of hardware and / or software. The non-blocking GPU communication device can be configured in a device using a computing module accelerated by a GPU. Figure 1 As shown, the method includes:

[0032] S110 , acquiring task data according to the current task, determining a target storage area corresponding to the computing module for the task data, and storing the task data in the target storage area.

[0033] The current task can be understood as a computing task or communication task waiting to be processed, and the number of computing tasks and communication tasks can be multiple. In actual operation, the current task can be a parallel computing task using a graphics processing unit. For example, the current task can be a task generated during AI model training and inference, such as a graphics rendering task, a deep learning task, and a data computing task. Task data refers to the data required during the execution of the current task. In actual operation, if the current task is a graphics rendering task, the task data may include but is not limited to geometric data, texture data, etc.; if the current task is a deep learning task, the task data may include but is not limited to training data, model parameters, etc.; if the current task is a data computing task, the task data may include but is not limited to numerical values, etc. In actual applications, the current task can be executed by a computing process or computing thread accelerated by a graphics processor. Generally speaking, task data can be stored in the graphics memory of the graphics processor.

[0034] The target storage area can be understood as a pre-set storage area in the memory, which is a pre-set storage location for task data. Generally speaking, the target storage area and the computing module can be one-to-one corresponding. The computing module refers to the component used to perform calculations, which is a computing module accelerated by a graphics processor. In this embodiment, the communication task can be executed by a communication process or a communication thread. In the actual operation process, for each computing process, there is a corresponding communication process, and for each computing thread, there is a corresponding communication thread. There is a corresponding target storage area between each group of communication processes and computing processes, and between each group of communication threads and computing threads.

[0035] In an embodiment, task data corresponding to the current task can be extracted from the graphics processor's video memory, and a preset storage location for the task data can be determined. The preset storage location is used as a target storage area, and the task data is stored in the target storage area. In actual operation, when the computing module is a computing thread, the target storage area can be a preset shared memory; when the computing module is a computing process, the target storage area can be a preset non-paged memory.

[0036] S120 , generating a communication start signal according to the current task, and sending the communication start signal to the communication module, so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal.

[0037] The communication initiation signal refers to an instruction signal that triggers the communication module to initiate a communication task. The communication initiation signal may be generated by the graphics processor based on the current task. In this embodiment, the communication module is used to perform communication operations. Exemplary communication operations may include, but are not limited to, data transmission, data transmission, and data reception. In one embodiment, the communication module may include a communication process or a communication thread, and the communication module is executed by the central processing unit.

[0038] In an embodiment, because multiple graphics processing units are required to perform parallel computations, each graphics processing unit needs to communicate with other graphics processing units. The communication tasks included in the current task can be determined, and a communication initiation signal generated based on the communication tasks can be sent to the central processing unit. This allows the central processing unit to retrieve task data from a preset shared memory according to the communication initiation signal and perform communication operations using the task data. In actual operation, the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task to be executed in the current task can be determined. Based on the communication operation identifier and communication operation type, corresponding communication parameters can be set. Communication routing information can be configured based on the addresses of the communication participants and the network topology. Based on the configured parameter information and in accordance with a specific communication protocol or specification, a communication initiation signal can be generated and sent to the communication module.

[0039] S130 , determining an initial calculation result of the current task according to the task data, obtaining a communication operation result fed back by the communication module, and determining a target calculation result according to the initial calculation result and the communication operation result.

[0040] Among them, the initial calculation result can be understood as the calculation result before obtaining the communication operation result fed back by the communication module. Generally speaking, there may be multiple computing tasks and communication tasks in the current task, and some computing tasks need to obtain the communication operation result before continuing to execute. The target calculation result refers to the output or conclusion obtained by the graphics processor after completing the current task, which is the execution result of the final graphics processor target. Exemplarily, the calculation result may include but is not limited to information such as image frames, changes in physical quantities, and prediction results. The communication result can be understood as the data result processed by other graphics processors and fed back by the central processing unit. In an embodiment, the computing task can be executed according to the task data to determine the initial calculation result, and the communication result fed back by the communication module can be received. The computing task continues to be executed according to the initial calculation result and the communication result until the current task is completed and the target calculation result is obtained. During the actual operation process, determine the computing tasks required in the current task, execute the computing tasks in the execution order of the computing tasks to obtain the initial computing results, then receive the communication operation results fed back by the communication module, and continue to execute other computing tasks according to the communication operation results and the initial computing results. At this time, there may be new communication tasks, and you can continue to generate a communication start signal, receive the communication operation results fed back by the communication module, and continue to execute other computing tasks according to the communication operation results and the initial computing results, until all computing tasks are completed and the target computing results are obtained.

[0041] An embodiment of the present invention realizes data sharing between the computing module and the communication module by acquiring task data according to the current task, determining the target storage area corresponding to the computing module for the task data, and storing the task data according to the target storage area; generates a communication start signal according to the current task, sends the communication start signal to the communication module, so that the communication module performs a communication operation according to the task data and the communication start signal in the target storage area, determines the initial calculation result of the current task according to the task data, obtains the communication operation result fed back by the communication module, and determines the target calculation result according to the initial calculation result and the communication operation result, thereby realizing the split processing of the communication task and the computing task, the communication operation only relies on the central processing unit without occupying the graphics processing unit, and improves the execution efficiency of the current task.

[0042] In one embodiment, the communication module performs a communication operation according to the task data in the target storage area and the communication start signal, including:

[0043] Determine the communication operation type and communication participant information corresponding to the communication start signal, and determine the task data in the target storage area as the target communication data according to the communication start signal;

[0044] The communication operation type is completed according to the target communication data and communication participant information to perform the communication operation.

[0045] The communication operation type refers to the type of the communication process. For example, the communication operation type may include, but is not limited to, sending and receiving. The communication participant information refers to descriptive information related to each party involved in the communication process. For example, the communication participant information may include, but is not limited to, the recipient's address and the recipient's identity verification information.

[0046] In an embodiment, the communication start signal can be parsed to determine the communication operation type and communication participant information corresponding to the communication start signal, and the task data in the target storage area can be determined as the target communication data through the communication start signal. The communication operation type is executed according to the target communication data and the communication participant information to complete the communication operation.

[0047] In one embodiment, before obtaining the communication operation result fed back by the communication module, the method further includes:

[0048] A communication operation completion signal is generated according to the communication operation identifier corresponding to the communication task, and the communication operation completion signal is sent to the communication module, so that the communication module feeds back a communication result after completing the communication operation.

[0049] The "wait for communication operation completion signal" can be understood as a signal that triggers the communication module to provide feedback on whether the communication operation has completed. The communication operation identifier can be a unique number assigned to each communication operation. In actual tasks, multiple communication operations may be initiated within a short period of time. Without assigning numbers to communication operations, it would be impossible to distinguish which communication operation is being waited for when the "wait for communication operation completion signal" is subsequently sent.

[0050] In an embodiment, before obtaining the communication operation result fed back by the communication module, a communication operation completion signal may be generated according to the communication operation identifier corresponding to the communication task. The communication operation completion signal may be generated and sent to the communication module, so that the communication module feeds back the communication result after completing the communication operation. In actual operation, the communication operation completion signal may be an event, a flag, or a message, and is not limited thereto.

[0051] In one embodiment, after obtaining the communication operation result fed back by the communication module, the method further includes:

[0052] The communication result is sent to the video memory of the graphics processor based on the target storage area, so that the video memory stores the communication result.

[0053] The video memory refers to a high-speed memory used to store processed or to-be-processed data. For example, the video memory can be used for graphic data and calculation results.

[0054] In an embodiment, the communication result may be sent to a video memory of a graphics processor via a target storage area, and the target calculation result may be stored via the video memory.

[0055] In one embodiment, sending the communication result to the video memory of the graphics processor based on the target storage area further includes:

[0056] When the target storage area is a preset non-paged memory, the communication result is transmitted and stored in the video memory of the graphics processor;

[0057] When the target storage area is a preset shared memory, the communication result is first transmitted to a pre-configured non-paged memory, and then the communication result in the non-paged memory is copied and stored in the video memory.

[0058] The default non-paged memory refers to a pre-set memory area marked as not being paged to disk, and the default shared memory refers to a pre-set memory area shared with the communication module. Generally speaking, when the computing module is a computing process, the target storage area is the default shared memory; when the computing module is a computing thread, the target storage area is the default non-paged memory.

[0059] In an embodiment, when the target storage area is a preset non-paged memory, the communication results in the preset non-paged memory can be directly transferred and stored in the video memory of the graphics processor; when the target storage area is a preset shared memory, the communication results are first copied to the pre-configured non-paged memory for storage, and then the communication results in the non-paged memory are copied and stored in the video memory.

[0060] Example 2

[0061] Figure 2 This is a flow chart of a non-blocking graphics processor communication method provided according to the second embodiment of the present invention. This embodiment is based on the above embodiment to further optimize and expand, and can be combined with various optional technical solutions in the above embodiment. Figure 2 As shown, the method includes:

[0062] S210 : Determine task data in the video memory of the graphics processor according to the current task.

[0063] In an embodiment, the current task may be parsed to determine task data corresponding to the current task in the graphics processor's video memory. In actual applications, the data corresponding to the current task may be queried in the graphics processor's video memory as the task data.

[0064] S220: Determine a preset storage location for the task data as a target storage area, and store the task data in the target storage area.

[0065] The target storage area includes a preset non-paged memory and a preset shared memory. In actual operation, for each current task, there may be a pre-divided preset storage location, and the preset storage location corresponding to the current task may be used as the target storage area for task data.

[0066] In an embodiment, the preset storage location of the task data can be extracted, and the preset storage location can be used as the target storage area to store the task data in the target storage area. In the actual operation process, when the computing module is a computing process, the target storage area is the preset shared memory; when the computing module is a computing thread, the target storage area is the preset non-paged memory. In the actual operation process, the task data can be directly copied to the target storage area in the preset shared memory. Alternatively, the task data can be first copied to the non-paged memory, and then the task data in the non-paged memory can be copied to the target storage area in the preset shared memory.

[0067] In one embodiment, storing the task data in the target storage area includes:

[0068] When the target storage area is the preset non-paged memory, the task data is transferred to the preset non-paged memory;

[0069] When the target storage area is the preset shared memory, the task data is first transferred to the pre-configured non-paged memory, and then the task data in the non-paged memory is copied and stored in the preset shared memory.

[0070] In actual operation, when the target storage area is determined to be the preset non-paged memory, the task data can be directly transferred to the preset non-paged memory for storage. If the target storage area is the preset shared memory, the task data can be first transferred to the pre-configured non-paged memory, and then the task data in the non-paged memory can be copied and stored in the preset shared memory to improve the stability of the task data.

[0071] S230: Determine the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task that needs to be executed in the current task.

[0072] In an embodiment, the current task can be parsed to determine the communication task to be executed in the current task, and the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task can be determined. In the actual operation process, the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task can be directly extracted.

[0073] S240: Generate a communication start signal according to the communication operation identifier, the communication operation type, the communication participant information, and the target storage area of the task data, and send the communication start signal to the communication module.

[0074] In an embodiment, corresponding communication parameters, such as Internet Protocol (IP) address, port number, protocol type, etc., can be set according to the communication operation identifier and the communication operation type. Communication routing information can be configured based on the address peak information in the communication participant information to ensure that data can be accurately transmitted from the sender to the receiver. According to the above-configured parameters and parsed information, a communication start signal is generated in accordance with a specific communication protocol or specification, and the communication start signal is sent to the communication module.

[0075] S250: Determine the computing tasks required in the current task, and execute the computing tasks in the execution order of the computing tasks to obtain initial computing results.

[0076] In an embodiment, the computing tasks required in the current task can be determined, the execution order of the computing tasks can be determined, and the computing tasks can be executed according to the execution order to obtain the initial computing results. Generally speaking, the computing task can be paused when the communication operation result is required to wait for the communication operation result to continue to execute other computing tasks.

[0077] S260: Receive the communication operation result fed back by the communication module, and continue to execute other computing tasks according to the communication operation result and the initial computing result until all computing tasks are completed and the target computing result is obtained.

[0078] In an embodiment, the communication operation result fed back by the communication module can be received, and other computing tasks can be continued to be executed according to the communication operation result and the initial calculation result. When the communication operation is needed again, the communication operation can be continued to be performed through the communication module, and the communication operation result fed back by the communication module can be received. Other computing tasks can be continued to be executed according to the communication operation result and the initial calculation result, until all computing tasks are completed and the target computing result is obtained.

[0079] In an embodiment of the present invention, task data is determined in a video memory of a graphics processor according to a current task, and a preset storage location of the task data is determined as a target storage area, and the task data is stored in the target storage area, so that a communication module can query the required target communication data in the target storage area; a communication operation identifier, a communication operation type, and communication participant information corresponding to a communication task that needs to be executed in the current task are determined, and a communication start signal is generated according to the communication operation identifier, the communication operation type, the communication participant information, and the target storage area of the task data, and the communication start signal is sent to the communication module so that the communication module can perform the communication operation; a computing task required in the current task is determined, and the computing task is executed in the execution order of the computing task to obtain an initial computing result, and the communication operation result fed back by the communication module is received, and other computing tasks are continued to be executed according to the communication operation result and the initial computing result until all computing tasks are completed and the target computing result is obtained, thereby avoiding competition between communication and computing for graphics processor resources, and thus effectively avoiding an increase in graphics processor communication time caused by competing resources.

[0080] Example 3

[0081] Figure 3 FIG. 1 is a flow chart of a non-blocking graphics processor communication method according to a third embodiment of the present invention. Figure 3 As shown in the figure, a dedicated communication process is added outside the process where the GPU computing task is located (i.e., the GPU computing process), which is used to perform communication operations based on memory data. Data is transmitted between the GPU computing process and the communication process through shared memory. Taking the GPU computing process (i.e., the computing process accelerated by the graphics processor) to perform computing tasks as an example, the communication process (only using the central processing unit) as the communication module to perform tasks as an example, and the shared memory as the target storage area as an example, a further explanation of a non-blocking graphics processor communication method is given as follows. Figure 3 As shown, the method includes:

[0082] The GPU computing process needs to choose to perform all or part of the following operations based on the type of communication operation:

[0083] Step 1: Transfer the task data in the video memory to the pre-allocated non-paged memory.

[0084] Step 2: Copy the data in the non-paged memory to the shared memory allocated in advance.

[0085] Step 3: Send a communication operation start signal to the communication process and start executing the GPU computing task at the same time.

[0086] Step 4: After the GPU computing task is completed, a signal indicating that the communication operation is complete is sent to the communication process, and then the communication process is waited for to respond.

[0087] Step 5: Copy the data obtained after executing the communication operation based on the memory data to the non-paged memory allocated in advance.

[0088] Step 6: Transfer the data in the non-paged memory to the pre-allocated video memory.

[0089] The communication process needs to do the following:

[0090] Step 7: After receiving the communication operation start signal, perform the communication operation based on the memory data.

[0091] Step 8: When a signal indicating that the communication operation is completed is received, the process waits for the communication operation to be completed, and then sends a response to the GPU computing process.

[0092] Figure 4 FIG. 1 is a flow chart of another non-blocking graphics processor communication method according to the third embodiment of the present invention. Figure 4 As shown in the figure, a dedicated communication thread is added in addition to the thread where the GPU computing task is located (i.e., the GPU computing thread), which is used to perform communication operations based on memory data. The GPU computing thread and the communication thread directly share data through non-paged memory. Taking the GPU computing thread (i.e., the computing thread using the graphics processor) to perform computing tasks, the communication thread (only using the central processing unit) as the communication module to perform tasks, and the non-paged memory as the target storage area as an example, a further explanation of a non-blocking graphics processor communication method is given as follows. Figure 4 As shown, the method includes:

[0093] The GPU computing thread needs to choose to perform all or part of the following operations based on the type of communication operation:

[0094] Step 1: Transfer the data in the video memory to the non-paged memory allocated in advance.

[0095] Step 2: Send a communication operation start signal to the communication process and start executing the GPU computing task at the same time.

[0096] Step 3: After the GPU computing task is completed, a signal indicating that the communication operation is complete is sent to the communication process, and then the communication process is waited for to respond.

[0097] Step 4: Transfer the data in the non-paged memory to the pre-allocated video memory.

[0098] The communication thread needs to do the following:

[0099] Step 5: After receiving the communication operation start signal, perform the communication operation based on the memory data.

[0100] Step 6: When a signal indicating that the communication operation is completed is received, the communication operation is waited for to be completed, and then a response is sent to the GPU computing thread.

[0101] In one embodiment, for most communication operations, the GPU computing process (thread) needs to perform all of the above operations. However, for certain communication operations, the GPU computing process (thread) only needs to perform some of the above operations. The following uses the point-to-point communication operation Send / Recv between two nodes as an example to illustrate. Assume that the GPU on node 1 is the sender and the GPU on node 2 is the receiver, and both use a non-blocking GPU communication method based on a dedicated communication process.

[0102] The GPU computing process on node 1 performs the following operations: It transfers data from video memory to pre-allocated non-paged memory. It copies data from non-paged memory to pre-allocated shared memory. It sends a start signal for the communication operation "Send" to the communication process and begins executing the GPU computing task. After the GPU computing task is completed, it sends a completion signal for the "Wait for Communication Operation Send" to the communication process and waits for a response from the communication process.

[0103] The GPU computing process on node 2 performs the following operations: It sends a start signal for the communication operation Recv to the communication process and simultaneously begins executing the GPU computing task. When the GPU computing task is completed, it sends a signal to the communication process waiting for the completion of the communication operation Recv and then waits for the communication process to respond. It then copies the data obtained from the memory-based communication operation to pre-allocated non-paged memory. It then transfers the data in the non-paged memory to the pre-allocated video memory.

[0104] This embodiment of the present invention uses shared memory as an intermediary to first move data from video memory to internal memory, then perform communication operations based on the memory data, and finally move the memory data obtained after the communication operations back to video memory. Furthermore, dedicated communication processes or threads are used to perform communication operations based on memory data, without interfering with the normal execution of GPU computing tasks.

[0105] Example 4

[0106] Figure 5 Schematic diagram of a non-blocking graphics processor communication device according to the fourth embodiment of the present invention. Figure 5 As shown, the device includes: a data storage module 51, a communication execution module 52 and a result determination module 53.

[0107] Among them, the data storage module 51 is used as a data storage module, which is used to obtain task data according to the current task, determine the target storage area corresponding to the task data in the calculation module, and store the task data according to the target storage area;

[0108] a communication execution module 52 for generating a communication start signal according to the current task and sending the communication start signal to the communication module so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal; wherein the communication module is executed by the central processing unit;

[0109] The result determination module 53 is used to determine the initial calculation result of the current task according to the task data, obtain the communication operation result fed back by the communication module, and determine the target calculation result according to the initial calculation result and the communication operation result.

[0110] In an embodiment of the present invention, a data storage module obtains task data according to a task to be executed, determines a target storage area for the task data in a preset shared memory of a graphics processor, and stores the task data according to the target storage area, thereby realizing data sharing between the graphics processor and the central processing unit; a communication execution module generates a communication start signal according to the task to be executed, and sends the communication start signal to the central processing unit so that the central processing unit performs a communication operation according to the task data in the preset shared memory and the communication start signal, determines a calculation result of the task to be executed according to the task data of the result determination module, obtains a communication result fed back by the central processing unit, and determines a target calculation result according to the calculation result and the communication result, thereby realizing split processing of the communication task and the calculation task, wherein the communication operation only relies on the central processing unit without occupying the graphics processing unit, thereby improving the execution efficiency of the task to be executed.

[0111] In one embodiment, the data storage module 51 includes:

[0112] a data determination unit, configured to determine task data in a video memory of a graphics processor according to a current task;

[0113] The data storage unit is used to determine a preset storage location of the task data as a target storage area and store the task data in the target storage area; wherein the target storage area includes a preset non-paged memory and a preset shared memory.

[0114] In one embodiment, the data storage unit is specifically configured to:

[0115] When the target storage area is the preset non-paged memory, the task data is transferred to the preset non-paged memory;

[0116] When the target storage area is the preset shared memory, the task data is first transferred to the pre-configured non-paged memory, and then the task data in the non-paged memory is copied and stored in the preset shared memory.

[0117] In one embodiment, the communication execution module 52 includes:

[0118] An information determination unit, which determines the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task to be executed in the current task;

[0119] The data sending unit determines to generate a communication start signal according to the communication operation identifier, the communication operation type, the communication participant information and the target storage area of the task data, and sends the communication start signal to the communication module.

[0120] In one embodiment, the non-blocking graphics processor communication apparatus further includes:

[0121] A data determination module is used to determine the communication operation type and communication participant information corresponding to the communication start signal, and determine the task data in the target storage area as the target communication data according to the communication start signal;

[0122] The communication execution module is used to complete the communication operation type according to the target communication data and the communication participant information to execute the communication operation.

[0123] In one embodiment, the result determination module 53 includes:

[0124] The initial result determination unit is used to determine the computing tasks required in the current task, and execute the computing tasks in the execution order of the computing tasks to obtain the initial computing results;

[0125] The target result determination unit is used to receive the communication operation result fed back by the communication module, and continue to execute other computing tasks according to the communication operation result and the initial computing result until all computing tasks are completed and the target computing result is obtained.

[0126] In one embodiment, the non-blocking graphics processor communication apparatus further includes:

[0127] The result feedback module is used to generate a communication operation completion signal according to the communication operation identifier corresponding to the communication task, and send the communication operation completion signal to the communication module so that the communication module can feedback the communication result after completing the communication operation.

[0128] In one embodiment, the non-blocking graphics processor communication apparatus further includes:

[0129] The result storage module is used to send the communication result to the video memory of the graphics processor based on the target storage area, so that the video memory stores the communication result.

[0130] In one embodiment, the result storage module includes:

[0131] A first result storage unit, configured to transfer and store the communication result to a video memory of a graphics processor when the target storage area is a preset non-paged memory;

[0132] The second result storage unit is used to first transmit the communication result to the pre-configured non-paged memory when the target storage area is the preset shared memory, and then copy the communication result in the non-paged memory and store it in the video memory.

[0133] The non-blocking graphics processor communication device provided in the embodiment of the present invention can execute the non-blocking graphics processor communication method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0134] Example 5

[0135] Figure 6 1 is a block diagram of an electronic device that implements a non-blocking graphics processor communication method according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0136] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0137] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0138] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the non-blocking graphics processor communication method.

[0139] In some embodiments, the non-blocking graphics processor communication method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the non-blocking graphics processor communication method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the non-blocking graphics processor communication method in any other suitable manner (e.g., via firmware).

[0140] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0144] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0145] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0146] In one embodiment, the present invention further includes a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the non-blocking graphics processor communication method of any embodiment of the present invention is implemented.

[0147] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0148] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0149] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A non-blocking graphics processor communication method, characterized in that: Applied to a computing module accelerated by a graphics processor, the method includes: Acquire task data according to the current task, determine the target storage area corresponding to the computing module for the task data, and store the task data in the target storage area; generating a communication start signal according to the current task, and sending the communication start signal to a communication module so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal; wherein the communication module is executed by a central processing unit; An initial calculation result of the current task is determined according to the task data, a communication operation result fed back by the communication module is obtained, and a target calculation result is determined according to the initial calculation result and the communication operation result.

2. The method according to claim 1, characterized in that Acquiring task data according to the current task, determining a target storage area corresponding to the computing module for the task data, and storing the task data in the target storage area includes: Determining task data in the video memory of the graphics processor according to the current task; A preset storage location of the task data is determined as a target storage area, and the task data is stored in the target storage area; wherein the target storage area includes a preset non-paged memory and a preset shared memory.

3. The method according to claim 2, characterized in that The storing the task data in the target storage area includes: When the target storage area is a preset non-paged memory, transferring the task data to the preset non-paged memory; When the target storage area is a preset shared memory, the task data is first transferred to a pre-configured non-paged memory, and then the task data in the non-paged memory is copied and stored in the preset shared memory.

4. The method according to claim 1, wherein The generating a communication start signal according to the current task and sending the communication start signal to the communication module includes: Determining the communication operation identifier, communication operation type, and communication participant information corresponding to the communication task to be executed in the current task; A communication start signal is generated according to the communication operation identifier, the communication operation type, the communication participant information and the target storage area of the task data, and the communication start signal is sent to the communication module.

5. The method according to claim 1, wherein The communication module performs a communication operation according to the task data in the target storage area and the communication start signal, including: determining a communication operation type and communication participant information corresponding to the communication start signal, and determining the task data in the target storage area as target communication data according to the communication start signal; The communication operation type is completed according to the target communication data and the communication participant information to perform the communication operation.

6. The method according to claim 1, characterized in that The determining the initial calculation result of the current task according to the task data, obtaining the communication operation result fed back by the communication module, and determining the target calculation result according to the initial calculation result and the communication operation result, includes: Determine the computing tasks required in the current task, and execute the computing tasks in the execution order of the computing tasks to obtain initial computing results; Receive the communication operation result fed back by the communication module, and continue to execute other computing tasks according to the communication operation result and the initial computing result until all the computing tasks are completed and the target computing result is obtained.

7. The method according to claim 1, characterized in that Before obtaining the communication operation result fed back by the communication module, the method further includes: A communication operation completion signal is generated according to the communication operation identifier corresponding to the communication task, and the communication operation completion signal is sent to the communication module, so that the communication module feeds back a communication result after completing the communication operation.

8. The method according to claim 1, characterized in that After obtaining the communication operation result fed back by the communication module, the method further includes: The communication result is sent to a video memory of a graphics processor based on the target storage area, so that the video memory stores the communication result.

9. The method according to claim 8, characterized in that The sending of the communication result to the video memory of the graphics processor based on the target storage area further includes: When the target storage area is a preset non-paged memory, transmitting and storing the communication result to the video memory of the graphics processor; When the target storage area is a preset shared memory, the communication result is first transmitted to a pre-configured non-paged memory, and then the communication result in the non-paged memory is copied and stored in the video memory.

10. A non-blocking graphics processor communication device, characterized in that: include: A data storage module is used to obtain task data according to the current task, determine the target storage area corresponding to the calculation module for the task data, and store the task data according to the target storage area; a communication execution module, configured to generate a communication start signal according to the current task, and send the communication start signal to the communication module, so that the communication module performs a communication operation according to the task data in the target storage area and the communication start signal; wherein the communication module is executed by a central processing unit; The result determination module is used to determine the initial calculation result of the current task according to the task data, obtain the communication operation result fed back by the communication module, and determine the target calculation result according to the initial calculation result and the communication operation result.

11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform a non-blocking graphics processor communication method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a non-blocking graphics processor communication method according to any one of claims 1 to 9 when executed.

13. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements a non-blocking graphics processor communication method according to any one of claims 1 to 9.