GPU program optimization method based on CUDA parallel environment

By adopting CUDA-based optimization methods in GPU program scheduling, priority queue classification and resource scheduling of task requests are performed, and task processing strategies are optimized using particle swarm algorithms, the problem of insufficient task scheduling and unreasonable resource allocation in the existing technology is solved, and efficient computing resource utilization and system response speed are improved.

CN119690684AInactive Publication Date: 2025-03-25无锡九方科技有限公司

Patent Information

Application Number
CN202510200432.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology lacks the classification and intelligent scheduling mechanism of priority queues in GPU program scheduling, resulting in insufficient task scheduling, unreasonable resource allocation, and ineffective utilization of different processing capabilities of CPU and GPU, resulting in low computing efficiency.

Method used

The GPU program optimization method based on CUDA parallel environment is adopted. By obtaining the priority coefficients of task requests, the priority queue classification is performed, the vitality coefficients of each priority queue are calculated, resource scheduling is performed, and the task scheduling optimization model is constructed, and the particle swarm algorithm is used for solving to obtain the task processing strategy of the calculation node.

Benefits of technology

Ensure that high-priority tasks are given priority, improve system response speed and efficiency, realize reasonable allocation of computing resources, avoid overload or idleness of computing nodes, dynamically adjust loads to maximize resource utilization, and improve overall computing efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690684A_ABST
    Figure CN119690684A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of GPU (Graphics Processing Unit), in particular to a GPU program optimization method based on a CUDA (Compute Unified Device Architecture) parallel environment, which comprises the following steps: acquiring a task request sent by a target GPU program, and carrying out priority queue classification on the task request based on a priority coefficient of the task request so as to divide the task request into different priority queues; the activity coefficient of each priority queue is calculated based on the delays of the different priority queues, resource scheduling is carried out on each priority queue through each calculation node in the calculation cluster based on the activity coefficient of each priority queue, and each calculation node is composed of a CPU and a GPU. According to the method, the task requests are subjected to priority queue classification, so that the tasks with high priorities can be preferentially processed, the response speed and efficiency of the whole system are improved, the tasks with different priorities can be effectively managed through task priority queue classification, resource conflicts are avoided, and the processing capacity of key tasks is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of GPU technology application, and in particular to a GPU program optimization method based on a CUDA parallel environment. Background Art

[0002] CUDA (Compute Unified Device Architecture) is a parallel computing architecture developed by NVIDIA. It aims to accelerate the execution of compute-intensive tasks by leveraging the powerful parallel processing capabilities of GPUs (graphics processing units). CUDA enables developers to use programming languages ​​such as C, C++, and Fortran to perform calculations directly on the GPU, significantly improving computing efficiency, especially in large-scale data processing and complex computing tasks.

[0003] Traditional methods usually lack the classification of priority queues and intelligent scheduling mechanisms, resulting in insufficient precision in task scheduling. When high-priority tasks and low-priority tasks exist at the same time, resource competition may cause delays in high-priority tasks, reducing system response speed. Traditional scheduling methods do not effectively distinguish tasks based on their computing requirements, and usually schedule all tasks as the same type, which may lead to unreasonable resource allocation. There is no precise task allocation for the different processing capabilities and characteristics of CPUs and GPUs, which may lead to slower or inaccurate task processing. Traditional methods generally adopt static scheduling strategies and do not have the ability to adaptively adjust. When the load changes, the system often cannot adjust resource allocation according to task requests in real time, which may cause uneven utilization of computing node resources, thereby affecting overall performance. Traditional methods generally lack dynamic adjustment and optimization of computing node loads. The loads of computing nodes are often static, and there is no flexible load balancing mechanism, which may lead to waste of computing resources or computing bottlenecks, affecting the effect of parallel computing. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a GPU program optimization method based on the CUDA parallel environment.

[0005] The technical solution adopted to solve the above technical problems is: a GPU program optimization method based on CUDA parallel environment, including: Obtaining a task request issued by a target GPU program, and classifying the task request into priority queues based on priority coefficients of the task request, so as to divide the task request into different priority queues; Calculate the vitality coefficient of each priority queue based on the delay of different priority queues, and perform resource scheduling on each priority queue through each computing node in the computing cluster based on the vitality coefficient of each priority queue, wherein the computing node is composed of a CPU and a GPU; Processing the task request in the priority queue based on the computing node to obtain the task corresponding to the task request, and obtaining the task type corresponding to each subtask in the task based on the task request, wherein the task type includes a CPU task and a GPU task; Acquiring the task type corresponding to each subtask in the task based on the task request to build a task scheduling optimization model, wherein the task scheduling optimization model includes a task scheduling objective function and task scheduling constraints; The task scheduling optimization model is solved based on the particle swarm algorithm to obtain the task processing strategy corresponding to the computing node.

[0006] Preferably, the task requests are classified into priority queues based on the priority coefficients of the task requests to divide the task requests into different priority queues, including: Calculate the density of the priority coefficients of all task requests, and use the priority coefficient with the largest density as the initial cluster center; The priority coefficients of all task requests are assigned to the class where the nearest cluster center is located according to the size of the priority coefficient and the degree of proximity to the initialized cluster center; Recalculate the new cluster center and compare the current cluster center with the cluster center of the previous round. When the two cluster centers are the same, clustering ends and the cluster grouping results of all task requests are arranged in descending order. According to the clustering classification results of all task requests, corresponding to queues of different priorities, the packets with high priority coefficients are sent to the high priority queue, and the packets with low priority coefficients are sent to the low priority queue.

[0007] Preferably, the calculation formula of the activity coefficient of the priority queue is as follows: ; in, Indicates The vitality coefficient of the priority queue, Indicates The delay of the priority queue, Indicates The preset delay thresholds of the priority queues, where , Indicates The queue length of the priority queue, Indicates the number of requests entering the queue per unit time. Indicates the number of task requests that leave the queue per unit time.

[0008] Preferably, resource scheduling is performed on each priority queue through each computing node in the computing cluster based on the activity coefficient of each priority queue, including: A CUDA-based device occupancy calculation tool calculates the space coefficient and space idleness of each computing node in the computing cluster; Based on a preset weight, the space coefficient and the device space idleness of each computing node in the computing cluster are integrated to obtain a comprehensive feature of each computing node in the computing cluster; Calculating the allocation coefficient of each computing node in the computing cluster based on the comprehensive characteristics of each computing node in the computing cluster, and obtaining the resource allocation amount of each computing node in the computing cluster based on the allocation coefficient of each computing node in the computing cluster; The activity coefficients of the priority queues are arranged in ascending order to obtain a sequential sequence of activity coefficients, and resources are allocated from the computing nodes corresponding to the priority queues with low activity coefficients to the computing nodes corresponding to the priority queues with high activity coefficients according to the resource allocation amount.

[0009] Preferably, the calculation formula of the space coefficient is as follows: ; in, Indicates the number of The spatial coefficient of the computation nodes, Indicates the number of The number of SMs in a computing node, Represents the CUDA device occupancy calculation function, Indicates the number of The thread block size of the compute nodes, Indicates the number of The number of registers used by threads on a compute node, Indicates the number of The shared memory used by the thread blocks of the compute nodes; The calculation formula of the space idleness is as follows: ; in, Indicates the number of The space idleness of computing nodes, represents the ceiling function, Indicates the number of The thread grid size of the compute nodes, Indicates the number of The network bandwidth of each computing node.

[0010] Preferably, the calculation formula of the distribution coefficient is as follows: ; in, Indicates the number of and The distribution coefficient between the computing nodes is and Indicates the number of and The comprehensive characteristics of the computing nodes; The calculation formula of the resource allocation amount is as follows: ; in, Indicates the number of and The amount of resources allocated between computing nodes, represents the logarithmic function, and Indicates and The queue length of the priority queue, and Indicates and The preset delay threshold of the priority queue, Indicates The delay of a priority queue.

[0011] Preferably, the expression of the task scheduling objective function is as follows: ; in, Indicates The sum of the energy consumption of the tasks completed by the computing nodes during runtime, Indicates The number of completed tasks on the compute nodes, Indicates The first tasks, Indicates execution of tasks The power consumption is Indicates the task The time to start execution, and Indicates the power consumption of CPU and GPU when no task is running. and Indicates the number of compute nodes The idle time of the CPU and GPU for each CPU / GPU pair, represents the power consumption of components other than the processor in the computing node. Indicates the time when the computing node is turned on. represents the energy consumption of computing nodes turned on and off, Indicates the number of times the computing node is turned on and off; The expression of the task scheduling constraint condition is as follows: ; in, Indicates the task Time of completion, Indicates the task Deadline.

[0012] Preferably, solving the task scheduling optimization model based on a particle swarm algorithm to obtain a task processing strategy corresponding to the computing node includes: A group of individuals is randomly generated, and the position of each individual represents a combination of decision variables of the objective function; For each combination of decision variables of the objective function represented by each individual, calculating a fitness value, wherein the fitness value is the value of the objective function; updating the light intensity and attractiveness of the individual, and updating the position of the individual based on the light intensity and attractiveness of the individual; Determine whether the training error reaches the convergence value or the number of iterations reaches the maximum value. If the training error reaches the convergence value and the number of iterations reaches the maximum value, the iteration ends and outputs the combination of decision variables of the objective function, otherwise the number of iterations increases by 1.

[0013] Preferably, the update formula of the individual light intensity is as follows: ; in, and Indicates The first iteration and the The iteration The light intensity of each individual Indicates the preset specific gravity. Indicates the preset scaling factor, Indicates The position of the individual at the iteration, Indicates The fitness value corresponding to the individual's position at the iteration.

[0014] Preferably, the update formula of the individual's attractiveness is as follows: ; in, represents the attractiveness of an individual, represents the maximum attraction, Indicates Individual and The distance between individuals, and , and Indicates Individual and the location of each individual; The update formula of the individual's position is as follows: ; in, and Indicates The first iteration and the The iteration The location of an individual, Indicates The iteration The location of an individual, Indicates The random factor of individuals, Represents the step size scaling factor.

[0015] The beneficial effects of the present invention are as follows: (1) The present invention can ensure that high-priority tasks are processed first by classifying task requests into priority queues, thereby improving the response speed and efficiency of the entire system. Task priority queue classification can effectively manage tasks of different priorities, avoid resource conflicts, and improve the processing capabilities of key tasks. By calculating the vitality coefficient based on each priority queue, the computing nodes (CPU and GPU) can be accurately scheduled for resources, thereby more reasonably allocating computing resources and avoiding overload or idleness of certain nodes. By dynamically adjusting the load of computing nodes, it is possible to maximize resource utilization and improve the overall computing efficiency of the system; (2) The present invention distinguishes subtasks in a task according to different computing requirements, which helps to allocate appropriate processing units to different types of tasks, avoiding CPU and Competition between GPUs can be eliminated, thereby improving the speed and accuracy of task processing. By constructing a task scheduling optimization model, the task scheduling problem is abstracted into an optimization problem, and the objective function and constraints are introduced to make task scheduling more systematic and scientific. This modeling process makes the scheduling process more efficient and flexible, and can cope with complex scheduling requirements. (3) The present invention solves the task scheduling optimization model by using the particle swarm algorithm (PSO), and can perform global optimization in the multi-dimensional solution space to find a better scheduling strategy, so that the computing power of the GPU and CPU can be more effectively utilized, the waiting time of the task can be reduced, and the execution efficiency of the task can be improved, and finally the purpose of improving the performance of the entire system can be achieved. Especially in GPU computing tasks, reasonable resource scheduling can significantly improve the efficiency of parallel computing and shorten the task execution time. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic flow chart of the steps of an overall method in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] Embodiment 1, as Figure 1 As shown, the present invention proposes a GPU program optimization method based on a CUDA parallel environment, comprising: S1. Obtaining a task request issued by a target GPU program, and classifying the task request into priority queues based on the priority coefficients of the task request, so as to divide the task request into different priority queues; S2, calculating the vitality coefficient of each priority queue based on the delay of different priority queues, and scheduling resources for each priority queue through each computing node in the computing cluster based on the vitality coefficient of each priority queue, wherein the computing node is composed of a CPU and a GPU; S3, based on the computing node, processing the task request in the priority queue to obtain the task corresponding to the task request, and obtaining the task type corresponding to each subtask in the task based on the task request, wherein the task type includes a CPU task and a GPU task; S4, constructing a task scheduling optimization model based on the task type corresponding to each subtask in the task obtained from the task request, wherein the task scheduling optimization model includes a task scheduling objective function and task scheduling constraints; S5. Solve the task scheduling optimization model based on the particle swarm algorithm to obtain the task processing strategy corresponding to the computing node.

[0018] In the present invention, CUDA is a parallel computing platform and programming model developed by NVIDIA, which allows developers to use NVIDIA's GPU for general computing (not just graphics processing). In the CUDA parallel environment, the program can assign computing tasks to the GPU for execution to achieve accelerated computing; in computing tasks, a task request refers to a request sent by a program or system, indicating a computing task to be processed. Usually, a task request contains information such as the type of computing to be performed, the required resources, and the execution priority; a priority queue is a data structure, and task requests are assigned to different queues according to priority coefficients. Task requests with higher priorities will be at the front of the queue and thus be processed first; a computing node refers to a node in a distributed In a distributed computing system, a hardware node used to perform computing tasks. It can be a hybrid computing unit composed of a CPU and a GPU, responsible for processing task requests and tasks; CPU tasks refer to tasks performed by the central processing unit (CPU), which are usually suitable for processing simpler tasks or serial calculations; GPU tasks refer to tasks performed by a graphics processing unit (GPU), which are usually used to process tasks that require a large amount of parallel computing, such as image processing, deep learning and other computationally intensive tasks; Particle swarm algorithm is a heuristic optimization algorithm that simulates the foraging behavior of bird flocks and finds the optimal solution through mutual cooperation between individuals. In task scheduling, the particle swarm algorithm can be used to optimize the task allocation strategy, make effective use of computing resources, and thus improve overall performance.

[0019] Embodiment 2, a GPU program optimization method based on a CUDA parallel environment proposed by the present invention, compared with embodiment 1, this embodiment further includes: classifying the task requests into priority queues based on the priority coefficients of the task requests, so as to divide the task requests into different priority queues, including: A1. Calculate the density of the priority coefficients of all task requests and use the priority coefficient with the largest density as the initial cluster center; A2. Assign the priority coefficients of all task requests to the class with the closest cluster center according to the priority coefficient size and the degree of proximity to the initialized cluster center. A3. Recalculate the new cluster center and compare the current cluster center with the cluster center of the previous round. When the two cluster centers are the same, clustering ends and the cluster grouping results of all task requests are arranged in descending order. A4. According to the clustering classification results of all task requests, corresponding to queues of different priorities, the packets with high priority coefficients are sent to the high priority queue, and the packets with low priority coefficients are sent to the low priority queue.

[0020] In this embodiment, the cluster center is a key concept in the clustering algorithm. During the clustering process, the algorithm divides the data points (priority coefficients of task requests) into multiple classes. Each class has a center point, called the cluster center. The cluster center represents the "average" priority coefficient of the task requests in the class. When the new cluster center is the same as the cluster center of the previous round, it means that the clustering result no longer changes and the clustering process ends. This judgment is usually based on a certain stop condition (such as the change of the cluster center is less than a certain threshold). Density refers to the distribution of priority coefficients within a certain range. The distribution of priority coefficients of task requests may be discrete or continuous. A high density means that task requests are more concentrated near a certain priority coefficient.

[0021] In an optional embodiment, the calculation formula of the activity coefficient of the priority queue is as follows: ; in, Indicates The vitality coefficient of the priority queue, Indicates The delay of the priority queue, Indicates The preset delay thresholds of the priority queues, where , Indicates The queue length of the priority queue, Indicates the number of requests entering the queue per unit time. Indicates the number of task requests that leave the queue per unit time.

[0022] In an optional embodiment, resource scheduling is performed on each priority queue through each computing node in the computing cluster based on the activity coefficient of each priority queue, including: B1. The CUDA-based device occupancy calculation tool calculates the space coefficient and space idleness of each computing node in the computing cluster; B2. Based on the preset weights, the space coefficients and device space idleness of each computing node in the computing cluster are integrated to obtain the comprehensive characteristics of each computing node in the computing cluster; B3. Calculate the allocation coefficient of each computing node in the computing cluster based on the comprehensive characteristics of each computing node in the computing cluster, and obtain the resource allocation amount of each computing node in the computing cluster based on the allocation coefficient of each computing node in the computing cluster; B4. Arrange the activity coefficients of each priority queue in ascending order to obtain a sequence of activity coefficients, and allocate resources from the computing nodes corresponding to the priority queues with low activity coefficients to the computing nodes corresponding to the priority queues with high activity coefficients according to the resource allocation amount.

[0023] It should be noted that CUDA's device occupancy calculation tool is a tool used to monitor and analyze GPU resource usage, and calculate the GPU resource usage of each computing node in the computing cluster; resource allocation refers to allocating computing resources (such as CPU, GPU, etc.) in the cluster to different computing nodes according to certain rules. Queues with low activity coefficients may represent computing nodes with lighter loads, which can obtain more resources from computing nodes with high activity coefficients for supplementation. Resource allocation requires comprehensive decision-making based on multiple factors such as the node's activity coefficient and allocation coefficient.

[0024] In an optional embodiment, the calculation formula of the space coefficient is as follows: ; in, Indicates the number of The spatial coefficient of the computation nodes, Indicates the number of The number of SMs in a computing node, Represents the CUDA device occupancy calculation function, Indicates the number of The thread block size of the compute nodes, Indicates the number of The number of registers used by threads on a compute node, Indicates the number of The shared memory used by the thread blocks of the compute nodes; The calculation formula of space idleness is as follows: ; in, Indicates the number of The space idleness of computing nodes, represents the ceiling function, Indicates the number of The thread grid size of the compute nodes, Indicates the number of The network bandwidth of each computing node.

[0025] In an optional embodiment, the calculation formula of the distribution coefficient is as follows: ; in, Indicates the number of and The distribution coefficient between the computing nodes, and Indicates the number of and The comprehensive characteristics of each computing node; The resource allocation calculation formula is as follows: ; in, Indicates the number of and The amount of resources allocated between computing nodes, represents the logarithmic function, and Indicates and The queue length of the priority queue, and Indicates and The preset delay threshold of the priority queue, Indicates The delay of a priority queue.

[0026] In an optional embodiment, the expression of the task scheduling objective function is as follows: ; in, Indicates The sum of the energy consumption of the tasks completed by the computing nodes during runtime, Indicates The number of completed tasks on the compute nodes, Indicates The first tasks, Indicates execution of tasks The power consumption is Indicates the task The time to start execution, and Indicates the power consumption of CPU and GPU when no task is running. and Indicates the number of compute nodes The idle time of the CPU and GPU for each CPU / GPU pair, represents the power consumption of components other than the processor in the computing node. Indicates the time when the computing node is turned on. represents the energy consumption of computing nodes turned on and off, Indicates the number of times the computing node is turned on and off; The expression of task scheduling constraints is as follows: ; in, Indicates the task Time of completion, Indicates the task Deadline.

[0027] In an optional embodiment, the task scheduling optimization model is solved based on a particle swarm algorithm to obtain a task processing strategy corresponding to a computing node, including: C1. Randomly generate a group of individuals, and the position of each individual represents the combination of decision variables of the objective function; C2. For each combination of decision variables of the objective function represented by each individual, calculate the fitness value, where the fitness value is the value of the objective function; C3, update the light intensity and attractiveness of the individual, and update the position of the individual based on the light intensity and attractiveness of the individual; C4. Determine whether the training error reaches the convergence value or the number of iterations reaches the maximum value. If the training error reaches the convergence value and the number of iterations reaches the maximum value, the iteration ends and the combination of decision variables of the objective function is output, otherwise the number of iterations increases by 1.

[0028] It should be noted that individuals usually refer to candidate solutions to problems. Each individual represents a set of "combinations of decision variables", that is, a possible value of the input variables of the objective function. By evaluating the fitness of these individuals, the optimal solution to the problem can be gradually found; light intensity usually refers to a certain attraction or influence of an individual in the algorithm. Specifically, light intensity is related to the fitness value of the individual. The better the fitness of the individual, the greater the light intensity. Light intensity can reflect the importance of the individual in the group or its influence in the search space; the position of the individual represents the value of the decision variable. The update of the position of the individual is an important step in the algorithm. The position of the individual (that is, the combination of decision variables) is updated through certain rules and strategies. Usually, the individual will update its own position according to the fitness or the position of the neighboring individuals to explore the solution space.

[0029] In an optional embodiment, the update formula of the individual light intensity is as follows: ; in, and Indicates The first iteration and the The iteration The light intensity of each individual Indicates the preset specific gravity. Indicates the preset scaling factor, Indicates The position of the individual at the iteration, Indicates The fitness value corresponding to the individual's position at the iteration.

[0030] In an optional embodiment, the update formula of the individual's attractiveness is as follows: ; in, represents the attractiveness of an individual, represents the maximum attraction, Indicates Individual and The distance between individuals, and , and Indicates Individual and the location of each individual; The update formula of the individual position is as follows: ; in, and Indicates The first iteration and the The iteration The location of an individual, Indicates The iteration The location of an individual, Indicates The random factor of individuals, Represents the step size scaling factor.

[0031] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.

Claims

1. A GPU program optimization method based on CUDA parallel environment, characterized in that: include: Obtaining a task request issued by a target GPU program, and classifying the task request into priority queues based on priority coefficients of the task request, so as to divide the task request into different priority queues; Calculate the vitality coefficient of each priority queue based on the delay of different priority queues, and perform resource scheduling on each priority queue through each computing node in the computing cluster based on the vitality coefficient of each priority queue, wherein the computing node is composed of a CPU and a GPU; Processing the task request in the priority queue based on the computing node to obtain the task corresponding to the task request, and obtaining the task type corresponding to each subtask in the task based on the task request, wherein the task type includes a CPU task and a GPU task; Acquiring the task type corresponding to each subtask in the task based on the task request to build a task scheduling optimization model, wherein the task scheduling optimization model includes a task scheduling objective function and task scheduling constraints; Solving the task scheduling optimization model based on a particle swarm algorithm to obtain a task processing strategy corresponding to the computing node; The calculation formula of the activity coefficient of the priority queue is as follows: ; in, Indicates The vitality coefficient of the priority queue, Indicates The delay of the priority queue, Indicates The preset delay thresholds of the priority queues, where , Indicates The queue length of the priority queue, Indicates the number of requests entering the queue per unit time. Indicates the number of task requests that leave the queue per unit time.

2. The GPU program optimization method based on the CUDA parallel environment according to claim 1, characterized in that: Priority queue classification is performed on the task request based on the priority coefficient of the task request to divide the task request into different priority queues, including: Calculate the density of the priority coefficients of all task requests, and use the priority coefficient with the largest density as the initial cluster center; The priority coefficients of all task requests are assigned to the class where the nearest cluster center is located according to the size of the priority coefficient and the degree of proximity to the initialized cluster center; Recalculate the new cluster center and compare the current cluster center with the cluster center of the previous round. When the two cluster centers are the same, clustering ends and the cluster grouping results of all task requests are arranged in descending order. According to the clustering classification results of all task requests, corresponding to queues of different priorities, the packets with high priority coefficients are sent to the high priority queue, and the packets with low priority coefficients are sent to the low priority queue.

3. The GPU program optimization method based on CUDA parallel environment according to claim 1, characterized in that: Based on the vitality coefficient of each priority queue, resources are scheduled for each priority queue through each computing node in the computing cluster, including: A CUDA-based device occupancy calculation tool calculates the space coefficient and space idleness of each computing node in the computing cluster; Based on a preset weight, the space coefficient and the device space idleness of each computing node in the computing cluster are integrated to obtain a comprehensive feature of each computing node in the computing cluster; Calculating the allocation coefficient of each computing node in the computing cluster based on the comprehensive characteristics of each computing node in the computing cluster, and obtaining the resource allocation amount of each computing node in the computing cluster based on the allocation coefficient of each computing node in the computing cluster; The activity coefficients of the priority queues are arranged in ascending order to obtain a sequential sequence of activity coefficients, and resources are allocated from the computing nodes corresponding to the priority queues with low activity coefficients to the computing nodes corresponding to the priority queues with high activity coefficients according to the resource allocation amount.

4. The GPU program optimization method based on the CUDA parallel environment according to claim 3, characterized in that: The calculation formula of the space coefficient is as follows: ; in, Indicates the number of The spatial coefficient of the computation nodes, Indicates the number of The number of SMs in a computing node, Represents the CUDA device occupancy calculation function, Indicates the number of The thread block size of the compute nodes, Indicates the number of The number of registers used by threads on a compute node, Indicates the number of The shared memory used by the thread blocks of the compute nodes; The calculation formula of the space idleness is as follows: ; in, Indicates the number of The space idleness of computing nodes, represents the ceiling function, Indicates the number of The thread grid size of the compute nodes, Indicates the number of The network bandwidth of each computing node.

5. The GPU program optimization method based on CUDA parallel environment according to claim 4, characterized in that: The calculation formula of the distribution coefficient is as follows: ; in, Indicates the number of and The distribution coefficient between the computing nodes is and Indicates the number of and The comprehensive characteristics of the computing nodes; The calculation formula of the resource allocation amount is as follows: ; in, Indicates the number of and The amount of resources allocated between computing nodes, represents the logarithmic function, and Indicates and The queue length of the priority queue, and Indicates and The preset delay threshold of the priority queue, Indicates The delay of a priority queue.

6. The GPU program optimization method based on CUDA parallel environment according to claim 1, characterized in that: The expression of the task scheduling objective function is as follows: ; in, Indicates The sum of the energy consumption of the tasks completed by the computing nodes during runtime, Indicates The number of completed tasks on the compute nodes, Indicates The first tasks, Indicates execution of tasks The power consumption is Indicates the task The time to start execution, and Indicates the power consumption of CPU and GPU when no task is running. and Indicates the number of compute nodes The idle time of the CPU and GPU for each CPU / GPU pair, represents the power consumption of components other than the processor in the computing node. Indicates the time when the computing node is turned on. represents the energy consumption of computing nodes turned on and off, Indicates the number of times the computing node is turned on and off; The expression of the task scheduling constraint condition is as follows: ; in, Indicates the task Time of completion, Indicates the task Deadline.

7. The GPU program optimization method based on CUDA parallel environment according to claim 6, characterized in that: The task scheduling optimization model is solved based on the particle swarm algorithm to obtain the task processing strategy corresponding to the computing node, including: A group of individuals is randomly generated, and the position of each individual represents a combination of decision variables of the objective function; For each combination of decision variables of the objective function represented by each individual, calculating a fitness value, wherein the fitness value is the value of the objective function; updating the light intensity and attractiveness of the individual, and updating the position of the individual based on the light intensity and attractiveness of the individual; Determine whether the training error reaches the convergence value or the number of iterations reaches the maximum value. If the training error reaches the convergence value and the number of iterations reaches the maximum value, the iteration ends and outputs the combination of decision variables of the objective function, otherwise the number of iterations increases by 1.

8. The GPU program optimization method based on CUDA parallel environment according to claim 7, characterized in that: The update formula of individual light intensity is as follows: ; in, and Indicates The first iteration and the The iteration The light intensity of each individual Indicates the preset specific gravity. Indicates the preset scaling factor, Indicates The position of the individual at the iteration, Indicates The fitness value corresponding to the individual's position at the iteration.

9. The GPU program optimization method based on CUDA parallel environment according to claim 8, characterized in that: The update formula of the individual's attractiveness is as follows: ; in, represents the attractiveness of an individual, represents the maximum attraction, Indicates Individual and The distance between individuals, and , and Indicates Individual and the location of each individual; The update formula of the individual position is as follows: ; in, and Indicates The first iteration and the The iteration The location of an individual, Indicates The iteration The location of an individual, Indicates The random factor of individuals, Represents the step size scaling factor.

Citation Information

Patent Citations

  • Distributed resource scheduling method and system

    CN108345501A

  • Distributed deep neural network performance modeling method based on an instruction queue

    CN109657794A

  • Multi-level distributed task scheduling method

    CN118093192A

  • Task processing method and system applying robot process automation

    CN119476890A

  • Nanosecond-Scale Power Resource Allocation Method and System for Microservices

    US20220317754A1

Cited By

  • Inter-job fairness scheduling method facing computing power platform

    CN120011090A

  • A Fairness Scheduling Method for Jobs in a Computing Power Platform

    CN120011090B

  • Heterogeneous computing acceleration method and system based on deep learning framework network

    CN120429123A

  • Heterogeneous computing acceleration method and system based on deep learning framework network

    CN120429123B

  • GPU (Graphics Processing Unit) program optimization method for parallel environment

    CN121029422A