A method for heterogeneous calling of the 3D computing power of GPUs through API software

Through the API software, the three-dimensional computing capability method of heterogeneously calling the GPU, and the virtualization encapsulation and demand pool division, the problem of insufficient resource allocation speed and flexibility when traditional API calls GPU resources is solved, and efficient GPU resource calls are achieved.

CN118626228BActive Publication Date: 2025-06-13DEEP THINKING COMPUTER (QINGDAO) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410819776.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2025-06-13
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

The traditional API calls GPU computing resources with insufficient resource allocation speed and flexibility, especially when there are many requests, real-time GPU resource calls cannot be realized.

Method used

The method of heterogeneously calling GPU three-dimensional computing power through API software includes virtualizing and encapsulating the computing power of the API calling GPU process, dividing single-precision, double-precision and vector computing requirements pools, and providing them to remote users through the network for decompression and decomposition, realizing demand operations for different remote users.

Benefits of technology

It improves the ability to remotely call GPUs through API for three-dimensional computing, enhances the speed and flexibility of resource provisioning, and realizes real-time GPU resource calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626228B_ABST
    Figure CN118626228B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of GPU computing in computers and relates to a method for heterogeneously invoking the 3D computing capabilities of a GPU through API software, comprising the following steps: S1. Calculate the capabilities of the API to call the GPU process, including command storage, loading, and encoding and parsing. Among them, the data interaction channel is heterogeneously processed by software to perform virtual encapsulation; S2. According to the needs of users, the single-precision calculation, double-precision calculation, and vector calculation requirement pools are respectively divided and marked to form calculation packages; S3. Provide them to remote users through the network. The remote users decompress and decompose the encapsulated calculation package process to realize the demand operations for different remote users. The advantages of the present invention are as follows: Regardless of the classification requirements of any type, they will be encapsulated through this network protocol, and then the compatibility of the network transmission protocol is improved, and computing power is calculated based on the needs of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for heterogeneous calling of GPU three-dimensional computing capabilities through API software, belonging to the field of GPU computing in computers. Background Art

[0002] If a user needs to call GPU computing power resources, the current technical implementation is to call GPU computing power resources through a physical machine.

[0003] Generally, the server capacity, computing power and scale are limited, and the traditional scheduling window is in a fixed mode. In the case of a large number of requests, users often need to load data onto the server in advance and wait in line, which makes it impossible to call GPU resources in real time. Therefore, the traditional GPU calling method requires users to deploy on-site, which greatly affects the resource allocation speed and flexibility. In the traditional method of calling GPU computing power resources through API, when the GPU is driven, tasks that can be recognized by the GPU hardware need to be generated and sent to the kernel for scheduling and execution. During the process of remote deployment and execution of tasks, data and command loading are serial, which exacerbates the stacking of queuing phenomena and further limits the resource allocation speed and flexibility. Summary of the Invention

[0004] To overcome the defects of the traditional API calling technology, the present invention provides a method for heterogeneous calling of GPU three-dimensional computing capabilities through API software.

[0005] The technical solution of the present invention is as follows:

[0006] A method for heterogeneous calling of GPU three-dimensional computing capabilities through API software, comprising the following steps:

[0007] S1. Calculate the computing capabilities of the API calling GPU process, including command storage, loading and encoding parsing. Among them, the data interaction channel is software heterogeneous and virtualized and encapsulated.

[0008] S2. According to the user's needs, divide the single-precision calculation, double-precision calculation, and vector calculation requirement pools respectively, make marks, and form calculation packages.

[0009] S3. Provide it to remote users through the network. The remote users decompress and decompose the encapsulated calculation package process to realize the demand calculation for different remote users.

[0010] The specific step S1 is: Based on the Vulkan network protocol, select evenly according to the number of times of calling the GPU process per minute and the load capacity balance. The size of the encapsulated communication package is 13.6M, and a unit of 5-6 seconds is used for resource segmentation and used in the form of an encapsulated process.

[0011] The specific steps of step S2 are as follows:

[0012] (1) Calculate the calculation identifiers for user requirements: Assume that the total number of identifiers for the total user requirements is q. Divide and label the single-precision calculation, double-precision calculation, and vector calculation requirement pools. The label is e, and it is denoted as e according to the number of labels 1 、e 2 、e 3 ……e n ;

[0013] (2) Establish a matrix: q is the order, q = n × r, where n is the number of rows and r is the number of columns for different calculation types; r 1 、r 2 、r 3 、……r i ,r 1 indicates mainly single-precision calculation; r 2 indicates mainly double-precision calculation; r 3 indicates mainly vector calculation; r i indicates other calculation amounts. Calculate the transformation coefficient w respectively. Its value will have at least three intervals, denoted as importing the corresponding set segmentation system according to the demand-side strategy. The calculation method is:

[0014] w = Σβen + Σδer

[0015] In the calculation method, β is the interval coefficient, β = 3 / i; δ is the computing power coefficient, δ = (Σr3 / Σri);

[0016] (3) According to the demand-side strategy of the remote user, adjust the computing power end resources to the corresponding computing clusters to cope with scenarios with different computing focus capabilities;

[0017] (4) Package the segmented calculation packages into standard TCP / IP protocol packages, send them to each API interface at the computing power end respectively, and return the calculation results;

[0018] (5) Combine the calculation results in reverse according to the segmentation system into the final calculation result.

[0019] In step S2, the GPU calculates the computing power requests of the remote user through the standard protocol, determines the demands of the user for single-precision calculation, double-precision calculation, and vector calculation; then, according to the load status of the GPU board itself, calculates the idle time slots matched by the GPU, and calls the idle computing resources to complete the matched computing tasks.

[0020] In the virtualization encapsulation in step S1, specifically, it is achieved by: in the API call process, constructing a virtual process, and simultaneously constructing a data channel module, a command storage module, a data parsing module, and a computing power calculation module to implement multi-threading of the process; the data channel module is used to provide data transmission; the command storage module is used for storing instructions, the data parsing module is used for parsing data; the computing power calculation module is used for calculating computing power.

[0021] The data channel module organizes and manages the process of data transmission, transmits the data to the GPU and reads it into the memory, and prepares the instructions for the GPU.

[0022] The command storage module is used to store all commands in the process in the command storage module, and after setting the attributes of various commands, send them to the command queue.

[0023] The data parsing module is a converter used to convert data into binary format.

[0024] The computing power calculation module is used to pool and separate the single-precision calculation, double-precision calculation, and vector calculation requirements in the remote GPU call task and make identifications, and at the same time calculate the computing power requests of remote users, determine the user's demand for single-precision calculation, double-precision calculation, and vector calculation, and then calculate the idle time slots matched by the GPU according to the load status of the GPU board itself, and determine the scheduling scheme of the GPU.

[0025] The advantages of the present invention are: regardless of the classification requirements of any type, this network protocol will encapsulate through this virtual process method, thereby greatly improving the ability to remotely call the GPU through the API for three-dimensional calculation. Brief Description of the Drawings

[0026] Figure 1 It is a flowchart of the present invention. Detailed Embodiment

[0027] The present invention will be further described below in conjunction with specific embodiments, and the advantages and features of the present invention will become clearer with the description. However, these embodiments are only exemplary and do not constitute any limitation to the scope of the present invention. Those skilled in the art should understand that without departing from the spirit and scope of the present invention, the details and forms of the technical solution of the present invention can be modified or replaced, but these modifications and replacements all fall within the protection scope of the present invention.

[0028] The present invention relates to a method for heterogeneous software call of GPU three-dimensional calculation ability through API, including the following steps:

[0029] S1. Calculate the computing power of the GPU process for API calls, including command storage, loading, and encoding parsing. Among them, software heterogeneity is performed on the data interaction channel to virtualize and encapsulate it;

[0030] Among them, software heterogeneity is mainly completed through the following steps, including:

[0031] (1). Obtain the application software and automatically identify the language type of the application software based on the software recognition algorithm;

[0032] When heterogeneous processing is required for the application software, first obtain the application software that needs to be heterogeneously processed, and then identify the application software according to the software recognition algorithm to automatically identify the specific language type of the application software, which is convenient for the next heterogeneous processing. Among them, the application software for heterogeneous processing can be application software developed based on C, C++, PHP, SQL, python, etc.

[0033] (2). Filter the code that has nothing to do with the keywords of the application software and output the keywords of the application software; after obtaining the application software that needs to be heterogeneously processed, filter the code that has nothing to do with the keywords of the application software and output the keywords of the application software.

[0034] (3). Perform tagging processing on the keywords of the application software based on the language type of the application software; then, according to the identified language type of the application software and the output keywords of the application software, perform tagging processing on the keywords of the application software. By performing tagging processing on the keywords of the application software, the code of the application software is heterogeneous, which results in the invalidation of most existing application software attacks and enhances the security of the application software.

[0035] (4). Perform diversified compilation processing on the application software based on the language type of the application software. It is also possible to perform diversified compilation processing on the application software according to the identified language type of the application software. By performing diversified compilation processing on the application software, the code of the application software is heterogeneous, which results in the invalidation of most existing application software attacks and enhances the security of the application software.

[0036] The specific step S1 is as follows: Based on the Vulkan network protocol, select evenly according to the number of times the API calls the GPU process per minute and the load capacity, encapsulate the size of the communication packet as 13.6M, and use resource segmentation with a call process duration of 5 - 6 seconds as a unit, and use it in the form of an encapsulated process.

[0037] In the virtualization encapsulation in step S1, specifically, it is achieved by: in the API call process, constructing a virtual process, and simultaneously constructing a data channel module, a command storage module, a data parsing module, and a computing power calculation module to implement multi-threading of the process; the data channel module is used to provide data transmission; the command storage module is used to store instructions, the data parsing module is used to parse data; the computing power calculation module is used to calculate computing power.

[0038] S2. According to the user's requirements, divide the single-precision calculation, double-precision calculation, and vector calculation requirement pools respectively and make marks to form calculation packages;

[0039] S3. Provide them to remote users through the network, and the remote users decompress and decompose the encapsulated calculation package process to realize the demand operations for different remote users.

[0040] The specific content of step S2 is as follows:

[0041] Calculate the calculation marks of the user's requirements: Assume that the total number of marks for the user's total requirements is q. Divide the single-precision calculation, double-precision calculation, and vector calculation requirement pools respectively and make marks, and the mark is e, and record it as e 1 、e 2 、e 3 ……e n ;

[0042] (2) Establish a matrix: q is the order, q = n × r, where n is the number of rows and r is the number of columns of different calculation types; r 1 、r 2 、r 3 、……r i ,r 1 indicates mainly single-precision calculation; r 2 indicates mainly double-precision calculation; r 3 indicates mainly vector calculation; r i indicates other calculation amounts, and calculate the transformation coefficient w respectively. Its value has at least three intervals, which are recorded as importing the corresponding set segmentation system according to the demand-side strategy. The calculation method is:

[0043] w = Σβen + Σδer

[0044] In the calculation method, β is the interval coefficient, β = 3 / i; δ is the computing power coefficient, δ = Σr3 / Σri;

[0045] (3) According to the demand-side strategy of the remote user, adjust the computing power end resources to the corresponding computing clusters to cope with scenarios with different computing focus capabilities;

[0046] (4) Package the segmented computing packages into standard TCP / IP protocol packages, and send them to each API interface at the computing power end respectively, and return the computing results to the calling end;

[0047] (5) Combine the computing results in the reverse order of the segmentation system into the final computing result.

[0048] In the step S2, the GPU calculates the computing power requests of remote users through a standard protocol, determines the demands of users for single-precision computing, double-precision computing, and vector computing; then, according to the load status of the GPU board itself, calculates the idle time slots matched by the GPU, and calls the idle computing resources to complete the matched computing tasks.

[0049] The data channel module organizes and manages the process of data transmission, transmits the data to the memory read by the GPU, and prepares the instructions of the GPU.

[0050] The main function of the data channel module is to organize and manage the process of data transmission. The main tasks of this process are to transmit the necessary data to the memory that the GPU can read, and to prepare the instructions of the GPU, including: (1) data upload; (2) program parsing, data compilation, and program linking; (3) VBO data upload.

[0051] The command storage module is used to store all commands in the process in the command storage module, and send them to the command queue after setting the attributes of various commands.

[0052] The data parsing module is a converter, which is used to convert data into binary format.

[0053] The computing power calculation module is used to pool and separate the demands for single-precision computing, double-precision computing, and vector computing in the remote GPU call task and make marks. At the same time, it calculates the computing power requests of remote users, determines the demands of users for single-precision computing, double-precision computing, and vector computing, and then calculates the idle time slots matched by the GPU according to the load status of the GPU board itself, and determines the scheduling scheme of the GPU.

[0054] Regardless of the type of classification requirements, they will be encapsulated through this network protocol in this virtual process manner, thus greatly improving the ability to remotely call the GPU through the API for three-dimensional computing.

[0055] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.

Claims

1. A method for heterogeneously calling GPU three-dimensional computing capabilities through API software, comprising the following steps, characterized in that: The following steps are involved: S1. The computing capability of API calls to GPU processes, including command storage, loading and encoding analysis, where the data interaction channel is software heterogeneous to enable virtualization and encapsulation; S2. According to user needs, the single-precision calculation, double-precision calculation, and vector calculation demand pools are divided and marked to form calculation packages; The step S2 is specifically as follows: (1) Calculate the calculation identifier of user demand: Assume that the total number of identifiers of total user demand is q, divide the single-precision calculation, double-precision calculation, and vector calculation demand pools and make identifiers, the identifier is e, and the identifiers are recorded as e1, e2, e3, ..., e according to the number of identifiers. n ; (2) Establish a matrix: q is the order, q = n × r, where n is the number of rows and r is the number of columns for different types of calculations; r1, r2, r3, ... r i , r1 means single-precision calculation is the main method; r2 means double-precision calculation is the main method; r3 means vector calculation is the main method; i Represents other calculation quantities, and calculates the transformation coefficient w respectively. Its value will have at least three intervals, which are recorded as the corresponding set segmentation system imported according to the demand-side strategy. The calculation method is: w=Sve n +Sde r The Σ in the calculation method represents the sum, β is the interval coefficient, β=3 / i; δ is the computing power coefficient, δ=Σr3 / Σr i ;e n represents the pool level, where n = 1, 2, 3, ...; e r The number of columns representing different types of calculations, i.e., the specific value of r; (3) According to the demand-side strategy of remote users, computing power resources are adjusted to the corresponding computing cluster to cope with scenarios with different computing emphasis capabilities; (4) Encapsulate the split computing packages into standard TCP / IP protocol packages, send them to the various API interfaces of the computing power end, and return the computing results to the calling end; (5) The calculation results are reversely combined according to the segmentation system to obtain the final calculation results; The GPU calculates the computing power request of the remote user through the standard protocol to determine the user's demand for single-precision computing, double-precision computing, and vector computing; then, according to the load status of the GPU board itself, it calculates the idle time slots matched by the GPU and calls the idle computing resources to complete the matching computing tasks. S3. Provide it to remote users through the network. Remote users decompress and decompose the encapsulated computing package process to realize the required calculations for different remote users.

2. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 1, characterized in that: The step S1 is specifically as follows: based on the Vulkan network protocol, according to the number of calculations of the API calling the GPU process per minute and the load capacity balancing selection, the size of the encapsulated communication packet is 13.6M, and the calling process duration is 5-6 seconds as a unit to divide the resources and use them in the encapsulated process mode; The software heterogeneity is mainly completed through the following steps, including: (1) Obtaining application software and automatically identifying the language type of the application software based on a software recognition algorithm; When it is necessary to perform heterogeneous processing on application software, first obtain the application software that needs to be processed heterogeneously, then identify the application software according to the software identification algorithm, and automatically identify the specific language type of the application software to facilitate the next step of heterogeneous processing. Among them, the application software that needs to be processed heterogeneously is the application software developed based on C, C++, PHP, SQL, and Python; (2) Filtering the codes irrelevant to the keywords of the application software and outputting the keywords of the application software; after obtaining the application software that needs to be processed heterogeneously, filtering the codes irrelevant to the keywords of the application software and outputting the keywords of the application software; (3) Based on the language type of the application software, the application software keywords are labeled; then, according to the identified language type of the application software and the output application software keywords, the application software keywords are labeled. By labeling the application software keywords, the application software code is made heterogeneous, thereby rendering most existing application software attacks invalid and enhancing the security of the application software. (4) Based on the language type of the application software, the application software is compiled in a diversified manner. Based on the identified language type of the application software, the application software is compiled in a diversified manner. By compiling the application software in a diversified manner, the application software code is made heterogeneous, thereby rendering most existing application software attacks invalid and enhancing the security of the application software.

3. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 1, characterized in that: In the virtualization encapsulation in step S1, specifically: in the API calling process, a virtual process is constructed, and a data channel module, a command storage module, a data parsing module and a computing power calculation module are constructed at the same time to realize the multi-threading of the process; the data channel module is used to provide data transmission; the command storage module is used to store instructions, and the data parsing module is used to parse data; the computing power calculation module is used to calculate computing power.

4. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 3, characterized in that: The data channel module organizes and manages the data transmission process, transmits the data to the GPU, reads it into the memory, and prepares the GPU instructions.

5. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 3, characterized in that: The command storage module is used to set attributes for all commands in the process and store them in the command storage module, and send them to the command queue to wait for execution.

6. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 3, characterized in that: The data parsing module is a converter used to convert data into binary format.

7. The method for heterogeneously calling GPU three-dimensional computing capabilities through API software according to claim 3, characterized in that: The computing power calculation module is used to separate and mark the single-precision calculation, double-precision calculation, and vector calculation requirements in the remote GPU call task, and at the same time calculate the computing power request of the remote user to determine the user's demand for single-precision calculation, double-precision calculation, and vector calculation. Then, according to the load status of the GPU board itself, the idle time slot matching the GPU is calculated to determine the GPU scheduling plan.

Citation Information

Patent Citations

  • GPU computing power pool intelligent management method and system

    CN117971475A

  • Computing power resource processing method

    CN118069380A