Thread resource scheduling method, device and medium for GPGPU system

By applying genetic algorithms in the GPGPU system to adaptively generate execution configurations, the problem of low computing resource utilization in the GPGPU system when executing complex simulation modeling tasks is solved, and efficient computing resource utilization and task processing performance are achieved.

CN118796401BActive Publication Date: 2025-01-21YUANQIXIN (SHANDONG) SEMICONDUCTOR TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411280960.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-01-21
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

When existing GPGPU systems perform complex simulation modeling tasks, the computing resource utilization rate is not high, and thread blocks and thread scheduling strategies rely too much on manual participation, resulting in low efficiency and high cost of scheduling methods, which affects task processing progress and user experience.

Method used

A genetic algorithm is used to adaptively generate the execution configuration of the GPGPU. By dividing the data set of the target modeling model into a preset Cartesian coordinate system, the parallel segmentation tasks are determined, and the preset genetic algorithm function is used to generate a population corresponding to the target GPGPU device. Chromosome,optimizes thread block execution configurations to improve,computing resource utilization.

Benefits of technology

The optimal execution configuration is generated through the genetic algorithm, which significantly improves the utilization of GPGPU computing resources, improves the processing efficiency and performance of parallel segmentation tasks of the target modeling model, reduces the need for manual configuration, and maintains good flexibility and scalability. sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796401B_ABST
    Figure CN118796401B_ABST
Patent Text Reader

Abstract

This application provides a thread resource scheduling method, device, and medium for GPGPU systems, belonging to the field of computer technology. The method divides the dataset of a target model into a Cartesian coordinate system to determine the parallel segmentation task for the corresponding model subplane. Based on the initial thread block execution configuration, a preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device; wherein, in the preset genetic algorithm function, the thread block execution configuration of each kernel in the target GPGPU device is a chromosome; the chromosomes corresponding to a target GPGPU device constitute the population chromosome; based on the preset kernel function, the population chromosome, and the parallel segmentation task, the individual fitness of each individual is determined; based on the individual fitness and a preset iteration termination condition, a selected thread block execution configuration is determined, so that the target GPGPU device processes the parallel segmentation task according to the selected thread block execution configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a thread resource scheduling method, device and medium for a general-purpose computing on graphics processing units (GPGPU) system. Background Art

[0002] In today's complex and ever-changing real-world computing scenarios, task requirements are often complex and diverse, accompanied by high deployment and trial-and-error costs. These challenges have led to the widespread application of simulation modeling technology, especially in areas that have strict requirements on accuracy, efficiency, and cost.

[0003] In highly parallel simulation modeling tasks such as spatial 3D modeling, traditional central processing unit (CPU) computing can no longer meet its huge data processing needs. Therefore, GPGPU has become the preferred platform for such tasks with its powerful parallel processing capabilities.

[0004] However, to fully utilize the performance advantages of GPGPU to perform the above tasks, the problem of efficient utilization of computing resources must be solved. In GPGPU, the utilization of compute units (CU) and stream multiprocessors (SM) directly determines the overall performance. Reasonable thread block and thread scheduling strategies are the key to optimizing utilization, and existing scheduling methods often rely on manual experience and repeated trials.

[0005] However, complex applications, diverse data sets, and different data flow patterns pose great challenges to scheduling design. In addition, different models of GPGPUs have different hardware characteristics and optimization space, which further increases the difficulty of finding the best execution configuration for a specific application. This makes existing scheduling methods inefficient and costly, and it is impossible to balance GPGPU performance and input costs, which affects the progress of task processing and brings a poor user experience. Summary of the invention

[0006] To solve the above problems, embodiments of the present application provide a thread resource scheduling method, device and medium for a GPGPU system.

[0007] On the one hand, an embodiment of the present application provides a thread resource scheduling method for a GPGPU system, the method comprising:

[0008] Dividing the data set of the target modeling model into a preset Cartesian coordinate system to determine a parallel segmentation task of a model sub-plane corresponding to the target modeling model; the model sub-plane includes data points corresponding to the data set in the same selected plane;

[0009] Based on the initial thread block execution configuration, a preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device; wherein the thread block execution configuration of each kernel in the target GPGPU device in the preset genetic algorithm function is a chromosome respectively; and each of the chromosomes corresponding to one of the target GPGPU devices constitutes a population chromosome;

[0010] Determine the individual fitness of each corresponding individual based on the preset kernel function, the population chromosome, and the parallel segmentation task;

[0011] Based on the individual fitness and the preset iteration end condition, a selected thread block execution configuration is determined to enable the target GPGPU device to process the parallel split task according to the selected thread block execution configuration.

[0012] In one implementation of the present application, based on the initial thread block execution configuration, a preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device, specifically including:

[0013] After receiving the initial thread block execution configuration from the user terminal, configuring the target GPGPU device according to the initial thread block execution configuration; wherein the initial thread block execution configuration includes the number of thread blocks corresponding to each dimension of the thread block and the number of threads corresponding to each dimension in the thread block;

[0014] The preset genetic algorithm function is called to configure the thread block execution corresponding to each kernel in the target GPGPU device as the population chromosome.

[0015] In one implementation of the present application, based on the preset kernel function, the population chromosome, and the parallel segmentation task, the individual fitness of each corresponding individual is determined, specifically including:

[0016] According to the population chromosome, the parallel segmentation task is allocated to the target GPGPU device to execute the preset kernel function to obtain a task execution result;

[0017] Based on the task execution result, determining the core power consumption delay product corresponding to each core;

[0018] The individual fitness of the corresponding individual is determined according to the core power consumption delay product; the core power consumption delay product is in inverse proportion to the individual fitness.

[0019] In one implementation of the present application, based on the task execution result, determining the core power consumption delay product corresponding to each core specifically includes:

[0020] According to the task execution result, determine the static power consumption value, resource utilization, utilization power consumption correlation coefficient, resource peak power consumption value, model power consumption influence coefficient, and preset complexity function corresponding to the target GPGPU device;

[0021] The utilization-power consumption correlation coefficient is used as an index, the ratio of the resource utilization and the corresponding preset maximum resource utilization is used as a base, and the product value is calculated with the resource peak power consumption value to determine a first calculated value;

[0022] Performing a product operation on the model power consumption influence coefficient and the preset complexity function, and adding 1 to the product operation result to obtain a second calculated value;

[0023] Taking the product of the first calculated value and the second calculated value as a third calculated value;

[0024] The sum of the third calculated value and the static power consumption value is used as the task execution power consumption, so as to determine the core power consumption delay product corresponding to each core based on the task execution power consumption.

[0025] In one implementation of the present application, based on the task execution result, determining the core power consumption delay product corresponding to each core specifically includes:

[0026] According to the task execution result, determine the workload value, stage processing capacity, stage parallelism, stage dependency delay, and dependency influence coefficient of each stage of task execution; wherein the stage dependency delay is the execution delay between a task execution stage and each dependent stage in the corresponding dependent stage set;

[0027] The product value of the stage processing capacity and the corresponding stage parallelism is used as the denominator, and the stage workload value is used as the numerator to determine a fourth calculation value;

[0028] Taking the product value of the stage dependency delay and the corresponding dependency relationship influence coefficient as the fifth calculated value;

[0029] Respectively determine the sum of the fourth calculated value and the fifth calculated value corresponding to each of the task execution stages as the sixth calculated value;

[0030] The maximum value among the sixth calculated values ​​is used as the task execution delay, so as to determine the core power consumption delay product according to the product value of the task execution power consumption and the task execution delay.

[0031] In one implementation of the present application, before determining the selected thread block execution configuration based on each of the individual fitness and the preset iteration end condition, the method further includes:

[0032] When the accumulated number of the genetic calculator is less than the maximum number of iterations, determining that the preset iteration end condition is not met;

[0033] According to the preset genetic algorithm function, the population chromosomes are randomly divided into two chromosome groups, and according to the individual fitness, the individuals corresponding to the maximum individual fitness in the two chromosome groups are respectively determined and used as the parent generation;

[0034] Performing crossover processing on the chromosomes corresponding to the parent generation to generate population chromosomes corresponding to the offspring individuals, and adding 1 to the accumulated number of the genetic calculator;

[0035] The corresponding individual fitness is determined according to the population chromosome corresponding to the offspring individual.

[0036] In one implementation of the present application, before performing crossover processing on the chromosome corresponding to the parent generation, the method further includes:

[0037] Determine the required memory of the crossover operation corresponding to the crossover processing according to the bytes occupied by the individuals corresponding to the crossover processing and the population size value;

[0038] Comparing the cross-operation required memory with the preset available memory;

[0039] In the case that the memory required for the crossover operation is greater than the preset available memory, the current crossover probability is updated according to a preset crossover probability update rule, so as to perform crossover processing on the chromosome corresponding to the parent generation according to the updated crossover probability.

[0040] In one implementation of the present application, before determining the individual fitness of each corresponding individual based on the preset kernel function, the population chromosome, and the parallel segmentation task, the method further includes:

[0041] Determine the number of individuals in the population corresponding to the chromosomes in the population;

[0042] When the number of individuals in the population is less than a preset random generation threshold, a supplementary thread block execution configuration is generated according to a preset random operator, and is added to the population chromosome as a new individual until the corresponding number of individuals in the population is greater than or equal to the preset random generation threshold; the preset random generation threshold is used to determine whether the population chromosome needs to be supplemented with a new individual;

[0043] Otherwise, the individual fitness of each corresponding individual is determined based on the preset kernel function, the population chromosome, and the parallel segmentation task.

[0044] On the other hand, an embodiment of the present application further provides a thread resource scheduling device for a GPGPU system, the device comprising:

[0045] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the thread resource scheduling method for a GPGPU system as described above.

[0046] On the other hand, an embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions can execute the thread resource scheduling method for a GPGPU system as described above.

[0047] Compared with the prior art, the present invention has the following significant effects:

[0048] Through the above technical solution, the genetic algorithm can be used to adaptively generate the GPGPU execution configuration, and the optimal execution configuration with high computing resource utilization can be obtained, so as to flexibly schedule the GPGPU computing resources without consuming manpower to set the GPGPU execution configuration. Moreover, by combining parallel computing, genetic algorithm optimization and GPU acceleration technology, the processing efficiency and performance of the target modeling model parallel segmentation task are significantly improved, while maintaining good flexibility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0050] Figure 1 A flowchart of a thread resource scheduling method for a GPGPU system in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of a process flow of a GPGPU configuration system corresponding to a thread resource scheduling method for a GPGPU system in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of chromosome iteration in a thread resource scheduling method for a GPGPU system in an embodiment of the present application;

[0053] Figure 4 This is a structural diagram of a thread resource scheduling device for a GPGPU system in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0055] The embodiments of the present application provide a thread resource scheduling method, device and medium for a GPGPU system, which are used to solve the technical problems that the computing resource utilization rate of the current GPGPU is low when executing simulation modeling tasks, the thread block and thread scheduling strategy are overly dependent on manual participation, the scheduling method is inefficient and costly, and it brings a bad user experience.

[0056] The following describes in detail various embodiments of the present application in conjunction with the accompanying drawings.

[0057] The present application embodiment provides a thread resource scheduling method for a GPGPU system, such as Figure 1 As shown, the method may include steps S101-S104:

[0058] S101, the microprocessor divides the data set of the target modeling model into a preset Cartesian coordinate system to determine the parallel segmentation tasks of the model sub-planes corresponding to the target modeling model.

[0059] The above-mentioned model sub-plane includes corresponding data points of the data set that are in the same selected plane.

[0060] It should be noted that the microprocessor as the execution subject of the thread resource scheduling method for the GPGPU system is only for example, and the execution subject is not limited to the microprocessor, and this application does not make specific restrictions on this. The microprocessor can be a CPU or other units that can perform calculations and process data.

[0061] In an embodiment of the present application, the target modeling model can be a 3D simulation modeling model, and the data set of the target modeling model includes data points after quantifying the target modeling model, such as each data point corresponding to the configuration parameters Modeldim.x, Modeldim.y and Modeldim.z. The preset Cartesian coordinate system is a three-dimensional coordinate system, which is a mathematical tool for quantitatively describing the spatial position and size of the model. Specifically, this three-dimensional coordinate system consists of three mutually perpendicular coordinate axes: the x-axis, the y-axis and the z-axis. These three axes intersect at the origin O, usually expressed as (0, 0, 0). In the three-dimensional coordinate system, any point in the model can be accurately located by its distance to these three coordinate axes (i.e., coordinate values).

[0062] The present application first adds the data points in the data set to a preset Cartesian coordinate system to form a three-dimensional spatial representation of the target modeling model, and then splits the entire model into model sub-planes. The model sub-plane can be a plane parallel to or coincident with the plane formed by the xy axis, and the model sub-plane is a two-dimensional segmentation of the model.

[0063] The present application can also perform task parallel partitioning on the model sub-plane, decomposing it into thread blocks so that the GPGPU can perform corresponding specific operations to obtain parallel partitioning tasks.

[0064] S102, the microprocessor executes the configuration based on the initial thread block and calls a preset genetic algorithm function to generate a population chromosome corresponding to the target GPGPU device.

[0065] The thread block execution configuration of each kernel in the target GPGPU device in the preset genetic algorithm function is a chromosome. The chromosomes corresponding to a target GPGPU device constitute a population chromosome.

[0066] The preset genetic algorithm functions can be pre-packaged and generate interfaces that can be called by the microprocessor, including the Compute Unified Device Architecture (CUDA), Heterogeneous-Computing Interface for Portability (HIP), Radeon Open Compute (ROCm), Open Computing Language (OpenCL) and SYCL. Parallel computing programming interfaces can also be used, so they can be inserted into most codes.

[0067] Among them, functions can contain:

[0068] GA_Init: Initializes the genetic algorithm population. The number of individuals is determined by the function parameter pop_size. The execution configuration of the initial population is randomly generated based on the thread grid and thread block size of the application, and must not exceed the maximum number supported by the maximum device and application. The randomly generated execution configuration is assigned to each individual to complete the initialization of the genetic algorithm population. In addition, GA_Init also supports population initialization with external input. The convergence of the algorithm can be accelerated by using the manufacturer's recommended values ​​or the results of offline calculations as the initial population input.

[0069] GA_Fitness: For each individual, the PDP of the corresponding kernel is calculated according to the execution configuration, and then its fitness is generated. PDP is inversely proportional to the individual fitness.

[0070] GA_Selection: For existing individuals, select the parent individuals that enter the genetic algorithm to perform the subsequent functions of the genetic algorithm. The specific process of selection is that whenever a parent individual is needed, GA_Selection randomly selects two individuals from the current population, and the individual with higher fitness among the two individuals is selected as the parent individual to participate in the subsequent algorithm operation.

[0071] GA_Cross: Performs chromosome crossover on the parent to generate offspring individuals according to the genetic algorithm configuration. For a certain dimension of execution configuration, the two offspring inherit from different parents.

[0072] GA_Mutation: Based on the parameter probability_mutation, the execution configuration of each dimension of the offspring has a certain probability of mutation. The mutation is randomly generated under the condition that the device and application constraints are met.

[0073] GA_Get: A function for collecting relevant parameters during algorithm execution.

[0074] GA_End: After the application is executed, clear the algorithm environment space.

[0075] In the embodiment of the present application, based on the initial thread block execution configuration, a preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device, specifically including:

[0076] After receiving the initial thread block execution configuration from the user terminal, the target GPGPU device is configured according to the initial thread block execution configuration. The initial thread block execution configuration includes the number of thread blocks corresponding to each dimension of the thread block and the number of threads corresponding to each dimension of the thread in the thread block. The preset genetic algorithm function is called to use the thread block execution configuration corresponding to each core in the target GPGPU device as a population chromosome.

[0077] The initial thread block execution configuration can be set by the developer based on the GPGPU device thread block and other available resources, or generated based on a random operator. This application does not make any specific restrictions on this. The thread block execution configuration is such as (block.size, thread.size), where block.size is the number of thread blocks in the thread grid in each dimension; thread.size is the number of threads in the thread block in each dimension. The user terminal can be a mobile phone, computer or other device, and this application does not make any specific restrictions on this. Among them, the population chromosome is defined as the execution configuration of each kernel of a single GPGPU, and the chromosomes of different kernels are inherited independently and have a common influence. The target GPGPU device can be understood as a single GPGPU device configured as the initial thread block execution configuration.

[0078] S103, the microprocessor determines the individual fitness of each corresponding individual based on the preset kernel function, population chromosomes, and parallel segmentation tasks.

[0079] The preset kernel function is predefined by the microprocessor. When the parallel splitting task corresponding to the preset kernel function is initiated, a target GPGPU device that has no task being executed is called, or when there is no device that meets the conditions, the available resources of the device are polled and compared. Once the resources are met, the corresponding target GPGPU device is called. Figure 2 Figure 1 shows the configuration flow for an ideal system with K GPGPU devices and γ kernels, where the kernel contains a different configuration at each iteration.

[0080] In the embodiment of the present application, based on the preset kernel function and population chromosomes, and the parallel segmentation task, the individual fitness of each corresponding individual is determined, specifically including:

[0081] According to the population chromosome, the parallel segmentation tasks are assigned to the target GPGPU device to execute the preset kernel function and obtain the task execution result. Based on the task execution result, the kernel power delay product corresponding to each kernel is determined. According to the kernel power delay product, the individual fitness of the corresponding individual is determined. The kernel power delay product is inversely proportional to the individual fitness.

[0082] That is to say, the microprocessor can first distribute the parallel segmentation tasks to the target GPGPU device according to the population chromosomes, and execute the preset kernel function. Chromosomes can be understood as parameters including Block.x, Block.y, Block.z, Thread.x, Thread.y, Thread.z, etc. Block.x, Block.y, Block.z represent thread block coordinates, and Thread.x, Thread.y, Thread.z represent thread coordinates. After the GPGPU device completes the parallel segmentation task, the microprocessor can calculate the kernel power consumption delay product for each kernel involved in the execution, and then determine the individual fitness.

[0083] Among them, there is an inverse proportional relationship between individual fitness and core power-delay product (Power-Delay Product, PDP), such as core power-delay product PDP = A / S, S is the individual fitness, A is a constant, and this application does not make specific restrictions on this. In general, the larger the core power-delay product, the smaller the individual fitness should be, and the smaller the core power-delay product, the larger the individual fitness should be. The larger the individual fitness, the better the corresponding execution configuration.

[0084] In order to better calculate the core power consumption delay product, the present application provides the following technical solutions. Specifically, based on the task execution results, the core power consumption delay product corresponding to each core is determined, which specifically includes:

[0085] According to the task execution result, determine the static power consumption value, resource utilization, utilization power consumption correlation coefficient, resource peak power consumption value, model power consumption influence coefficient, and preset complexity function corresponding to the target GPGPU device. Take the utilization power consumption correlation coefficient as the exponent, the resource utilization and the ratio of the corresponding preset resource maximum utilization as the base, and calculate the product value with the resource peak power consumption value to determine the first calculation value. Multiply the model power consumption influence coefficient with the preset complexity function, and add 1 to the product result to obtain the second calculation value. The product value of the first calculation value and the second calculation value is used as the third calculation value. The sum of the third calculation value and the static power consumption value is used as the task execution power consumption, so as to determine the core power consumption delay product corresponding to each core based on the task execution power consumption.

[0086] That is to say, the task execution result may include the following parameters: static power consumption value, resource utilization, utilization power consumption correlation coefficient, resource peak power consumption value, model power consumption influence coefficient, preset complexity function. PDP is related to power consumption and delay, and the power consumption calculation during task execution can be obtained by the above calculation method. The specific calculation formula is as follows:

[0087] ;

[0088] in, Indicates the power consumption of task execution; Indicates the static power consumption value of GPGPU; Represents different resources in GPGPU, such as computing units, memory bandwidth, cache, etc. Each resource constitutes a collection ; Representation Resources Resource utilization; For resources Maximum utilization of preset resources; For resources The nonlinear coefficient of the influence of utilization on power consumption, that is, the utilization-power consumption correlation coefficient; For resources The peak power consumption value of the resource at peak utilization; is the model power consumption influence coefficient of the model complexity on power consumption; It is a preset complexity function of the target modeling model. When the target modeling model is a 3D model, the preset complexity function can be obtained by weighted calculation based on factors such as the number of vertices, the number of faces, and the texture resolution. Different factors correspond to different preset weights.

[0089] Through the above calculation formula, the power consumption of a task execution based on the load intensity and resource utilization can be calculated, so as to accurately and efficiently complete the calculation of the core power consumption delay product.

[0090] In another embodiment of the present application, determining the core power consumption delay product corresponding to each core based on the task execution result further specifically includes:

[0091] According to the task execution results, the workload value, stage processing capacity, stage parallelism, stage dependency delay, and dependency influence coefficient of each stage of task execution are determined. Among them, the stage dependency delay is the execution delay between a task execution stage and each dependent stage in the corresponding dependent stage set. The product value of the stage processing capacity and the corresponding stage parallelism is used as the denominator, and the stage workload value is used as the numerator to determine the fourth calculation value. The product value of the stage dependency delay and the corresponding dependency influence coefficient is used as the fifth calculation value. The sum of the fourth calculation value and the fifth calculation value corresponding to each task execution stage is determined as the sixth calculation value. The maximum value of each sixth calculation value is used as the task execution delay, so as to determine the core power consumption delay product according to the product value of the task execution power consumption and the task execution delay.

[0092] That is to say, the task execution result may also include the following parameters: the workload value of each stage of task execution, the stage processing capacity, the stage parallelism, the stage dependency delay, and the dependency influence coefficient. The calculation formula for the above task execution delay is as follows:

[0093] ;

[0094] in, Indicates that the task execution is delayed. Indicates different stages in the task execution process (for example, vertex processing, rasterization, fragment processing, etc. in 3D model simulation modeling). is a collection of different stages; Representation stage The stage workload value; Representation stage The processing power of the stage (i.e., a function of the number of computing units, memory bandwidth, etc.); Representation stage The parallelism of the stages (i.e. the number of operations that can be processed simultaneously at the same time); Representation stage The dependency phase can be understood as the execution of one phase requires the execution of another phase, and the former depends on the latter; Including stages The dependent phase set of the dependent phase; Dependency phase The inherent delay of Indicates that from the stage To stage The data transmission or processing queue delay is The constituent phase relies on delay; Dependency impact coefficient representing the impact of the dependency on latency.

[0095] Through the above calculation formula, parallelism and parallel bottlenecks can be explicitly considered in the delay estimation to reflect the complex parallel execution characteristics of GPGPU; at the same time, task dependencies and queue delays are incorporated into the delay estimation to more accurately evaluate the dynamic interactions and delay accumulation in the rendering process.

[0096] After obtaining the task execution power consumption and task execution delay through the above formula, the product of the two can be obtained as , as the core power delay product PDP, and then determine the fitness of each individual.

[0097] In addition, in the embodiment of the present application, before determining the individual fitness of each corresponding individual based on the preset kernel function and the population chromosome and the parallel segmentation task, the method further includes:

[0098] The microprocessor determines the number of individuals in the population corresponding to the population chromosome. When the number of individuals in the population is less than a preset random generation threshold, a supplementary thread block execution configuration is generated according to a preset random operator and added to the population chromosome as a new individual until the corresponding number of individuals in the population is greater than or equal to the preset random generation threshold. The preset random generation threshold is used to determine whether the population chromosome needs to be supplemented with new individuals. Otherwise, the individual fitness of each corresponding individual is determined based on the preset kernel function, the population chromosome, and the parallel segmentation task.

[0099] That is to say, the present application pre-sets a preset random generation threshold value, which is used to determine whether the number of population individuals corresponding to the population chromosome meets the conditions for executing the configuration of the GPGPU. The preset random generation threshold value can be set by the user himself, and the present application does not make specific restrictions on this. The preset random operator is set by the user and is used to randomly generate the thread block execution configuration. S103 will continue to be executed only after the number of population individuals in the population chromosome reaches the preset random generation threshold value. In addition, the present application can also set an upper limit on the number of populations. When the number of population individuals reaches the preset random generation threshold value or is equal to the upper limit on the number of populations, it can be considered that the conditions for executing S103 are met.

[0100] S104, the microprocessor determines a selected thread block execution configuration based on the fitness of each individual and a preset iteration end condition, so as to enable the target GPGPU device to process the parallel split task according to the selected thread block execution configuration.

[0101] After the microprocessor obtains the fitness of each individual, it can determine the iteration end condition, thereby using the above genetic algorithm to obtain the optimal selected thread block execution configuration, and configure the GPGPU device with the selected thread block execution configuration.

[0102] In the embodiment of the present application, before determining the selected thread block execution configuration based on the fitness of each individual and the preset iteration end condition, the method further includes:

[0103] When the accumulated number of the genetic calculator is less than the maximum number of iterations, it is determined that the preset iteration end condition is not met. According to the preset genetic algorithm function, the population chromosomes are randomly divided into two groups of chromosome groups, and the individuals corresponding to the maximum individual fitness in the two groups of chromosome groups are determined according to the individual fitness, and are used as parents. The chromosomes corresponding to the parent generation are cross-processed to generate population chromosomes corresponding to the offspring individuals, and the accumulated number of the genetic calculator is increased by 1. The corresponding individual fitness is determined according to the population chromosomes corresponding to the offspring individuals.

[0104] In other words, the genetic algorithm includes a genetic calculator to count the number of iterations, and the counted number of iterations is displayed by a cumulative number. After each iteration of the genetic algorithm, the microprocessor can determine whether the cumulative number is less than the maximum number of iterations. If so, it means that the number does not meet the preset iteration end condition. The microprocessor will continue to call the preset genetic algorithm function to randomly divide the population chromosomes to obtain two groups of chromosomes containing different chromosomes. In this application, the population chromosomes can be sorted from small to large according to PDP, such as Figure 3 As shown, the chromosome contains six parameters, one grid represents one parameter, and the population chromosome includes four chromosomes, which are divided into groups of two. Subsequently, the individual (i.e., chromosome) corresponding to the maximum individual fitness in the chromosome group is used as the parent. The parent chromosome is cross-processed, and then the offspring individual can be obtained. At this time, the cumulative number is added by 1, and then the GPGPU configuration is performed according to the population chromosome corresponding to the offspring individual, and the above step S103 is executed to determine the individual fitness.

[0105] In another embodiment of the present application, the present application may perform random mutations when configuring the target GPGPU device based on the above GA_Mutation, so that the generation of the thread block execution configuration is more flexible.

[0106] In the embodiment of the present application, before performing crossover processing on the chromosome corresponding to the parent generation, the method further includes:

[0107] According to the bytes occupied by the individuals corresponding to the crossover processing and the population size value, the required memory for the crossover operation corresponding to the crossover processing is determined. The required memory for the crossover operation is compared with the preset available memory. When the required memory for the crossover operation is greater than the preset available memory, the current crossover probability is updated according to the preset crossover probability update rule, so as to perform crossover processing on the chromosome corresponding to the parent generation according to the updated crossover probability.

[0108] In other words, the present application can pre-calculate the bytes occupied by individuals required for cross processing and the generated population size value (i.e., population size) to obtain the required memory for the cross operation. For example, the calculation formula for the required memory for the cross operation is:

[0109] ;

[0110] in, Requires memory for crossover operations; The individual occupies bytes for each individual; is the population size, which can be understood as the number of individuals; It is an empirical value used to estimate the additional memory overhead incurred during the crossover process.

[0111] The microprocessor can determine whether the crossover operation required memory is greater than a preset available memory preset by the user, and then determine whether to execute the crossover probability update step based on the judgment result. Among them, the preset crossover probability update rule is set by the user according to the actual usage scenario, for example, the crossover probability is reduced according to the preset step size, and this application does not make specific restrictions on this. After the crossover probability is updated, the crossover operation that does not meet the preset available memory will be re-executed until the crossover operation required memory is less than or equal to the preset available memory.

[0112] Through the above-mentioned crossover probability update steps, the feasibility of the crossover result verification of the GPGPU device can be preliminarily determined and analyzed, thereby ensuring that the GPGPU device can better perform tasks.

[0113] Through the above technical solution, the genetic algorithm can be used to adaptively generate the execution configuration of GPGPU, and the optimal execution configuration with high computing resource utilization can be obtained, so as to flexibly schedule GPGPU computing resources without consuming manpower to set the GPGPU execution configuration. Moreover, by combining parallel computing, genetic algorithm optimization and GPU acceleration technology, the processing efficiency and performance of the parallel segmentation task of the target modeling model are significantly improved. At the same time, the parameters and kernel functions of the genetic algorithm can be adjusted as needed to adapt to different application scenarios and model complexity, maintaining good flexibility and scalability.

[0114] Figure 4 A structural diagram of a thread resource scheduling device for a GPGPU system provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the device includes:

[0115] At least one processor; and a memory in communication with the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0116] The data set of the target modeling model is divided into a preset Cartesian coordinate system to determine the parallel segmentation task of the model sub-plane corresponding to the target modeling model. The model sub-plane includes data points corresponding to the data set in the same selected plane. Based on the initial thread block execution configuration, the preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device. Among them, the thread block execution configuration of each kernel in the target GPGPU device in the preset genetic algorithm function is a chromosome. The chromosomes corresponding to a target GPGPU device constitute a population chromosome. Based on the preset kernel function, the population chromosome and the parallel segmentation task, the individual fitness of each corresponding individual is determined. Based on the fitness of each individual and the preset iteration end condition, the selected thread block execution configuration is determined to enable the target GPGPU device to process the parallel segmentation task according to the selected thread block execution configuration.

[0117] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:

[0118] The data set of the target modeling model is divided into a preset Cartesian coordinate system to determine the parallel segmentation task of the model sub-plane corresponding to the target modeling model. The model sub-plane includes data points corresponding to the data set in the same selected plane. Based on the initial thread block execution configuration, the preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device. Among them, the thread block execution configuration of each kernel in the target GPGPU device in the preset genetic algorithm function is a chromosome. The chromosomes corresponding to a target GPGPU device constitute a population chromosome. Based on the preset kernel function, the population chromosome and the parallel segmentation task, the individual fitness of each corresponding individual is determined. Based on the fitness of each individual and the preset iteration end condition, the selected thread block execution configuration is determined to enable the target GPGPU device to process the parallel segmentation task according to the selected thread block execution configuration.

[0119] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0120] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0121] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0122] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A thread resource scheduling method for a GPGPU system, characterized in that: The method comprises: Dividing the data set of the target modeling model into a preset Cartesian coordinate system to determine a parallel segmentation task of a model sub-plane corresponding to the target modeling model; the model sub-plane includes data points corresponding to the data set in the same selected plane; Based on the initial thread block execution configuration, a preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device; wherein the thread block execution configuration of each kernel in the target GPGPU device in the preset genetic algorithm function is a chromosome respectively; and each of the chromosomes corresponding to one of the target GPGPU devices constitutes a population chromosome; Determine the individual fitness of each corresponding individual based on the preset kernel function, the population chromosome, and the parallel segmentation task; Determine a selected thread block execution configuration based on each of the individual fitnesses and a preset iteration end condition, so as to enable the target GPGPU device to process the parallel split task according to the selected thread block execution configuration; Wherein, based on the preset kernel function, the population chromosome, and the parallel segmentation task, the individual fitness of each corresponding individual is determined, specifically including: According to the population chromosome, the parallel segmentation task is allocated to the target GPGPU device to execute the preset kernel function to obtain a task execution result; Based on the task execution result, determining the core power consumption delay product corresponding to each core; Determining the individual fitness of the corresponding individual according to the core power consumption delay product; the core power consumption delay product and the individual fitness are in inverse proportion; Wherein, based on the task execution result, determining the core power consumption delay product corresponding to each core specifically includes: According to the task execution result, determine the static power consumption value, resource utilization, utilization power consumption correlation coefficient, resource peak power consumption value, model power consumption influence coefficient, and preset complexity function corresponding to the target GPGPU device; The utilization-power consumption correlation coefficient is used as an index, the ratio of the resource utilization and the corresponding preset maximum resource utilization is used as a base, and the product value is calculated with the resource peak power consumption value to determine a first calculated value; Performing a product operation on the model power consumption influence coefficient and the preset complexity function, and adding 1 to the product operation result to obtain a second calculated value; Taking the product of the first calculated value and the second calculated value as a third calculated value; The sum of the third calculated value and the static power consumption value is used as the task execution power consumption, so as to determine the core power consumption delay product corresponding to each core based on the task execution power consumption.

2. A thread resource scheduling method for a GPGPU system according to claim 1, characterized in that: Based on the initial thread block execution configuration, the preset genetic algorithm function is called to generate a population chromosome corresponding to the target GPGPU device, including: After receiving the initial thread block execution configuration from the user terminal, configuring the target GPGPU device according to the initial thread block execution configuration; wherein the initial thread block execution configuration includes the number of thread blocks corresponding to each dimension of the thread block and the number of threads corresponding to each dimension in the thread block; The preset genetic algorithm function is called to configure the thread block execution corresponding to each kernel in the target GPGPU device as the population chromosome.

3. The thread resource scheduling method for a GPGPU system according to claim 1, characterized in that: Based on the task execution result, determining the core power consumption delay product corresponding to each core, specifically including: According to the task execution result, determine the workload value, stage processing capacity, stage parallelism, stage dependency delay, and dependency influence coefficient of each stage of task execution; wherein the stage dependency delay is the execution delay between a task execution stage and each dependent stage in the corresponding dependent stage set; The product value of the stage processing capacity and the corresponding stage parallelism is used as the denominator, and the stage workload value is used as the numerator to determine a fourth calculation value; Taking the product value of the stage dependency delay and the corresponding dependency relationship influence coefficient as the fifth calculated value; Respectively determine the sum of the fourth calculated value and the fifth calculated value corresponding to each of the task execution stages as the sixth calculated value; The maximum value among the sixth calculated values ​​is used as the task execution delay, so as to determine the core power consumption delay product according to the product value of the task execution power consumption and the task execution delay.

4. The thread resource scheduling method for a GPGPU system according to claim 1, characterized in that: Before determining the selected thread block execution configuration based on each of the individual fitnesses and the preset iteration end condition, the method further includes: When the accumulated number of the genetic calculator is less than the maximum number of iterations, determining that the preset iteration end condition is not met; According to the preset genetic algorithm function, the population chromosomes are randomly divided into two chromosome groups, and according to the individual fitness, the individuals corresponding to the maximum individual fitness in the two chromosome groups are respectively determined and used as the parent generation; Performing crossover processing on the chromosomes corresponding to the parent generation to generate population chromosomes corresponding to the offspring individuals, and adding 1 to the accumulated number of the genetic calculator; The corresponding individual fitness is determined according to the population chromosome corresponding to the offspring individual.

5. The thread resource scheduling method for a GPGPU system according to claim 4, characterized in that: Before performing crossover processing on the chromosome corresponding to the parent generation, the method further includes: Determine the required memory of the crossover operation corresponding to the crossover processing according to the bytes occupied by the individuals corresponding to the crossover processing and the population size value; Comparing the cross-operation required memory with the preset available memory; In the case that the memory required for the crossover operation is greater than the preset available memory, the current crossover probability is updated according to a preset crossover probability update rule, so as to perform crossover processing on the chromosome corresponding to the parent generation according to the updated crossover probability.

6. The thread resource scheduling method for a GPGPU system according to claim 1, characterized in that: Before determining the individual fitness of each corresponding individual based on the preset kernel function, the population chromosome, and the parallel segmentation task, the method further includes: Determine the number of individuals in the population corresponding to the chromosomes in the population; When the number of individuals in the population is less than a preset random generation threshold, a supplementary thread block execution configuration is generated according to a preset random operator, and is added to the population chromosome as a new individual until the corresponding number of individuals in the population is greater than or equal to the preset random generation threshold; the preset random generation threshold is used to determine whether the population chromosome needs to be supplemented with a new individual; Otherwise, the individual fitness of each corresponding individual is determined based on the preset kernel function, the population chromosome, and the parallel segmentation task.

7. A thread resource scheduling device for a GPGPU system, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the thread resource scheduling method for a GPGPU system as described in any one of claims 1 to 6 above.

8. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute the thread resource scheduling method for a GPGPU system as described in any one of claims 1 to 6 above.

Citation Information

Patent Citations

  • Real-time system task scheduling method and device, computer equipment and storage medium

    CN116541165A