Method for solving jitter problem of elastic computing of heterogeneous high-performance streaming computing platform
By dividing data blocks and generating demand data groups in a heterogeneous high-performance streaming computing platform, optimizing data transmission in combination with the working set algorithm, and performing resource preheating and delayed recovery on the GPU side, the jitter problem in heterogeneous computing is solved. , improving system performance and reliability.
Patent Information
- Application Number
- CN202410688248.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-13
AI Technical Summary
In heterogeneous high-performance streaming computing platforms, frequent jitter leads to system performance fluctuations. The existing big data framework lacks targeted solutions, especially the jitter problem generated in the data exchange between main memory and video memory has not been effectively solved. deal with.
By dividing the data in the CPU into multiple data blocks, and generating demand data groups based on the access records of the GPU tasks for prefetching, the data transmission strategy is optimized in combination with the working set algorithm; on the GPU side, resources are recycled through preheating and delay, optimizing Elastic computing expansion and contraction strategies to reduce jitter.
It effectively reduces data transmission jitter between main memory and video memory, improves GPU data reading efficiency, reduces communication overhead, avoids jitter caused by priority preemption, and ensures smooth execution of computing tasks within the specified time.
Smart Images

Figure CN118642843A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and more specifically, to a solution to the jitter problem of elastic computing in a heterogeneous high-performance streaming computing platform. Background Art
[0002] In streaming computing or similar systems, the node expansion and contraction mechanism for dynamic resource scheduling plays a significant role in improving system performance. In such elastic computing, how to deal with jitter is a very important issue. Frequent jitter will cause great fluctuations in the performance of the entire system. At present, popular big data frameworks with streaming computing or batch processing capabilities include Apache Flink, Apache Storm, Apache Kafka Streams, Amazon Kinesis, Google Cloud Dataflow, etc. However, it must be pointed out that all the above big data frameworks do not have sufficiently detailed strategies for elastic computing, especially lack targeted solutions to jitter problems. In addition, in heterogeneous computing scenarios, the capacity of video memory is far from meeting the one-time input or output of data for big data computing. I / O takes up a lot of time or frequently interrupts processor computing, resulting in serious performance waste. For the jitter problem caused by data exchange between main memory and video memory, a lot of time is wasted on page replacement. There is currently no algorithm-level strategy for this problem in heterogeneous scenarios. Summary of the invention
[0003] The purpose of the present invention is to provide a solution to the jitter problem of elastic computing in heterogeneous high-performance streaming computing platforms. Based on the current situation that there is a lack of targeted solutions to the jitter problem in heterogeneous high-performance elastic computing on the market, the elastic computing jitter processing method for heterogeneous high-performance real-time systems not only considers the jitter problem at the data transmission level, but also considers the jitter problem at the elastic computing level, and makes targeted optimizations for high-performance scenarios in related steps of other processes. Solutions are also proposed for detecting continuous jitter and processing jitter that occurs, thereby minimizing the impact of jitter, thereby achieving the ultimate goal of ensuring that computing tasks are successfully executed and completed within the specified time.
[0004] The above technical objectives of the present invention are achieved through the following technical solutions:
[0005] In the first aspect, the present application provides a solution to the jitter problem of elastic computing in a heterogeneous high-performance streaming computing platform. The solution includes a first solution strategy, which is used to solve the jitter problem in data I / O between the GPU and the CPU. The first solution strategy is specifically:
[0006] Divide the data in the CPU into multiple first data blocks according to preset rules, and the size of each first data block does not exceed the amount of data that can be processed by a single computing node at one time;
[0007] Calling access records of each computing task in the GPU, and obtaining a task working set of each computing task according to the access records, wherein the task working set includes a plurality of first data blocks corresponding to the computing task;
[0008] According to the frequency of each first data block in each task working set, a data tag is added to each first data block in the CPU, and the first data block after the data tag is added is determined as the second data block, wherein the data tag includes a reference count and a modification flag;
[0009] Obtain each to-be-executed task of multiple GPUs corresponding to the CPU, generate a corresponding demand data group according to the to-be-executed task by the CPU, the demand data group includes multiple second data blocks, and pre-fetch the demand data group corresponding to the to-be-executed task by each GPU.
[0010] The beneficial effect of the present invention is that: in this solution, the jitter problem in the data transmission strategy between the main memory (CPU) and the video memory (GPU) in the heterogeneous computing scenario is innovatively considered, and an optimization strategy based on the working set algorithm and combined with the heterogeneous computing hardware structure and task characteristics is proposed to reduce the jitter problem.
[0011] In this solution, the data transmission strategy between main memory and video memory is optimized to alleviate the "jitter" problem, allowing the GPU to read the required data faster and reduce the GPU computing power wasted due to communication overhead. At the same time, taking into account the low latency and high reliability characteristics of high-performance computing and real-time systems, an optimized jitter solution strategy is proposed, with special focus on certain application scenarios where GPU computing resources are particularly valuable and the system is often under full load, resulting in jitter problems caused by priority preemption.
[0012] Based on the above technical solution, the present invention can also be improved as follows.
[0013] Furthermore, the CPU generates a corresponding demand data group according to the task to be executed, specifically:
[0014] When the same second data block is required for multiple tasks to be executed in the same GPU, the second data blocks required by the multiple tasks to be executed are placed in the same required data group;
[0015] When the same second data block is required for tasks to be executed in multiple GPUs, a corresponding number of the same second data blocks are copied and generated according to the number of GPUs required, and the second data blocks are placed in different required data groups.
[0016] Furthermore, the above method also includes:
[0017] The second data block whose reference count exceeds the threshold is determined as a hot data block, multiple hot data blocks corresponding to the number of GPUs are copied and generated, and the multiple hot data blocks are respectively resident in each GPU.
[0018] The beneficial effect of adopting the above further solution is: multiple copies of hot data are copied to reside on different GPUs to meet the use of hot data blocks. Since the number of GPUs is generally small, even the number of GPUs in a large cluster will not exceed one thousand, so the redundancy of copying hot data blocks will not cause too much waste.
[0019] Furthermore, the above solution also includes a second solution strategy, which is used to solve the persistent jitter problem in elastic computing expansion and contraction on the GPU side. The second solution strategy is specifically:
[0020] Obtain the amount of system resources in the GPU that are not involved in the computing task. When the proportion of system resources is not less than the preset value, preheat the amount of system resources that are not involved in the computing task according to the preset proportion.
[0021] Obtain the waiting queue of each computing node in the GPU. If the waiting queue of one or more computing nodes exceeds the congestion determination threshold, allocate the system resources in the GPU that are not involved in the computing tasks to each computing node at one time; if the waiting queue of one or more computing nodes triggers the congestion determination threshold, allocate the system resources in the GPU that are not involved in the computing tasks to each computing node in multiple times.
[0022] Get the task execution status of each computing node in the GPU. The task execution status includes unexecuted tasks, executed tasks not exceeding the preset task amount, and normal execution. When the task execution status of a computing node is unexecuted tasks or the executed tasks do not exceed the preset task amount, the resources of the computing node are recycled.
[0023] The beneficial effect of adopting the above further solution is: in GPU-side computing tasks, when system resources are sufficient, the strategy of reducing the number of jitters is adopted by marking redundant nodes and delaying recycling, and the specific delay time is dynamically changed according to the remaining resources of the system.
[0024] Furthermore, when the task execution status of the computing node is that the task is not executed or the amount of executed tasks does not exceed the preset amount of tasks, the resources of the computing node are recycled, specifically:
[0025] When the task execution status of a computing node is that no task has been executed or the amount of executed tasks does not exceed the preset amount of tasks, the computing node is marked;
[0026] Get the amount of system resources in the GPU that are not involved in computing tasks. When the proportion of system resources is not less than the preset value, keep the state of the marked computing node; when the proportion of system resources is less than the preset value, recycle the resources of the computing node.
[0027] Furthermore, the second solution strategy also includes:
[0028] When the computing resources of the computing node are insufficient to meet the computing requirements of the current computing task, the resource category and resource quantity that need to be expanded for the current computing task are obtained, and it is determined whether the expansion resources can be preempted at one time. If the judgment result is yes, the expansion resources are preempted at one time.
[0029] According to the preset priorities of computing tasks of other computing nodes, corresponding expansion resources are seized from each computing node from low priority to high priority computing tasks;
[0030] When a computing task of a computing node completes a resource preemption, the computing task will not perform new resource preemption within the preset interval, and the number of resource preemption requests made by the task within the interval is recorded as a basis for determining whether the resource estimation strategy required by the task is accurate;
[0031] When the priorities of the computing tasks of the computing nodes are the same, the priorities of the computing tasks are re-determined according to the completion time and the amount of computing resources occupied by the computing tasks with the same priority.
[0032] The beneficial effect of adopting the above further scheme is: considering the solution to the jitter problem caused by priority resource preemption when system resources are scarce in GPU-side calculations, by optimizing the details of the preemption operation and the priority regulations of the preemption behavior, the number of preemptions is minimized to avoid the jitter caused by "level-by-level preemption".
[0033] In a second aspect, the present application provides a jitter problem solving system for elastic computing of a heterogeneous high-performance streaming computing platform, which is applied to the jitter problem solving method for elastic computing of a heterogeneous high-performance streaming computing platform in any one of the first aspects. The system includes a first strategy module, which is used to solve the jitter problem in data I / O between the GPU and the CPU. The first strategy module includes:
[0034] The first module is used to divide the data in the CPU into multiple first data blocks according to a preset rule, and the size of a single first data block does not exceed the amount of data that can be processed by a single computing node at one time;
[0035] The second module is used to call the access records of each computing task in the GPU, and obtain the task working set of each computing task according to the access records, where the task working set includes multiple first data blocks corresponding to the computing task;
[0036] The third module is used to add a data tag to each first data block in the CPU according to the frequency of each first data block in each task working set, and determine the first data block after the data tag is added as the second data block, wherein the data tag includes a reference count and a modification flag;
[0037] The fourth module is used to obtain each task to be executed of multiple GPUs corresponding to the CPU, generate a corresponding demand data group according to the task to be executed by the CPU, the demand data group includes multiple second data blocks, and pre-fetch the demand data group corresponding to the task to be executed by each GPU.
[0038] Furthermore, the system further includes a second strategy module, which is used to solve the persistent jitter problem in the elastic computing expansion and contraction on the GPU side. The second strategy module includes:
[0039] The fifth module is used to obtain the amount of system resources in the GPU that are not involved in the computing task. When the proportion of the system resources is not less than a preset value, the amount of system resources that are not involved in the computing task is preheated according to the preset proportion.
[0040] The sixth module is used to obtain the waiting queue of each computing node in the GPU. If the waiting queue of one or more computing nodes exceeds the congestion determination threshold, the system resources in the GPU that are not involved in the computing task are allocated to each computing node at one time; if the waiting queue of one or more computing nodes triggers the congestion determination threshold, the system resources in the GPU that are not involved in the computing task are allocated to each computing node in multiple times;
[0041] The seventh module is used to obtain the task execution status of each computing node in the GPU. The task execution status includes unexecuted tasks, executed tasks not exceeding the preset task amount, and normal execution. When the task execution status of a computing node is unexecuted tasks or the executed tasks do not exceed the preset task amount, the resources of the computing node are recycled.
[0042] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods in the first aspect when executing the computer program.
[0043] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable a computer to execute any one of the methods in the first aspect.
[0044] Compared with the prior art, the present invention has at least the following beneficial effects:
[0045] In this application, the jitter problem in the data transmission strategy between the main memory (CPU) and the video memory (GPU) in the heterogeneous computing scenario is innovatively considered, and an optimization strategy is proposed based on the working set algorithm and combined with the heterogeneous computing hardware structure and task characteristics to reduce the jitter problem; at the same time, the data transmission strategy between the main memory and the video memory is optimized to alleviate the "jitter" problem therein, so that the GPU can read the required data faster and reduce the GPU computing power wasted due to communication overhead; it also takes into account the low latency and high reliability characteristics of high-performance computing and real-time systems, and proposes an optimized jitter solution strategy, which especially focuses on certain application scenarios where GPU computing resources are particularly valuable and the system is often under full load, resulting in jitter problems caused by priority preemption.
[0046] In the present application, multiple copies of hot data are made to reside on different GPUs to meet the use of hot data blocks. Since the number of GPUs is generally small, even the number of GPUs in a large cluster will not exceed a thousand, so the redundancy of copying hot data blocks will not cause too much waste. In GPU-side computing tasks, when system resources are sufficient, a strategy is adopted to reduce the number of jitters by marking redundant nodes and delaying recovery. The specific time of delay is dynamically changed according to the remaining resources of the system. At the same time, a solution to the jitter problem caused by priority resource preemption when system resources are scarce in GPU-side computing is considered. By optimizing the details of the preemption operation and the priority regulations of the preemption behavior, the number of preemptions is minimized to avoid jitter caused by "step-by-step preemption". BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0048] Figure 1 This is a flow chart of a first solution strategy in an embodiment of the present invention;
[0049] Figure 2 This is a flow chart of a second solution strategy in an embodiment of the present invention;
[0050] Figure 3 This is a connection diagram of the first strategy module in an embodiment of the present invention;
[0051] Figure 4 is a connection diagram of the second strategy module in an embodiment of the present invention;
[0052] Figure 5 Schematic diagram of the connection of electronic equipment in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0054] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0056] The strategies for elastic computing of various heterogeneous high-performance streaming computing platforms can be roughly classified into the following categories: (1) Spark and Storm will set a cooldown period when they detect the need to shrink or expand capacity, observe changes in resource demand, and determine whether resources really need to be scheduled; (2) Flink and Kafka will implement gradual expansion and contraction when allocating resources, thereby avoiding jitter caused by scheduling too many resources at one time; (3) Amazon Kinesis and Google Cloud Dataflow will preheat / reserve resources, that is, start a part of the resources for preheating before expanding capacity, thereby shortening the delay time of actual use after expansion; (4) Google Cloud Dataflow also emphasizes the use of feedback control algorithms to dynamically adjust resources, and adjust decisions in real time based on actual resource utilization and latency indicators, rather than directly relying on established threshold rules.
[0057] In heterogeneous elastic computing, the definition of jitter can be divided into two semantic levels: (1) In heterogeneous scenarios, the capacity of the video memory is far from enough to accommodate the data required to complete the calculation of a complete big data task, so the data needs to be calculated step by step or in blocks. As a result, the I / O between the main memory and the video memory may take up a lot of time or frequently interrupt the processor's calculation if the strategy is not appropriate, resulting in performance waste. (2) During the execution of computing tasks on the computing side (generally the GPU device side), the computing node resources are repeatedly expanded and contracted in a short period of time due to changes in system load and task execution status, resulting in a large amount of system time that was originally used for computing being used to deal with resource scheduling problems, resulting in a waste of computing power.
[0058] At the same time, for the second case, this jitter in elastic computing can be further divided into instantaneous jitter and continuous jitter. Instantaneous jitter refers to the situation where capacity is immediately contracted after expansion, or capacity is immediately expanded after contraction, and such behavior only occurs once due to accidental reasons. The following are some situations that may cause instantaneous jitter: (1) When a task is expanded during execution, the task crashes due to some fatal errors and needs to be requeued for calculation. In this case, all resources occupied by the task will be released and recycled by the system; (2) It is also possible that a task has computing peaks and valleys. When it reaches a certain stage, it only needs a small amount of computing resources. After the system has just recycled resources, the amount of resources required increases again, and new resources need to be allocated immediately; (3) It is also possible that due to the crash of a computing node or insufficient resources for a computing task, the node is congested. In order to smooth the peak as soon as possible, the system will allocate computing resources that exceed the requirements for load balancing, and then recycle the excess resources after the congestion is relieved. According to the above possible situations and reasons, instantaneous jitter is difficult to detect and avoid, and has little impact on system performance. In particular, the third point of jitter generated to solve congestion is to solve a problem that has a more serious impact on the system by means of less impact on the system. It is inevitable and does not need to be solved.
[0059] Continuous jitter means that the resource allocation of the same task continues to change over a period of time, and the expansion and contraction operations are repeated. There are many possible reasons for such jitter, such as: (1) computing tasks have periodic fluctuations, and the number of peaks and troughs of the required computing resources varies greatly. In order to make full use of precious computing resources, the system needs to continuously allocate and recycle resources for them; (2) the system resources are close to being exhausted, but multiple tasks are still short of resources and need to be expanded. In some systems with priority settings, high-priority tasks may constantly preempt the computing resources of low-priority tasks, while being preempted by tasks with higher priority. This causes the system, which already lacks computing resources, to waste time processing resource preemption; (3) the system's elastic expansion and contraction strategies have defects. For example, when the task load changes rapidly, the judgment of the amount of resources each time resources are allocated and recycled is not accurate enough; or only focusing on the allocation of computing resources for a single task or a single type, pursuing local optimality instead of achieving global optimality, resulting in more resource scheduling operations; (4) the system cannot perceive the specific reasons for the historical jitter, and cannot make targeted predictions and preparations in advance to actively avoid or reduce the impact of jitter.
[0060] In the description of the embodiments of the present invention, "plurality" means at least 2.
[0061] Embodiment 1:
[0062] This embodiment provides a solution to the jitter problem of elastic computing in a heterogeneous high-performance streaming computing platform. The solution includes a first solution strategy. The first solution strategy is used to solve the jitter problem in data I / O between the GPU and the CPU, such as Figure 1 As shown, the first solution strategy is specifically:
[0063] S1, dividing the data in the CPU into multiple first data blocks according to preset rules, and the size of a single first data block does not exceed the amount of data that can be processed by a single computing node at one time.
[0064] S2, calling the access records of each computing task in the GPU, and obtaining the task working set of each computing task according to the access records, wherein the task working set includes a plurality of first data blocks corresponding to the computing task.
[0065] S3, adding data tags to each first data block in the CPU according to the frequency of each first data block in each task working set, and determining the first data block after adding the data tag as the second data block, the data tag includes the number of references and the modification flag.
[0066] S4, obtaining each to-be-executed task of multiple GPUs corresponding to the CPU, generating a corresponding demand data group according to the to-be-executed task by the CPU, the demand data group including multiple second data blocks, and pre-fetching the demand data group corresponding to the to-be-executed task by each GPU.
[0067] Optionally, the CPU generates a corresponding demand data group according to the task to be executed, specifically:
[0068] S41, when the same second data block is required for multiple tasks to be executed in the same GPU, the second data blocks required by the multiple tasks to be executed are placed into the same required data group.
[0069] S42, when the same second data block is required for tasks to be executed in multiple GPUs, a corresponding number of the same second data blocks are copied and generated according to the number of the multiple GPUs required, and the second data blocks are placed in different required data groups.
[0070] Optionally, the first solution strategy may also include:
[0071] S5, determining the second data block whose reference count exceeds the threshold as a hot data block, copying and generating a plurality of hot data blocks corresponding to the number of GPUs, and making the plurality of hot data blocks resident in each GPU respectively.
[0072] Among them, multiple copies of hot data are copied and reside on different GPUs to meet the use of hot data blocks. Since the number of GPUs is generally small, even the number of GPUs in a large cluster will not exceed a thousand, so the redundancy of copying hot data blocks will not cause too much waste.
[0073] Optionally, the above solution also includes a second solution strategy, which is used to solve the problem of continuous jitter in elastic computing expansion and contraction on the GPU side, such as Figure 2 As shown, the second solution strategy is specifically:
[0074] S6, obtaining the amount of system resources in the GPU that are not involved in the computing task, and when the proportion of the system resources is not less than a preset value, preheating the amount of system resources that are not involved in the computing task according to a preset proportion.
[0075] S7, obtaining the waiting queues of each computing node in the GPU. If the waiting queues of one or more computing nodes exceed the congestion determination threshold, the system resources in the GPU that are not involved in the computing tasks are allocated to each computing node at one time; if the waiting queues of one or more computing nodes trigger the congestion determination threshold, the system resources in the GPU that are not involved in the computing tasks are allocated to each computing node in multiple times.
[0076] S8, obtaining the task execution status of each computing node in the GPU, the task execution status includes unexecuted tasks, executed tasks amount not exceeding the preset task amount and normal execution. When the task execution status of a computing node is unexecuted tasks or the executed tasks amount not exceeding the preset task amount, the resources of the computing node are recycled.
[0077] Optionally, when the task execution status of the computing node is that the task is not executed or the amount of executed tasks does not exceed the preset amount of tasks, the resources of the computing node are recycled, specifically:
[0078] S81, when the task execution status of the computing node is that the task is not executed or the executed task amount does not exceed the preset task amount, the computing node is marked.
[0079] S82, obtain the amount of system resources in the GPU that are not involved in the computing task. When the proportion of the system resources is not less than the preset value, maintain the status of the marked computing node; when the proportion of the system resources is less than the preset value, recycle the resources of the computing node.
[0080] Optionally, the second solution strategy may also include:
[0081] S9, when the computing resources of the computing node are insufficient to meet the computing requirements of the current computing task, obtain the resource category and resource quantity that need to be expanded for the current computing task, and determine whether the expansion resources can be preempted at one time. When the judgment result is yes, the expansion resources are preempted at one time.
[0082] S10, according to the preset priorities of the computing tasks of other computing nodes, corresponding expansion resources are seized from the computing tasks from low priority to high priority from each computing node.
[0083] S11, when the computing task of the computing node completes a resource preemption, the computing task will no longer perform new resource preemption behavior within the preset interval time, and the number of times the task requests to preempt resources within the interval time is recorded as a basis for determining whether the resource estimation strategy required for the task is accurate.
[0084] S12, when the priorities of the computing tasks of the computing nodes are the same, re-determine the priorities of the computing tasks according to the completion time and the amount of computing resources occupied by the computing tasks with the same priority.
[0085] Specifically, based on the current situation that there is a lack of targeted solutions to the jitter problem in heterogeneous high-performance elastic computing on the market, this embodiment proposes an elastic computing jitter processing method that can utilize multiple computing resources and can be used in heterogeneous high-performance real-time systems. It not only considers the jitter problem at the data transmission level, but also the jitter problem at the elastic computing level. Targeted optimization is made for high-performance scenarios in related steps of other processes, and solutions are also proposed for detecting continuous jitter and processing jitter that occurs, so as to minimize the impact of jitter, thereby achieving the ultimate goal of ensuring that the computing task is successfully executed and completed within the specified time.
[0086] Embodiment 2:
[0087] The data transmission problem between the host and device sides can be easily compared to virtual memory, which is similar to the page replacement between main memory and disk. The jitter problem in virtual memory generally refers to when the number of active pages in the system far exceeds the available physical memory capacity, the page replacement operation is too frequent, resulting in a large amount of CPU time being consumed on page scheduling rather than actual computing tasks, which seriously reduces system performance. According to the data transmission between GPU and CPU and the characteristics of the GPU itself, the solution strategy for the virtual memory jitter problem cannot be copied in its entirety. For example, in virtual memory, the frequency of page replacement can be reduced by increasing the physical memory capacity and designing multi-level cache methods such as cache tables, thereby reducing the possibility of jitter. However, although the lack of video memory capacity is also the root cause of I / O jitter between CPU and GPU, the GPU itself is a scarce resource, especially in some special occasions, where the hardware conditions are very limited. How to more efficiently utilize and reduce jitter under limited GPU video memory conditions is the most important consideration.
[0088] Among them, virtual memory still has some aspects that are worth learning from, such as page replacement algorithms that are suitable for various scenarios and task properties. Currently common page replacement algorithms include LRU, CLOCK, working set algorithms, etc. Among them, the current CPU-GPU data transmission itself has taken into account the LRU algorithm. The GPU often has a cache area dedicated to placing received data and data ready to be sent to the host. The working set algorithm predicts "active" pages based on the program's memory access pattern, thereby reducing unnecessary overhead. Specifically, it includes defining a working set for each process, tracking the size of the working set, page replacement, and dynamic adjustment of the working set. The working set defines the set of pages accessed by the program within a certain time window, reflecting the program's memory access "hot spots" within a certain period of time. The core idea is to use the locality principle of the program. This method can be fully ported to heterogeneous computing. The specific steps for GPU-CPU data transmission optimization are:
[0089] (1) First, by referring to page storage, the data in the main memory is divided into blocks according to certain rules, and the block size is set to a size that does not exceed the amount of data that can be processed by a single computing node at one time.
[0090] (2) Define GPU task working set: Similar to the concept of working set in virtual memory, we can also define GPU task working set, which is the set of data blocks that the task that needs to call the GPU for calculation actually needs to access within a certain time window. In addition, considering that the same data block may be required by multiple computing tasks, we add labels such as reference number and modification flag to each data block. The reference number can be used as a reference for adjusting the working set, and the modification flag is used to ensure data consistency, that is, to avoid data inconsistency caused by the data block being read in and modified without being written back to the main memory, and then used and modified by another task.
[0091] (3) Working set size tracking: Continuously detect the size of the current GPU task working set, that is, the actual amount of data required.
[0092] (4) Data transmission priority strategy: Based on the information in the work set, the system can select more "valuable" data blocks for transmission when transmitting data. The value can be determined based on the number of references to the work block (defined as how many currently executing tasks require the work block), the priority of the tasks that require the work block in the system and their execution status (for example, whether all tasks can be completed if only a certain amount of work blocks are missing), whether the type of task that requires the data block is compute-intensive or memory-intensive (for example, a task can start to perform a large amount of calculations after obtaining the work block, making full use of the GPU), the number of times the work block has been swapped in and out in the history record and the most recent swap-out time, etc. The specific steps will be illustrated in the accompanying drawings and embodiments.
[0093] (5) Data block parallel pre-fetching strategy: The system can pre-fetch the required data blocks marked by the currently executed task in advance from the main memory. However, unlike the pre-fetching in the virtual memory, since the application scenario of the present invention is heterogeneous computing, involving multiple GPU cards, the operation of pre-fetching data blocks can also be parallelized. At the same time, multiple data blocks can be pre-fetched to speed up the efficiency of data transmission. Therefore, we aggregate the related data blocks on the main memory into a layer of structure, which can be called a data group. The size of a data group is not fixed. The data blocks required by a task are divided into the same data group as much as possible to facilitate the GPU that is processing the task to pre-fetch. If a data block is required by multiple tasks, the data blocks required by these tasks are also divided into the same group when dividing the data groups. If the tasks that require the data block are not processed on the same GPU, the data block is copied into multiple copies and placed in different data groups. If the number of references to the data block is particularly high, it is regarded as hot data and multiple copies are copied to reside on different GPUs (since the number of GPUs is generally small, even the number of GPUs in a large cluster will not exceed a thousand, so the redundancy of copying hot data blocks will not cause too much waste).
[0094] (6) Dynamic adjustment of working sets: By referring to the LRU algorithm and recording the number of times a data block in the current working set is used (or referenced), the working set is adjusted dynamically. When a data block is eliminated, the working block with the longest unused period, the lowest number of references, and the lowest number of uses is eliminated first.
[0095] Embodiment 3:
[0096] The persistent jitter problem in the expansion and contraction of elastic computing on one side (GPU side) may be caused by a variety of reasons, including sudden changes in system load, defects in system resource scheduling strategies, unstable business needs, inaccurate load prediction, and resource scheduling delays. The above-mentioned mainstream big data frameworks often only consider one or several of the reasons for the expansion and contraction strategies of elastic computing in order to maintain system stability and easy implementation of strategies. For example, the setting of cooling time is mainly to deal with temporary sudden changes in system load, and gradual expansion can reduce the probability of errors in system resource scheduling strategies. However, these strategies, while cautious, will also have the consequence of losing one thing while gaining another. During the cooling time or gradual expansion, the system's delay in resource scheduling will also increase. During this delay, if the node has already been congested, the degree of congestion will continue to increase. It is also possible that there was no congestion at all, but due to untimely resource scheduling, before the new allocated resources are in place, insufficient computing resources may also cause the waiting queue of the task to be full, resulting in new congestion.
[0097] In response to the above problems, this embodiment has made improvements at the strategy level. First of all, a premise that needs to be made clear is that tasks in real-time systems often have the attribute of priority. The present invention combines the overall system design (that is, when the jitter problem solving strategy designed by the present invention is applied to a specific system) to assign a dynamic priority to all tasks being executed, and will continuously adjust the task priority according to various situations during operation. The reference indicators involved include the task execution time, the specified maximum execution time of the task, the initial priority assigned by the user when entering the task, the amount of resources required for the task, and the progress of the task completion, etc. The specific strategy description is as follows:
[0098] 1. When the system is running normally and there are sufficient idle resources, preheat the resources in a certain proportion according to the amount of tasks currently being calculated. The so-called preheating means that before the load increases and new resources need to be allocated, preparations should be made at the system level, including configuring relevant parameters, preparing the operating environment, mobilizing data cache and other operations. The specific operations required are determined by the types of computing tasks currently existing in the system. The proportion of preheated resources is determined by the ratio of the amount of allocated resources to the amount of free resources. When there are more free resources, it means that the current system computing performance is not fully utilized, so more resources can be preheated as preparation; when there are fewer free resources, it is necessary to reduce the preheated resources, because the system performance is not enough to support the burden of maintaining the preheated resources, which may affect the current computing tasks.
[0099] 2. When the task load increases and capacity expansion and allocation of new resources are required, the expected amount of resources to be increased is calculated by combining the relevant indicators of various types of resources in the current system and the tasks being executed. If the waiting queue of the current computing node has exceeded the congestion judgment threshold, the required resources are directly allocated at one time. Even if it may cause subsequent jitter, the severity of the problem caused by the jitter is lower than the damage to system performance caused by the aggravation and spread of congestion; if the current waiting queue only triggers the congestion warning threshold, it can be divided into multiple expansions to avoid subsequent jitter caused by excessive resource allocation. In addition, in the real-time system scenario, different tasks have different priorities. Important tasks and tasks with strict completion time requirements have high priorities. When the system considers capacity expansion, for these high priorities, the new resource allocation requirements must be met through as few expansions as possible to ensure the timely completion of high-priority tasks.
[0100] 3. When a computing node is detected to be idling continuously (i.e., no or very few computing tasks are executed), the elastic computing strategy will consider shrinking the resources of this node. If the current system resources are sufficient, the node can be marked as pending for recycling first, and the actual recycling of node resources can be postponed. This design is based on the consideration that when the computing node does not need to be assigned to other tasks, the idle node can be kept in its original state. Then, in subsequent calculations, if the load of the current node increases again, the pending recycling mark can be directly cancelled, and the original node resources can continue to be used, thereby reducing the number of resource recycling and resource allocation times. The actual time point for recycling node resources also depends on the remaining free resources in the system. The idler the system is, the longer the recycling time is postponed. In extreme cases, all resources can be recycled at once until the task calculation is completed; the busier the system is, the shorter the recycling time is postponed. Postponing recycling needs to be based on the premise that it does not affect the normal operation of the system and does not cause additional burden to the system.
[0101] 4. When the system resources are not sufficient, the cause of jitter is the shortage of the entire system resources. For example, the computing resources have been completely allocated and exhausted, and other tasks in the system also need to be expanded. It is possible that a task preempts the computing resources of low-priority tasks, but is immediately preempted by high-priority tasks. All the original resources, resulting in the task constantly preempting resources and being preempted, and unable to perform normal calculations, seriously wasting computing performance. For this situation, the present invention proposes the following strategies: ① When a computing task needs to meet its own computing needs by preempting resources, first determine the type and quantity of resources it needs, and then preempt them all at once. If it is not possible to preempt them all at once, do not expand the capacity temporarily; ② When determining the source of the preempted resources, the system will sort them according to the priority of the preempted tasks, and preempt them from the resources occupied by the lowest priority tasks, thereby avoiding the situation of preemption at each level (if a task is always preempted and cannot be executed normally, its priority will be dynamically increased according to its "waiting time" to avoid "hunger"); ③ Introduce the minimum time interval for preemption. If a task has just completed a resource preemption, it will no longer be allowed within this interval. The task performs a new preemptive behavior and records the number of times the task requests to preempt resources within the interval as a basis for determining whether the resource estimation strategy required for the task is accurate; ④ Assuming an extreme case, that is, all tasks in the system have the same priority (it can also be used when the demand is still not met after all low-priority resources are preempted, and the situation where resources with the same priority must be considered), the system will estimate the proportion of progress that has been completed for these tasks and the remaining time to the latest delivery date, and give priority to preempting resources for tasks with high completion progress (completing a task in the shortest time to release all occupied computing resources to meet more tasks) and tasks with less remaining time (completing delivery on time), and the latter has a greater priority than the former.
[0102] Embodiment 4:
[0103] This embodiment provides a jitter problem solving system for elastic computing of heterogeneous high-performance streaming computing platform, which is applied to the jitter problem solving method of elastic computing of heterogeneous high-performance streaming computing platform in any one of Embodiments 1 to 3. The system includes a first strategy module, which is used to solve the jitter problem in data I / O between GPU and CPU, such as Figure 3 As shown, the first strategy module includes:
[0104] The first module is used to divide the data in the CPU into multiple first data blocks according to preset rules, and the size of a single first data block does not exceed the amount of data that can be processed by a single computing node at one time.
[0105] The second module is used to call the access records of each computing task in the GPU, and obtain the task working set of each computing task according to the access records, and the task working set includes multiple first data blocks corresponding to the computing task.
[0106] The third module is used to add data tags to each first data block in the CPU according to the frequency of each first data block in each task working set, and determine the first data block with the added data tag as the second data block, and the data tag includes the number of references and the modification flag.
[0107] The fourth module is used to obtain each task to be executed of multiple GPUs corresponding to the CPU, generate a corresponding demand data group according to the task to be executed by the CPU, the demand data group includes multiple second data blocks, and pre-fetch the demand data group corresponding to the task to be executed by each GPU.
[0108] Optionally, the system further includes a second strategy module, which is used to solve the persistent jitter problem in the elastic computing expansion and contraction on the GPU side, such as Figure 4 As shown, the second strategy module includes:
[0109] The fifth module is used to obtain the amount of system resources in the GPU that are not involved in the computing task. When the proportion of the system resources is not less than a preset value, the amount of system resources that are not involved in the computing task is preheated according to the preset ratio.
[0110] The sixth module is used to obtain the waiting queues of each computing node in the GPU. If the waiting queues of one or more computing nodes exceed the congestion determination threshold, the system resources in the GPU that are not involved in the computing tasks are allocated to each computing node at one time; if the waiting queues of one or more computing nodes trigger the congestion determination threshold, the system resources in the GPU that are not involved in the computing tasks are allocated to each computing node in multiple times.
[0111] The seventh module is used to obtain the task execution status of each computing node in the GPU. The task execution status includes unexecuted tasks, executed tasks not exceeding the preset task amount, and normal execution. When the task execution status of a computing node is unexecuted tasks or the executed tasks do not exceed the preset task amount, the resources of the computing node are recycled.
[0112] Embodiment 5:
[0113] This embodiment provides an electronic device, such as Figure 5 As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method of any one of Embodiments 1 to 3 is implemented.
[0114] This embodiment also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable a computer to execute any method of Embodiment 1-Embodiment 3.
[0115] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A solution to the jitter problem of elastic computing in heterogeneous high-performance streaming computing platforms, characterized in that: The solution includes a first solution strategy, which is used to solve the jitter problem in data I / O between the GPU and the CPU. The first solution strategy is specifically: Divide the data in the CPU into a plurality of first data blocks according to a preset rule, and the size of each of the first data blocks does not exceed the amount of data that can be processed at one time by a single computing node; Calling access records of each computing task in the GPU, and obtaining a task working set of each computing task according to the access records, wherein the task working set includes a plurality of first data blocks corresponding to the computing task; According to the frequency of each first data block in each task working set, a data tag is added to each first data block in the CPU, and the first data block after the data tag is added is determined as the second data block, wherein the data tag includes a reference count and a modification flag; Obtain each to-be-executed task of multiple GPUs corresponding to the CPU, generate a corresponding demand data group according to the to-be-executed task by the CPU, the demand data group includes multiple second data blocks, and pre-fetch the demand data group corresponding to the to-be-executed task by each GPU.
2. The method for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to claim 1 is characterized in that: The CPU generates a corresponding demand data group according to the task to be executed, specifically: When the same second data block is required for multiple tasks to be executed in the same GPU, the second data blocks required by the multiple tasks to be executed are placed in the same required data group; When the same second data block is required for tasks to be executed in multiple GPUs, a corresponding number of the same second data blocks are copied and generated according to the number of GPUs required, and the second data blocks are placed in different required data groups.
3. The method for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to claim 1 is characterized in that: The method further comprises: The second data block whose reference count exceeds the threshold is determined as a hot data block, multiple hot data blocks corresponding to the number of GPUs are copied and generated, and the multiple hot data blocks are respectively resident in each GPU.
4. The method for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to claim 1 is characterized in that: The solution also includes a second solution strategy, which is used to solve the persistent jitter problem in elastic computing expansion and contraction on the GPU side. The second solution strategy is specifically: Obtaining the amount of system resources in the GPU that are not involved in the computing task, and when the proportion of the system resources is not less than a preset value, preheating the amount of system resources that are not involved in the computing task according to a preset proportion; Obtain the waiting queue of each computing node in the GPU. If the waiting queue of one or more computing nodes exceeds the congestion determination threshold, allocate the system resources in the GPU that are not involved in the computing tasks to each computing node at one time; if the waiting queue of one or more computing nodes triggers the congestion determination threshold, allocate the system resources in the GPU that are not involved in the computing tasks to each computing node in multiple times. The task execution status of each computing node in the GPU is obtained, where the task execution status includes unexecuted tasks, executed tasks amount not exceeding the preset task amount, and normal execution. When the task execution status of the computing node is unexecuted tasks or the executed tasks amount not exceeding the preset task amount, the resources of the computing node are recycled.
5. The method for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to claim 4 is characterized in that: When the task execution status of the computing node is that the task is not executed or the amount of executed tasks does not exceed the preset task amount, the resources of the computing node are recycled, specifically: When the task execution status of the computing node is that the task is not executed or the amount of executed tasks does not exceed the preset task amount, marking the computing node; Obtain the amount of system resources in the GPU that are not involved in computing tasks. When the proportion of the system resources is not less than a preset value, maintain the state of the marked computing node; when the proportion of the system resources is less than a preset value, recycle the resources of the computing node.
6. The method for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to claim 4 is characterized in that: The second solution strategy also includes: When the computing resources of the computing node are insufficient to meet the computing requirements of the current computing task, the resource category and resource quantity that need to be expanded for the current computing task are obtained, and it is determined whether the expansion resources can be preempted at one time. If the judgment result is yes, the expansion resources are preempted at one time. According to the preset priorities of computing tasks of other computing nodes, corresponding expansion resources are seized from each computing node from low priority to high priority computing tasks; When a computing task of a computing node completes a resource preemption, the computing task will not perform new resource preemption within the preset interval, and the number of resource preemption requests made by the task within the interval is recorded as a basis for determining whether the resource estimation strategy required by the task is accurate; When the priorities of the computing tasks of the computing nodes are the same, the priorities of the computing tasks are re-determined according to the completion time and the amount of computing resources occupied by the computing tasks with the same priority.
7. A system for solving jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms, applied to a solution to jitter problems in elastic computing of heterogeneous high-performance streaming computing platforms according to any one of claims 1 to 6, characterized in that: The system includes a first strategy module, which is used to solve the jitter problem in data I / O between the GPU and the CPU, and the first strategy module includes: A first module is used to divide the data in the CPU into a plurality of first data blocks according to a preset rule, and the size of each of the first data blocks does not exceed the amount of data that can be processed at one time by a single computing node; The second module is used to call the access records of each computing task in the GPU, and obtain the task working set of each computing task according to the access records, wherein the task working set includes a plurality of first data blocks corresponding to the computing task; The third module is used to add a data tag to each first data block in the CPU according to the frequency of each first data block in each task working set, and determine the first data block after the data tag is added as the second data block, wherein the data tag includes a reference count and a modification flag; The fourth module is used to obtain each task to be executed of multiple GPUs corresponding to the CPU, generate a corresponding demand data group according to the tasks to be executed by the CPU, the demand data group includes multiple second data blocks, and pre-fetch the demand data group corresponding to the tasks to be executed by each GPU.
8. The jitter problem solving system for elastic computing of heterogeneous high-performance streaming computing platform according to claim 7 is characterized in that: The system further includes a second strategy module, which is used to solve the problem of persistent jitter in elastic computing expansion and contraction on the GPU side, and the second strategy module includes: The fifth module is used to obtain the amount of system resources in the GPU that are not involved in the computing task, and when the proportion of the system resources is not less than a preset value, preheat the amount of system resources that are not involved in the computing task according to a preset ratio; The sixth module is used to obtain the waiting queue of each computing node in the GPU. If the waiting queue of one or more computing nodes exceeds the congestion determination threshold, the system resources in the GPU that are not involved in the computing task are allocated to each computing node at one time; if the waiting queue of one or more computing nodes triggers the congestion determination threshold, the system resources in the GPU that are not involved in the computing task are allocated to each computing node in multiple times; The seventh module is used to obtain the task execution status of each computing node in the GPU, the task execution status includes unexecuted tasks, executed tasks amount not exceeding the preset task amount and normal execution. When the task execution status of the computing node is unexecuted tasks or the executed tasks amount does not exceed the preset task amount, the resources of the computing node are recycled.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the method according to any one of claims 1 to 6 is implemented when the processor executes the computer program.
10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which enable a computer to execute the method of any one of claims 1-6.
