A method and apparatus for accelerating GPU kernel startup speed
By adding a kernel parameter register and initializing the program counter register in the GPU instruction scheduling unit, the delay problem caused by serial memory access during the GPU kernel startup process is solved, and the kernel startup speed is improved.
Patent Information
- Application Number
- CN202410874910.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-02
AI Technical Summary
There are three serial memory access operations during the startup process of the GPU kernel, resulting in high latency and affecting response speed.
In the GPU instruction scheduling unit, the kernel parameter pointer register and the kernel parameter size register are added. In response to receiving the kernel distribution package, the program counter register and the kernel parameter register are initialized, and instructions and data prefetch requests are issued at the same time to reduce memory access time.
By processing the process of fetching kernel instructions and fetching kernel parameters in parallel, one memory access operation is reduced and the startup speed of the kernel is significantly improved.
Smart Images

Figure CN118409807B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a method and device for accelerating GPU kernel startup. Background Art
[0002] The graphics processing unit (GPU) was originally a chip designed specifically for accelerating 3D graphics processing. However, due to its powerful floating-point computing capabilities and flexible programmability, GPU has gradually become a general-purpose computing accelerator and is widely used in scientific computing, artificial intelligence, cryptocurrency and other fields. Today, GPU has become a veritable general-purpose computing processor.
[0003] As a coprocessor, the GPU can only passively accept computing tasks assigned by the CPU. These tasks are called kernel functions or simply kernels. The CPU notifies the GPU to start the kernel by sending a kernel-dispatch AQL packet (kernel distribution packet based on the AQL architecture queuing language) to the GPU. The entire process requires multiple round trips between the host main memory and the device video memory, which slows down the device's response speed.
[0004] A typical kernel startup process includes: the programmer manually calls the memcpy function to copy data from host memory to device memory, and then calls the launch kernel function to notify the GPU driver to start the kernel. The GPU driver enters the kernel startup process. The GPU driver assembles the kernel object in the host memory and copies it to the device memory. The kernel object contains all the code, and initializes the kernel arguments buffer in the memory on the device side. After the preparation is completed, the driver sends a kernel-dispatch AQL packet (kernel distribution package based on the AQL architecture queuing language) to the device to notify the device to start the kernel. After receiving the kernel-dispatchAQL packet (kernel distribution package based on AQL architecture queuing language), the device starts to allocate computing resources to the kernel and initializes the PC (program counter) register according to the kernel object ptr (kernel object pointer) in the packet. Then the instruction fetch unit requests instructions from the device memory according to the address pointed to by the PC register. The first instruction is usually to load kernel arguments and send the instructions to the memory access unit. The memory access unit requests kernel arguments from host memory. When the kernel arguments are retrieved back to the register, the kernel startup process is officially completed and the GPU starts to execute computing tasks.
[0005] The whole process involves three serial memory access operations. The first is when the host sends data, code, and kernel startup commands to the device. The second is when the GPU core retrieves instructions from the device memory. The third is when the memory access unit retrieves kernel arguments from the device memory according to the address given by the instruction. These serial memory accesses with dependencies between the front and back bring high latency to the kernel cold start.
[0006] Therefore, how to improve the GPU kernel startup speed is an urgent problem to be solved. Summary of the invention
[0007] The object of the present invention is to provide a method and device for accelerating GPU kernel startup speed, so as to at least partially solve the above-mentioned problem.
[0008] According to one aspect of the present disclosure, a method for accelerating GPU kernel startup speed is proposed, comprising:
[0009] In the GPU instruction scheduling unit, a kernel parameter pointer register and a kernel parameter size register are added. The kernel parameter pointer register is used to store the starting address of the kernel parameters, and the kernel parameter size register is used to store the size of the space occupied by the kernel parameters.
[0010] In response to receiving the kernel distribution package based on the AQL architecture queuing language, the resource management unit of the GPU initializes a program counter register, a kernel parameter pointer register, and a kernel parameter size register based on the content of the kernel distribution package based on the AQL architecture queuing language,
[0011] The GPU instruction dispatch unit sends the first instruction fetch request to the first-level instruction cache based on the current PC value of the program counter register, and sends a kernel parameter data prefetch request to the first-level data cache based on the kernel parameter pointer register and the kernel parameter size register.
[0012] After both requests are confirmed, the instructions begin to be executed and the normal kernel operation process begins.
[0013] In some embodiments, the method also includes, before initializing the program counter register, the kernel parameter pointer register and the kernel parameter size register, the driver sends a kernel distribution package based on the AQL architecture queuing language to the control processor on the device to notify the device to start the kernel.
[0014] In some embodiments, the method also includes controlling the processor to parse the kernel distribution package based on the AQL architecture queuing language and obtain at least the initialization variable values of the kernel parameter pointer and the kernel parameter size, and send them to the workload manager, wherein the workload manager initializes the kernel parameter pointer register and the kernel parameter size register in the GPU instruction scheduling unit according to the initialization variable values.
[0015] In some embodiments, the method further includes: the first-level instruction cache responds to the first value request to retrieve the current first instruction and cache subsequent instructions, and the first-level data cache responds to the kernel parameter data prefetch request to retrieve the kernel parameters from the host side and cache them.
[0016] In some embodiments, the method further includes the GPU instruction scheduling unit sending a first instruction to the computing unit, the first instruction being a load instruction for loading kernel parameters from the host memory, the load instruction loading the kernel parameters retrieved from the host side in the first-level data cache.
[0017] According to another aspect of the present disclosure, a device for accelerating GPU kernel startup speed is provided, comprising:
[0018] an initialization module, configured to, in response to receiving a kernel distribution package based on the AQL architecture queuing language, initialize a program counter register, a kernel parameter pointer register, and a kernel parameter size register according to the content of the kernel distribution package based on the AQL architecture queuing language by a resource management unit of the GPU;
[0019] The kernel parameter pointer register and kernel parameter size register are located in the GPU instruction scheduling unit. The kernel parameter pointer register is used to store the starting address of the kernel parameters, and the kernel parameter size register is used to store the size of the space occupied by the kernel parameters.
[0020] The request module is used for the GPU instruction scheduling unit to issue the first instruction fetch request to the first-level instruction cache based on the current PC value of the program counter register, and to issue a kernel parameter data prefetch request to the first-level data cache based on the kernel parameter pointer register and the kernel parameter size register.
[0021] The execution module is used to start executing instructions and enter the normal kernel operation process after both requests are confirmed.
[0022] In some embodiments, the device also includes a notification module, which is used to, before initializing the program counter register, the kernel parameter pointer register and the kernel parameter size register, also includes a driver sending a kernel distribution package based on the AQL architecture queuing language to the control processor on the device to notify the device to start the kernel.
[0023] In some embodiments, the device also includes an initialization module, and also includes a control processor to parse the kernel distribution package based on the AQL architecture queuing language and obtain at least the initialization variable values of the kernel parameter pointer and the kernel parameter size, and send them to the workload manager, and the workload manager initializes the kernel parameter pointer register and the kernel parameter size register in the GPU instruction scheduling unit according to the initialization variable values.
[0024] In some embodiments, the device also includes a response module, which is used for the first-level instruction cache to respond to the first value request to retrieve the current first instruction and cache subsequent instructions, and the first-level data cache to respond to the kernel parameter data prefetch request to retrieve the kernel parameters from the host side and cache them.
[0025] In some embodiments, the device also includes a loading module, which is used for the GPU instruction scheduling unit to send a first instruction to the computing unit, the first instruction is a loading instruction for loading kernel parameters from the host memory, and the loading instruction loads the kernel parameters retrieved from the host side in the first-level data cache.
[0026] The invention discloses a method for accelerating the GPU kernel startup speed. The instruction schedule unit (ISU, instruction schedule uint) of the GPU adds a kernel parameter pointer and a kernel parameter size register. When the CP (Command Processor, control processor) receives a kernel startup request, the WLM (Workload Manager, workload manager) initializes the two registers according to the specific content of the request. When the ISU sends the first fetch request to the storage subsystem, it also sends a request to load the kernel parameters. When the first instruction starts to execute, the kernel parameters are also loaded, and the kernel is successfully started. The method changes the serial process of fetching the first instruction of the kernel and fetching the kernel parameters into parallel, reducing the memory access time once, and changing the operation of transferring the kernel parameters from the host memory to the device memory, which is responsible for the software, to the hardware, further reducing the delay, thereby further accelerating the kernel startup speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a method for accelerating GPU kernel startup speed provided in an embodiment of the present application.
[0028] Figure 2 A schematic diagram of the structure of a device for accelerating GPU kernel startup speed provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0030] Embodiment 1
[0031] Specifically, see Figure 1 , which is a method for accelerating GPU kernel startup speed provided by the present disclosure. The basic implementation process of this embodiment is as follows:
[0032] Step S1, adding a kernel arguments ptr (kernel parameter pointer) register and a kernel arguments size (kernel parameter size) register in the GPU instruction scheduling unit, wherein the kernel arguments ptr (kernel parameter pointer) register is used to store the starting address of the kernel arguments (kernel parameters), and the kernel arguments size (kernel parameter size) register is used to store the size of the space occupied by the kernel arguments (kernel parameters).
[0033] In one possible implementation, when designing the system, a kernel arguments ptr register and a kernel arguments size register are added to the instruction scheduling unit (ISU, instructionschedule uint, used to send instructions to the execution unit in a reasonable order) of the GPU. The former stores the starting address of the kernel arguments, and the latter stores the size of the space occupied by the kernel arguments. Usually, starting a kernel means scheduling and executing the kernel on the GPU. This process is usually asynchronous, that is, when starting a kernel on the CPU, the CPU will not wait for the kernel to complete, but will return immediately and continue to execute subsequent code. Kernel arguments are some parameters required for the GPU to start the kernel.
[0034] Step S2, in response to receiving kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language), the resource management unit of the GPU initializes a PC (program counter) register, a kernelarguments ptr (kernel parameter pointer) register, and a kernel arguments size (kernel parameter size) register based on the content of the kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language).
[0035] Following the above step S1, after receiving kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language), the resource management unit (RM) of the GPU initializes the PC (program counter) register, kernel arguments ptr (kernel parameter pointer) register and kernel argumenst size (kernel parameter size) register according to the content of kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language).
[0036] In step S3, the GPU instruction scheduling unit sends the first instruction fetch request to the first-level instruction cache (IL1, instruction level 1 cache) based on the current PC value of the program counter register, and at the same time sends a kernel arguments data prefetch request to the first-level data cache (KL1, constant level 1 cache) based on the kernel argumentsptr (kernel parameter pointer) register and the kernel arguments size (kernel parameter size) register. After both requests are confirmed, the instruction execution begins and the normal kernel operation process begins.
[0037] In one possible implementation, the ISU sends the first instruction fetch request to the first-level instruction cache (IL1) according to the current PC value, and at the same time sends a kernel arguments data prefetch request to the first-level data cache (KL1) according to the kernel arguments ptr register and the kernel argumentssize register. After both requests are confirmed, the instruction execution begins and the normal kernel operation process begins.
[0038] The present invention changes the process of fetching instructions and kernel arguments during GPU kernel startup from serial to parallel, which is equivalent to reducing one memory access operation and significantly improving the kernel startup speed, especially for smaller kernels.
[0039] The present invention is further described below in conjunction with the accompanying drawings and the process of AMD GPU calculating vectorAdd. It should be clear that the vectorAdd described below is only a typical embodiment of the present application, and the present application scheme is not limited to this embodiment.
[0040] Code Listing 1:
[0041] __global__ void vectorAdd(int* a, int* b, int* c) {
[0042] int tid = blockIdx.x * blockDim.x + threadIdx.x;
[0043] c[tid] = a[tid] + b[tid];
[0044] }
[0045] int main() {
[0046] / / Copy the vector from the host to the device
[0047] cudaMemcpy(d_a, h_a, size * sizeof(int), cudaMemcpyHostToDevice);
[0048] cudaMemcpy(d_b, h_b, size * sizeof(int), cudaMemcpyHostToDevice);
[0049] / / Call the kernel function to add vectors
[0050] vectorAdd<<<gridSize, blockSize> >>(d_a, d_b, d_c);
[0051] / / Copy the results from the device back to the host
[0052] cudaMemcpy(h_c, d_c, size * sizeof(int), cudaMemcpyDeviceToHost);
[0053] }
[0054] Listing 1 above is the vectorAdd program running on the GPU, which is used to calculate the sum of vectors and store the result in a vector. In this code, the programmer first uses the cudaMemcpy function to copy data from hostmemory to device memory, and then calls the template function vectorAdd<<<gridSize, blockSize> >>(d_a,d_b, d_c) enters the kernel startup process. After the kernel is executed, cudaMemcpy is used to copy the calculation results from device memory back to hostmemory.
[0055] When the lunchkernel function is called, the recompilation function of the heterogeneous compiler is triggered first. In addition to compiling the kernel function from the intermediate code into the machine code on the device side, the compiler also inserts the instructions of the kernel arguments obtained from the host memory into the header of the machine code according to the kernel calling convention. The address of the kernel arguments is determined by the calling convention. Listing 2 is the assembly code generated by the compilation of the kernel function in Listing 1. Some details that have no effect on performance are omitted. The assembly instructions in the header are responsible for loading the kernel arguments from the host memory into the register.
[0056] Code Listing 2:
[0057] load a
[0058] load b
[0059] load c
[0060] mad tid, blockIdx.x, blockDim.x, threadIdx.x
[0061] load a[tid]
[0062] load b[tid]
[0063] add c[tid], a[tid], b[tid]
[0064] store c[tid]
[0065] Next, the driver embeds the machine code into the kernel object and copies the kernel object to device memory. Then, the driver initializes the kernel arguments buffer, and the structure of the kernel arguments buffer follows the kernel calling convention. Because multiple devices are supported, the kernel arguments buffer needs to be placed in host memory.
[0066] The driver sends kernel-dispatch AQL (Architected Queueing Language) packets to the CP (Command Processor, a term invented by AMD, which refers to the top-level control unit on the GPU, controlling all aspects of the GPU, equivalent to the general manager of the GPU) on the device, notifying the device to start the kernel. Kernel-dispatch AQL packets contain information such as the starting address and size of the kernel arguments buffer and the starting address and size of the kernel object. Then, the CP (control processor) parses kernel-dispatch AQL packets (kernel distribution packets based on the AQL architecture queuing language) and sends the obtained variables such as kernel_arguments_ptr (kernel parameter pointer), kernel_arguments_size (kernel parameter size), kernel_object_ptr (kernel object pointer) to WLM (Workload Manager, a term invented by AMD, which is under the management of CP and is responsible for handling the reasonable allocation of computing tasks to the computing units of the GPU). In the traditional kernel startup process, the CP (control processor) does not need to send kernel_arguments_ptr (kernel parameter pointer) and kernel_arguments_size (kernel parameter size).
[0067] WLM (Workload Manager) initializes registers such as kernel_arguments_ptr (kernel parameter pointer), kernel_arguments_size (kernel parameter size), PC (program counter) in SQ (sequencer, a component of ISU) in ISU (instruction scheduling unit) according to the values of kernel_arguments_ptr (kernel parameter pointer), kernel_arguments_size (kernel parameter size), and kernel_object_ptr (kernel object pointer). The traditional SQ (queueer) does not have kernel_arguments_ptr (kernel parameter pointer) register and kernel_arguments_size (kernel parameter size) register.
[0068] The SQ (queue) sends an instruction fetch request to IL1 (level 1 instruction cache) based on the value of the PC (program counter) register, and sends a data cache fetch request to KL1 (level 1 data cache) based on the values of the kernel_arguments_ptr (kernel parameter pointer) and kernel_arguments_size (kernel parameter size) registers. In the traditional kernel startup process, the SQ (queue) only needs to send an instruction fetch request to IL1 (level 1 instruction cache).
[0069] IL1 (Level 1 instruction cache) responds to requests to retrieve the current instruction and cache subsequent instructions, and KL1 (Level 1 data cache) responds to requests to retrieve and cache kernel args (kernel parameters) from the host side. In the traditional kernel boot process, KL1 (Level 1 data cache) only waits.
[0070] The SQ (queue) sends the first instruction to the CU (computering unit). According to the kernel calling convention, the first instruction must be a load instruction to load kernel arguments from host memory. Because KL1 (level 1 data cache) has cached kernel arguments, this load instruction must hit KL1 (level 1 data cache). In the traditional kernel startup process, this load instruction must not hit KL1 (level 1 data cache). Therefore, the startup time of the GPU kernel is greatly shortened by the solution disclosed in the present invention.
[0071] In summary, the present invention effectively solves the delay problem of GPU kernel startup. There are four time-consuming steps in the GPU kernel startup process. The first is to send kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language) from the host side to the CP (Command Processor) on the device side; the second is that the CP (control processor) initializes the GPU computing core, including allocating computing resources and initializing various registers; the third is that the SQ (sequencer) requests the first instruction from the memory subsystem and sends it to the execution unit CU (computering unit); the fourth is that the CU (computing unit) requests the kernel arguments (kernel parameters) located in the host memory (host memory) from the memory subsystem. The four serial processes take about 3~4 us. The present disclosure changes the serial memory access of fetching instructions and fetching kernel arguments (kernel parameters) in the kernel startup process to parallel memory access, and changes the process of loading kernel argumets (kernel parameters) from software to a combination of software and hardware, thereby reducing the startup delay of the GPU kernel (kernel) and improving the response speed of the gpu.
[0072] Embodiment 2
[0073] To achieve the above purpose, this embodiment proposes a device for accelerating the GPU kernel startup speed. For details, please refer to Figure 2 ,include,
[0074] an initialization module, configured to, in response to receiving kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language), initialize a PC (program counter) register, a kernel argumentsptr (kernel parameter pointer) register, and a kernel arguments size (kernel parameter size) register of a resource management unit of a GPU based on the contents of kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language),
[0075] The kernel arguments ptr (kernel parameter pointer) register and the kernel arguments size (kernel parameter size) register are located in the GPU instruction scheduling unit. The kernel arguments ptr (kernel parameter pointer) register is used to store the starting address of the kernel arguments (kernel parameters), and the kernel arguments size (kernel parameter size) register is used to store the size of the space occupied by the kernel arguments (kernel parameters).
[0076] The request module is used for the GPU instruction scheduling unit to issue the first instruction fetch request to the first-level instruction cache (IL1) based on the current PC value of the PC (program counter) register, and to issue a kernel arguments data prefetch request to the first-level data cache (KL1) based on the kernel arguments ptr (kernel parameter pointer) register and the kernel arguments size (kernel parameter size) register.
[0077] The execution module is used to start executing instructions and enter the normal kernel operation process after both requests are confirmed.
[0078] In some embodiments, the apparatus further includes a notification module for, before initializing a PC (program counter) register, a kernel arguments ptr (kernel parameter pointer) register, and a kernel arguments size (kernel parameter size) register, the driver also includes sending kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language) to a command processor on the device to notify the device to start the kernel.
[0079] In some embodiments, the device also includes an initialization module, and also includes a command processor that parses kernel-dispatch AQL packets (kernel distribution packets based on AQL architecture queuing language) and obtains at least initialization variable values of kernel arguments ptr (kernel parameter pointer) and kernel arguments size (kernel parameter size), and sends them to a workload manager (workload manager), and the workload manager initializes the kernel argumentsptr (kernel parameter pointer) register and the kernel arguments size (kernel parameter size) register in the GPU instruction scheduling unit according to the initialization variable values.
[0080] In some embodiments, the device also includes a response module, which is used for the first-level instruction cache to respond to the first value request to retrieve the current first instruction and cache subsequent instructions, and the first-level data cache to respond to the kernel arguments data prefetch request to retrieve the kernel arguments from the host side and cache them.
[0081] In some embodiments, the device also includes a loading module, which is used for the GPU instruction scheduling unit to send a first instruction to the computing unit, and the first instruction is a load instruction for loading kernel arguments from the host memory, and the load instruction loads the kernel arguments retrieved from the host side in the first-level data cache.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0085] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
Claims
1. A method for accelerating GPU kernel startup speed, characterized in that: The method comprises: In the GPU instruction scheduling unit, a kernel parameter pointer register and a kernel parameter size register are added. The kernel parameter pointer register is used to store the starting address of the kernel parameters, and the kernel parameter size register is used to store the size of the space occupied by the kernel parameters. In response to receiving a kernel dispatch data packet based on the AQL architecture queuing language, a load management unit of the GPU initializes a program counter register, a kernel parameter pointer register, and a kernel parameter size register according to the content of the kernel dispatch data packet based on the AQL architecture queuing language, The GPU instruction dispatch unit sends the first instruction fetch request to the first-level instruction cache based on the current PC value of the program counter register, and sends a kernel parameter data prefetch request to the first-level data cache based on the kernel parameter pointer register and the kernel parameter size register. After both requests are confirmed, the instructions begin to be executed and the normal kernel operation process begins.
2. The method according to claim 1, characterized in that: Before initializing the program counter register, the kernel parameter pointer register and the kernel parameter size register, the driver sends a kernel distribution data packet based on the AQL architecture queuing language to the control processor on the device to notify the device to start the kernel.
3. The method according to claim 2, characterized in that: The control processor parses the kernel distribution data packet based on the AQL architecture queuing language and obtains at least the initialization variable values of the kernel parameter pointer and the kernel parameter size, and sends them to the workload manager. The workload manager initializes the kernel parameter pointer register and the kernel parameter size register in the GPU instruction scheduling unit according to the initialization variable values.
4. The method according to any one of claims 1 to 3, characterized in that: The first-level instruction cache responds to the first instruction fetch request to retrieve the current first instruction and cache subsequent instructions, and the first-level data cache responds to the kernel parameter data prefetch request to retrieve the kernel parameters from the host side and cache them.
5. The method according to claim 4, characterized in that: The GPU instruction scheduling unit sends the first instruction to the computing unit. The first instruction is a load instruction for loading kernel parameters from the host memory. The load instruction loads the kernel parameters retrieved from the host side in the first-level data cache.
6. A device for accelerating GPU kernel startup speed, characterized in that: The device comprises: an initialization module, configured to, in response to receiving a kernel distribution data packet based on the AQL architecture queuing language, initialize a program counter register, a kernel parameter pointer register, and a kernel parameter size register according to the content of the kernel distribution data packet based on the AQL architecture queuing language by a resource management unit of the GPU, The kernel parameter pointer register and kernel parameter size register are located in the GPU instruction scheduling unit. The kernel parameter pointer register is used to store the starting address of the kernel parameters, and the kernel parameter size register is used to store the size of the space occupied by the kernel parameters. The request module is used for the GPU instruction scheduling unit to issue the first instruction fetch request to the first-level instruction cache based on the current PC value, and to issue a kernel parameter data prefetch request to the first-level data cache based on the kernel parameter pointer register and the kernel parameter size register. The execution module is used to start executing instructions and enter the normal kernel operation process after both requests are confirmed.
7. The device according to claim 6, characterized in that The device also includes: The notification module is used to, before initializing the program counter register, the kernel parameter pointer register and the kernel parameter size register, also include a driver sending a kernel distribution data packet based on the AQL architecture queuing language to the control processor on the device to notify the device to start the kernel.
8. The device according to claim 7, characterized in that The device also includes: The initialization module also includes a control processor to parse the kernel distribution data packet based on the AQL architecture queuing language and obtain at least the initialization variable values of the kernel parameter pointer and the kernel parameter size, and send them to the workload manager. The workload manager initializes the kernel parameter pointer register and the kernel parameter size register in the GPU instruction scheduling unit according to the initialization variable values.
9. The device according to any one of claims 6 to 8, characterized in that: The device also includes: The response module is used for the first-level instruction cache to respond to the first instruction fetch request to retrieve the current first instruction and cache subsequent instructions, and the first-level data cache responds to the kernel parameter data prefetch request to retrieve the kernel parameters from the host side and cache them.
10. The device according to claim 9, characterized in that The device also includes: The loading module is used for the GPU instruction scheduling unit to send the first instruction to the computing unit. The first instruction is a loading instruction for loading kernel parameters from the host memory. The loading instruction loads the kernel parameters retrieved from the host side in the first-level data cache.
Citation Information
Patent Citations
System service concurrent calling method in microkernel
CN115480904A
Distributed Kernel Thread List Processing for Kernel Patching
US20160328310A1
