Pseudo kernel mode implementation method and system adaptive to POCL and GPU performance simulators and storage medium

Through the pseudo-kernel state implementation method, the problem that the GPU performance simulator cannot simulate the hardware functions and performance of the application layer code is solved, and the combination of POCL and GPU performance simulator is realized, providing more efficient performance simulation and optimization solutions, improving the The accuracy and usability of the simulator.

CN119149323APending Publication Date: 2024-12-17SHENZHEN ZHONGWEIDIAN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411167087.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Existing GPU performance simulators cannot accurately simulate the GPU hardware functions and performance mapped by application layer code, and POCL cannot be used with GPU performance simulators and cannot be adapted and supported.

Method used

By designing pseudo-kernel state implementation methods, including receiving, processing, issuing and returning steps, processing command categories such as hardware attribute acquisition, kernel operation, Memory operation and Event operation, and using SMD as the intermediate layer to realize POCL and GPU performance simulators Adapt to provide more efficient and reliable solutions.

Benefits of technology

It realizes accurate simulation and performance analysis of OpenCL applications, expands the application scope of GPU performance simulator, improves the usability and practicality of performance simulators, optimizes the execution efficiency of parallel computing and deep learning tasks, and solves existing technologies. accuracy and performance issues in.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149323A_ABST
    Figure CN119149323A_ABST
Patent Text Reader

Abstract

The invention provides a pseudo kernel mode implementation method and system adaptive to POCL and GPU performance simulators, and a storage medium. A driver SMD adaptive to the simulator executes the following steps: a receiving step: receiving a command issued by a user mode; a processing step: processing the received command; an issuing step: issuing the processed command to a GPU performance simulator; and a return step: returning a return value and a parameter after the GPU performance simulator finishes running to the SMD, processing the return value and the parameter by the SMD, and returning the data to a user state. The method has the advantages that by overcoming the defects in the prior art and achieving the advantages of accuracy improvement, performance optimization, expandability, flexibility and the like, a more efficient and reliable solution is provided for achieving the pseudo kernel mode adaptive to POCL and GPU performance simulators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a pseudo-kernel state implementation method, system and storage medium adapted to POCL and a GPU performance simulator. Background Art

[0002] The GPU performance simulator simulates the functions and performance of the physical GPU in the form of software applications based on the hardware configuration. Its advantages are high flexibility, which can simulate the performance of each GPU according to the GPU configuration; strong controllability in operation, which can interrupt and jump out when the GPU simulator is running; and high ease of use, which can be used through simple environment configuration. Based on the above advantages, its application scenarios exist in GPU architecture design and verification, which can shorten the development cycle of GPU chips and save R&D costs.

[0003] In existing GPU performance simulators, when the mounted hardware is set to GPU simulator, it is impossible to simulate and evaluate the hardware performance mapped by the application layer code (such as OpenCL application). In addition, POCL cannot be used in the GPU simulator environment. That is, the open source parallel computing framework based on the OpenCL API standard cannot be used in conjunction with the GPU performance simulator.

[0004] In summary, the defects of the prior art are:

[0005] 1. Existing GPU performance simulators cannot accurately simulate the GPU hardware functions and performance mapped by the application layer code. In terms of function, they cannot complete the running of OpenCL / OpenGL and other applications on the simulator; in terms of performance, they cannot complete the user layer, kernel layer, and hardware layer performance data collection and performance analysis of OpenCL / OpenGL and other applications.

[0006] 2. As an open source OpenCL implementation, POCL has a wide range of OpenCL device support and good portability. However, it is currently unable to adapt and support GPU performance simulators developed by software. Summary of the invention

[0007] The present invention provides a pseudo kernel state implementation method for adapting POCL and GPU performance simulator, wherein the driver SMD of the simulator performs the following steps:

[0008] Receiving step: receiving the command issued by the user mode;

[0009] Processing steps: process the received command;

[0010] Sending step: Send the processed command to the GPU performance simulator;

[0011] Return step: After the GPU performance simulator runs, the return value and parameters are returned to the SMD, which then processes the data and returns it to the user state.

[0012] As a further improvement of the present invention, in the processing step, the command categories processed by the SMD include: hardware attribute acquisition, kernel operation, Memory operation and Event operation.

[0013] As a further improvement of the present invention, the application layer program first enters the user state, and then enters the kernel state through the external interface of the user state, and the kernel state includes SMD.

[0014] As a further improvement of the present invention, in user mode, if it is an OpenCL application, POCL is selected.

[0015] As a further improvement of the present invention, the kernel state also includes a real hardware driver KMD.

[0016] As a further improvement of the present invention, in the processing steps, a loop judgment method is used to classify the issued commands, and the parameter structure in the command API is parsed and converted, involving structure transfer and new structure construction: for the variable with an address in the structure parameter, the content pointed to by the address is read, parsed or converted; for the variable with a numerical value in the structure parameter, the value is transferred; for the variable with a string type of structure parameter, a command type numerical value is defined, the type is converted, and the address is taken.

[0017] As a further improvement of the present invention, in the return step, the processing performed by the SMD includes identification of the return execution status flag, acquisition of the return value, and acquisition of the return address, wherein the execution status flag is divided into successful execution and unsuccessful execution, and its status can be obtained in the user state; return value acquisition refers to the return of parameters in numerical form executed by the GPU performance simulator; return address acquisition involves the return of the first address of the memory operation, which is checked and converted by the SMD.

[0018] The present invention also provides a pseudo-kernel state implementation system adapted to POCL and GPU performance simulators, comprising: a memory, a processor, and a computer program stored on the memory, wherein the computer program is configured to implement the steps of the pseudo-kernel state implementation method of the present invention when called by the processor.

[0019] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the pseudo-kernel state implementation method of the present invention when called by a processor.

[0020] The beneficial effects of the present invention are as follows: the present invention overcomes the defects of the prior art and achieves advantages such as improved accuracy, performance optimization, scalability and flexibility. The method of the present invention provides a more efficient and reliable solution for pseudo-kernel state implementation of adapting POCL and GPU performance simulators. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the present invention;

[0022] Figure 2 It is a schematic diagram of the pseudo kernel state implementation method of the present invention. DETAILED DESCRIPTION

[0023] like Figure 1 As shown, the present invention discloses a pseudo kernel state implementation method for adapting POCL and GPU performance simulator, including application layer (Application), user state (UMD), kernel state (KMD) and hardware (Device). The operation logic sequence is: the application layer program first enters UMD (if it is an OpenCL application, POCL is selected), and then the KMD layer can be entered through the external interface MVP_DRM_Interface in UMD. Then KMD is divided into a real hardware driver KMD and an SMD adapted to the simulator. As a pseudo kernel state implementation designed by the present invention, SMD is used to send data and commands to the GPU performance simulator and obtain return parameters.

[0024] like Figure 2 As shown, SMD performs the following steps:

[0025] Receiving step: receiving the command issued by the user mode;

[0026] Processing steps: process the received commands; use the loop judgment method to classify the issued commands. Parse and convert the parameter structure in the command API, involving structure transfer and new structure construction: for variables with addresses in the structure parameters, read, parse or convert the content pointed to by the address; for variables with numerical values ​​in the structure parameters, pass the value; for variables with string type in the structure parameters, define command-type values, perform type conversion, and take addresses. For example, under the kernellaunch command: the dimensions of the work group and work item, the parameters of the three axes x, y, and z are all numerical types, and they are numerically passed to the GPU performance simulator in SMD; the kernel function is in the form of an address, and SMD needs to look up the table to parse the content of the address, encode and convert it into a string, and then pass it to the GPU performance simulator.

[0027] Sending step: Send the processed command to the GPU performance simulator;

[0028] Return step: After the GPU performance simulator runs, the return value and parameters are returned to the SMD, which is then processed by the SMD. The processing is divided into the identification of the return execution status flag, the return value acquisition, and the return address acquisition. Among them, the execution status flag is divided into successful execution and unsuccessful execution, and the user state can obtain its status; the return value acquisition refers to the parameter return in the form of a numerical value executed by the GPU performance simulator; the address type refers to the return of the first address of the memory operation, which is checked and converted by the SMD, such as the first address of the calculation result. Finally, the data is returned to the user state.

[0029] After the command is issued by MVP_DRM_Interface, SMD converts the parameter structure, receives, processes and issues the command with the design idea of ​​multiple branch connections. In SMD, the main command categories are: hardware attribute acquisition; kernel operation; memory operation and event operation. Each command category has its corresponding code implementation. After the parameters and commands are issued to the GPU performance simulator (MVPGPU-Sim), the GPU performance simulator confirms and receives them, and completes the function. After the operation is completed, the return value and parameters are returned to SMD, which then processes the data and returns it to the upper UMD.

[0030] The present invention can realize the operation of OpenCL applications on GPU performance simulators. Through the operation of OpenCL applications, the hardware mechanism performance, operation data and performance analysis of the application can be obtained from the simulator. It provides a reference and demonstration for the iterative optimization of the GPU chip architecture layer.

[0031] The present invention can break through the barriers between POCL and GPU performance simulators and realize the joint use of the two. For high-performance computing applications, the method provides a new implementation path for program optimization, thereby improving the execution efficiency of computationally intensive tasks. In the fields of scientific computing, meteorological simulation, financial modeling, etc., this method can be used to optimize parallel computing tasks.

[0032] The present invention can play a role in the fields of artificial intelligence and machine learning. Through the combination of POCL, pseudo kernel state and GPU performance simulator, performance analysis of neural network calculation and model training process can be realized. It provides data and direction support for accelerating deep learning tasks and improving the training and reasoning speed of models.

[0033] The present invention can simulate and evaluate the hardware performance mapped by the application layer code running on the actual GPU hardware, expanding the application scope of the GPU performance simulator; at the same time, it solves the problem that POCL only supports the use of actual hardware. Through development and testing, it solves the problems of other current GPU performance simulators running too long and having inaccurate simulation results.

[0034] Beneficial effects of the present invention:

[0035] 1. Functional integrity construction: The method of the present invention can open up the use link between the POCL open source heterogeneous computing framework and the GPU performance simulator. It broadens the scope of use of POCL and the GPU performance simulator and improves the usability and practicality of the performance simulator. Compared with the existing GPU performance simulator, this method can provide command-level testing in pseudo-kernel state, more accurately simulate the hardware execution behavior and performance indicators mapped by the application layer code, and provide more accurate performance evaluation results.

[0036] 2. Performance optimization: By adapting POCL and GPU performance simulator, the method of the present invention can simulate different hardware and achieve hardware-level performance optimization in the field of parallel computing. On the other hand, by analyzing and optimizing the running application layer code, the execution efficiency and parallel computing capability of the application code can be improved, thereby accelerating the running speed of the application.

[0037] 3. Scalability: The method of the present invention has good scalability and can be applied to different GPU performance simulators and POCL versions. No matter which GPU performance simulator is used, the method of the present invention can be adapted and integrated to achieve accurate simulation of the hardware behavior and efficiency mapped by the application layer code.

[0038] 4. Flexibility: The method of the present invention can be customized and adjusted according to different needs and scenarios. According to specific application requirements, the appropriate POCL version and GPU performance simulator, as well as strategies and technologies for performance optimization can be flexibly selected.

[0039] The present invention overcomes the defects of the prior art and achieves advantages such as improved accuracy, performance optimization, scalability and flexibility. The method of the present invention provides a more efficient and reliable solution for pseudo-kernel state implementation of adapting POCL and GPU performance simulators.

[0040] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A pseudo-kernel state implementation method adapted to POCL and GPU performance simulator, It is characterized in that The driver SMD of the adapter simulator performs the following steps: Receiving step: receiving the command issued by the user mode; Processing steps: process the received command; Sending step: Send the processed command to the GPU performance simulator; Return step: After the GPU performance simulator runs, the return value and parameters are returned to the SMD, which then processes the data and returns it to the user state.

2. The pseudo kernel state implementation method according to claim 1, It is characterized in that In the processing steps, the command categories processed by SMD include: hardware attribute acquisition, kernel operation, memory operation and event operation.

3. The pseudo kernel state implementation method according to claim 1 or 2, It is characterized in that The application layer program first enters the user state, and then enters the kernel state through the external interface of the user state. The kernel state includes SMD.

4. The pseudo kernel state implementation method according to claim 3, It is characterized in that In user mode, if it is an OpenCL application, select POCL.

5. The pseudo kernel state implementation method according to claim 3, It is characterized in that Kernel state also includes the actual hardware driver KMD.

6. The pseudo kernel state implementation method according to claim 1, It is characterized in that In the processing steps, a loop judgment method is used to classify the issued commands, and the parameter structure in the command API is parsed and converted, involving structure transfer and new structure construction: for variables with addresses in the structure parameters, the content pointed to by the address is read, parsed or converted; for variables with numerical values ​​in the structure parameters, value transfer is performed; for variables with string type structure parameters, command type numerical values ​​are defined, type conversion is performed, and addresses are taken.

7. The pseudo kernel state implementation method according to claim 1, It is characterized in that In the return step, the processing performed by SMD includes identification of the return execution status flag, acquisition of the return value, and acquisition of the return address, wherein the execution status flag is divided into successful execution and unsuccessful execution, and its status can be obtained in the user state; return value acquisition refers to the return of parameters in numerical form executed by the GPU performance simulator; return address acquisition involves the return of the first address of memory operations, which is checked and converted by SMD.

8. A pseudo-kernel state implementation system adapted to POCL and GPU performance simulator, It is characterized in that include: A memory, a processor and a computer program stored in the memory, wherein the computer program is configured to implement the steps of the pseudo kernel state implementation method according to any one of claims 1 to 7 when called by the processor.

9. A computer-readable storage medium, Features: The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the pseudo-kernel state implementation method according to any one of claims 1 to 7 when called by a processor.