A data processing method, product, server and medium

By dividing tasks into subtasks and automatically allocating memory according to memory requirements, the problem of tasks seizing memory bandwidth in high-performance computing systems is solved, achieving efficient utilization of memory and bandwidth and full utilization of resources.

CN118409871BActive Publication Date: 2024-09-17SHANDONG HAILIANG INFORMATION TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410874865.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-17
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In high-performance computing systems, task scheduling time sequentially applies for memory, causing a certain task to violently seize memory bandwidth and unable to efficiently utilize memory and bandwidth.

Method used

By dividing the task into subtasks and deploying them on the graphics processors respectively, the additional memory space required to process the subtasks on each graphics processor is obtained, and the target memory to be occupied is determined based on the relationship between the additional memory space and the available target memory space. , to achieve efficient utilization of memory and bandwidth.

Benefits of technology

It realizes that tasks on each graphics processor will not seize memory and bandwidth, automatically allocate different types of memory, make full use of graphics processor resources, support the computing power requirements of large and ultra-large models, and improve hybrid memory usage efficiency and communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118409871B
    Figure CN118409871B
Patent Text Reader

Abstract

The present invention discloses a data processing method, product, server and medium, and relates to the technical field of servers. In the method, since the target memory space is divided into each graphics processor in advance, when the target memory to be occupied by the graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the available target memory space, each graphics processor can be allowed to occupy the available target memory space allocated to it in advance, so that the tasks on each graphics processor will not occupy the memory and bandwidth, and the memory and bandwidth are efficiently used; the occupation of different types of memory is automatically allocated by calculating the additional memory size required by different tasks on different graphics processors, so that different tasks occupy different memories according to their own characteristics; because the subtasks correspond to the graphics processors one by one, the resources of the graphics processors can be fully utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a data processing method, product, server and medium. Background Art

[0002] The amount of data that needs to be processed by high performance computing (HPC) systems is growing exponentially, which forces HPC data centers to use emerging hardware technologies such as graphics processing units (GPUs), data processing units (DPUs), and field-programmable gate arrays (FPGAs) to accelerate processing. Due to the limited high bandwidth memory (HBM) of accelerators, accelerators usually read / write data from main memory and / or compute express link (CXL) memory.

[0003] In the related memory allocation method, memory is usually applied for in each memory in turn according to the task (ie, workload) scheduling time. This method often results in a task intensively occupying the bandwidth of a certain memory, resulting in inefficient use of memory and bandwidth.

[0004] It can be seen that how to balance the memory application occupation of tasks on each GPU and achieve efficient use of memory and bandwidth is a technical problem that people in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a data processing method, product, server and medium to solve the technical problem that when applying for memory occupation in each memory in turn according to the task (i.e. workload) scheduling time, a task often drastically occupies the bandwidth of a certain memory, resulting in inefficient use of memory and bandwidth.

[0006] In order to solve the above technical problems, the present invention provides a data processing method, comprising:

[0007] Acquire a task and deploy each subtask divided from the task on a graphics processor, wherein the subtask corresponds to the graphics processor one by one;

[0008] Acquire additional memory space required for processing subtasks on each of the graphics processors; wherein the additional memory space is the difference obtained by subtracting the memory space of the graphics processor from the sum of the memory space required for processing subtasks on the graphics processor, and the target memory to which the additional memory space belongs includes at least system memory and computing fast link memory;

[0009] Dividing the target memory space into each of the graphics processors to obtain available target memory space of each of the graphics processors;

[0010] The target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the determined available target memory to be occupied to process the task.

[0011] On the one hand, there are multiple tasks, and the step of dividing the task into subtasks and deploying them on the graphics processor includes:

[0012] Obtain the number of graphics processors in the system;

[0013] Divide each of the tasks into a preset number of subtasks; wherein the preset number is the same as the number of graphics processors in the system;

[0014] Deploy the subtasks divided from the tasks on corresponding graphics processors respectively;

[0015] The acquiring of the additional memory space required for processing the subtasks on each of the graphics processors comprises:

[0016] The additional memory space required for processing the target subtask on each of the graphics processors is obtained; wherein the target subtask is the sum of the subtasks corresponding to all the tasks deployed on each of the graphics processors.

[0017] On the other hand, the step of respectively deploying the subtasks divided from the tasks on the corresponding graphics processors includes:

[0018] Obtaining the memory space required for each of the tasks;

[0019] Sorting all the tasks in order of the size of the memory space required by each task;

[0020] A subtask in each of the tasks is deployed on the same graphics processor according to the order of the tasks.

[0021] On the other hand, deploying a subtask in each of the tasks on the same graphics processor according to the order of the tasks includes:

[0022] Setting a unique number for each of the graphics processors and sorting the graphics processors in the order of the unique numbers corresponding to the graphics processors to obtain the order of the graphics processors;

[0023] Unique numbers are set for the subtasks in each of the tasks respectively and the subtasks are sorted in each of the tasks according to the unique numbers of the subtasks to obtain the order of the subtasks in each of the tasks;

[0024] Get the number of all said tasks;

[0025] Determining the deployment order of the subtasks in each of the tasks when they are deployed on the graphics processors according to the relationship between the number of the tasks and the number of the graphics processors in the system; wherein the deployment order includes forward deployment according to the order of the graphics processors and reverse deployment according to the order of the graphics processors; when the subtasks in each of the tasks are forward deployed or reverse deployed, the starting subtasks in each of the tasks are deployed on different graphics processors;

[0026] The subtasks in each of the tasks are deployed on the corresponding graphics processor according to the order of the tasks and in combination with the order of the subtasks in each of the tasks and the deployment order, so that a subtask in each of the tasks is deployed on the same graphics processor.

[0027] On the other hand, determining the deployment order of the subtasks in each task when deployed on the graphics processor according to the relationship between the number of the tasks and the number of the graphics processors in the system includes:

[0028] When it is detected that the number of the tasks is less than or equal to the number of the graphics processors in the system, determining that the deployment order of the subtasks in each of the tasks when being deployed on the graphics processor is a forward deployment order;

[0029] When it is detected that the number of the tasks is greater than the number of the graphics processors in the system, the deployment order of the subtasks in each of the tasks when being deployed on the graphics processor is determined to be a reverse deployment order.

[0030] On the other hand, determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space includes:

[0031] Obtaining the priority order of each of the target memories;

[0032] When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is less than or equal to the available target memory space corresponding to the target memory of the first priority, determining that the target memory to be occupied by each of the graphics processors is the target memory of the first priority;

[0033] When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is greater than the available target memory space of the corresponding first-priority target memory, and is less than or equal to the available target memory space of the second-priority target memory, it is determined that the target memory to be occupied by each of the graphics processors is the first-priority target memory and the second-priority target memory.

[0034] In another aspect, the method further comprises:

[0035] When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is greater than the available target memory space of the target memory of the first priority and greater than the available target memory space of the target memory of the second priority, it is determined that the target memory to be occupied by each of the graphics processors is the target memory of the first priority, the target memory of the second priority and the target memory of the third priority; wherein the target memory of the third priority is other memory, and the other memory includes at least hard disk memory.

[0036] On the other hand, the target memory of the first priority is the system memory, the target memory of the second priority is the computing quick link memory, and the target memory of the third priority is other memory.

[0037] On the other hand, determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the determined available target memory to be occupied to process the task includes:

[0038] Determine the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing the subtask on the current graphics processor and the available target memory space of the current graphics processor, so that the current graphics processor occupies the determined available target memory space on the target memory to be occupied to process the task;

[0039] Obtain the next graphics processor of the current graphics processor, and use the next graphics processor of the current graphics processor as the new current graphics processor, return to the step of determining the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing subtasks on the current graphics processor and the available target memory space of the current graphics processor, and stop returning until the target memory to be occupied by all the graphics processors is determined.

[0040] On the other hand, determining the available target memory space of the current graphics processor includes:

[0041] Obtaining the number of remaining graphics processors and the remaining space capacity of target memory of each priority level; wherein the number of remaining graphics processors is the difference between the number of all graphics processors in the system and the number of graphics processors that have been determined to occupy target memory; the remaining space capacity of target memory of each priority level is the difference between the total space capacity of target memory of each priority level and the occupied space capacity of target memory of each priority level; wherein the target memory of each priority level includes at least a target memory of a first priority level and a target memory of a second priority level;

[0042] The available target memory space of the current graphics processor on the target memory of each priority level is determined according to the ratio of the remaining space capacity of the target memory of each priority level to the number of the remaining graphics processors.

[0043] On the other hand, determining the available target memory space of the current graphics processor on the target memory of each priority level according to the ratio of the remaining space capacity of the target memory of each priority level to the number of the remaining graphics processors includes:

[0044] When it is detected that there is no graphics processor occupying the target memory of the first priority, obtaining a first ratio result between the space capacity of the target memory of each priority and the number of all the graphics processors, and using each of the first ratio results as the available target memory space of the current graphics processor on the target memory of the corresponding priority;

[0045] In the case where it is detected that there is the graphics processor that has occupied the target memory of the first priority and there is no graphics processor that has occupied the target memory of the second priority, obtaining a second ratio result between the remaining space capacity of the target memory of the first priority and the number of the remaining graphics processors, and using the second ratio result as the available target memory space of the current graphics processor on the target memory of the first priority; obtaining a third ratio result between the space capacity of the target memory of the second priority and the number of the remaining graphics processors, and using the third ratio result as the available target memory space of the current graphics processor on the target memory of the second priority;

[0046] When it is detected that there is the graphics processor that has occupied the target memory of the first priority and there is the graphics processor that has occupied the target memory of the second priority, a fourth ratio result between the remaining space capacity of the target memory of the first priority and the remaining number of the graphics processors is obtained, and the fourth ratio result is used as the available target memory space of the current graphics processor on the target memory of the first priority; and a fifth ratio result between the remaining space capacity of the target memory of the second priority and the remaining number of the graphics processors is obtained, and the fifth ratio result is used as the available target memory space of the current graphics processor on the target memory of the second priority.

[0047] On the other hand, each of the graphics processors occupies the determined available target memory space on the target memory to be occupied to process the task, including:

[0048] Each of the graphics processors occupies the determined available target memory space on the target memory to be occupied to process the starting subtask of each of the tasks, and receives the result of processing the starting subtask of each of the tasks in the available target memory space, so as to process each subtask according to the result of processing the starting subtask and in the order of the subtasks in each of the tasks.

[0049] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above data processing method when executed by a processor.

[0050] In order to solve the above technical problem, the present invention further provides a server, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to implement the steps of the above-mentioned data processing method when executing the computer program.

[0053] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above data processing method are implemented.

[0054] The data processing method provided by the present invention includes acquiring a task and deploying each subtask divided from the task on a graphics processor respectively, acquiring the additional memory space required for processing the subtasks on each graphics processor and the available target memory space of each graphics processor, and finally determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtasks on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task.

[0055] The beneficial effects of the present invention are as follows: firstly, in the method, since the target memory space is divided into each graphics processor in advance, when the target memory to be occupied by the graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the available target memory space, each graphics processor can be allowed to occupy the available target memory space allocated to it in advance, so that the tasks on each graphics processor will not occupy the memory and bandwidth, thereby achieving efficient use of memory and bandwidth; secondly, when the additional memory space required for processing subtasks on each graphics processor is obtained and the target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space, that is, by calculating the different available target memory spaces on different graphics processors, the target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space. The additional memory size required by the task is used to automatically allocate the occupancy of different types of memory, so that different tasks occupy different memories according to their own characteristics; and because the additional memory space is the difference between the sum of the memory space required for processing subtasks on the graphics processor and the memory space of the graphics processor, that is, all subtasks are comprehensively considered on the graphics processor, and the selection of appropriate target memory for use by the graphics processor is guaranteed as much as possible; thirdly, the subtasks divided from the task are deployed on the graphics processor respectively; since the subtasks correspond to the graphics processor one-to-one, the resources of the graphics processor can be fully utilized; moreover, the target memory in this method includes at least system memory and computing fast link memory, which realizes the deployment of multiple memory resources on the server platform to support the huge computing power requirements in large models and even super-large models.

[0056] In addition, in the process of deploying the subtasks divided from the task on the graphics processors, each task is divided into a preset number of subtasks, the preset number being the same as the number of graphics processors, so that each task can be evenly distributed to each graphics processor;

[0057] When deploying the subtasks divided from each task on the corresponding graphics processor, a subtask in each task is deployed on the same graphics processor in consideration of the size of the memory space required by the task. Specifically, the deployment order of the subtasks in each task when deployed on the graphics processor is determined according to the relationship between the number of tasks and the number of graphics processors in the system, and the subtasks in each task are deployed on the corresponding graphics processor according to the order of the tasks and in combination with the order and deployment order of the subtasks in each task, so as to ensure the load balance on each graphics processor as much as possible, and by numbering and sorting each graphics processor and numbering and sorting the subtasks in each task, each task can be deployed on the graphics processor in an orderly manner, and the situation of the tasks deployed on each graphics processor can be understood according to each number;

[0058] Since high-priority tasks may have higher performance requirements or be more sensitive to delays, the method provided by the present invention uses the priority order of the target memory as the target memory to be occupied by each graphics processor, so that the memory can be allocated preferentially to speed up the processing speed of these tasks;

[0059] The target memory used includes system memory, computing fast links, and other memory. That is, through the hybrid memory layout task, the hybrid memory usage efficiency can be effectively improved, the communication efficiency of different bandwidths can be maximized, and the performance of computationally intensive workloads such as artificial intelligence (AI) can be improved. At the same time, this implementation method can make full use of the resources of each underlying hardware (i.e. hybrid memory) and support the huge memory requirements of data-intensive workloads and even super-large model training by deploying multiple memory resources on the server platform;

[0060] When determining the target memory to be occupied by each graphics processor, the space occupied by other graphics processors on the target memory is fully considered, and the remaining space capacity is evenly distributed to the graphics processors whose target memory has not been determined to be occupied, thereby dynamically adjusting the allocated memory and ensuring the balance of memory allocation as much as possible.

[0061] In addition, the present invention also provides a computer program product, a server and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned data processing method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1 A schematic diagram of a traditional hybrid memory allocation solution provided by an embodiment of the present invention;

[0064] Figure 2 A flowchart of a data processing method provided by an embodiment of the present invention;

[0065] Figure 3 A schematic diagram of a hybrid memory allocation solution provided by an embodiment of the present invention;

[0066] Figure 4 A flowchart of a dynamic perception hybrid memory allocation method provided by an embodiment of the present invention;

[0067] Figure 5A schematic diagram of a multi-GPU system supporting main memory and CXL memory provided by an embodiment of the present invention;

[0068] Figure 6 A structural diagram of a server provided in another embodiment of the present invention. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. 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.

[0070] The core of the present invention is to provide a data processing method, product, server and medium to solve the technical problem that when applying for memory occupation in each memory in turn according to the task (i.e. workload) scheduling time, a task often drastically occupies the bandwidth of a certain memory, resulting in the inefficient use of memory and bandwidth.

[0071] Currently, the amount of data that HPC systems need to process is growing exponentially, involving various disciplines in industry, research, and academia, which forces HPC data centers to leverage emerging hardware technologies such as GPUs, DPUs, and FPGAs to accelerate processing. Running HPC workloads on such accelerators transforms them from compute-bound to memory- and data-bound. Such accelerator-based HPC workloads are typically memory-, data-, and data-intensive, and often involve large-scale simulations, complex calculations, and large amounts of data processing, generating and manipulating large amounts of intermediate and output data. These workloads require fast and efficient memory and data operations to read and write data in memory and storage systems, as well as to exchange data between devices or servers in distributed computing environments. Therefore, efficient data management, storage, and data operations are key factors in achieving high performance and scalability for HPC workloads.

[0072] GPU accelerators face limitations in terms of memory capacity and memory bandwidth due to the limited HBM memory of the accelerator. In particular, when workloads such as adjoint computations (e.g., reverse time migration and quantum optimal control), DL, and other scientific simulations involve iterative reads and writes of terabytes of data, the GPU is forced to perform frequent data reads / writes to main memory given its limited HBM capacity. In addition, direct memory access (DMA) can be used to facilitate faster transfers across GPU HBM and host memory. In order to overlap computation transfers, the GPU pins memory to main memory. However, in a multi-GPU setup, this pinning limits the amount of main memory available to other GPUs in the system, resulting in significant data transfer overhead or even job failure if the required amount of memory cannot be pinned before launching the computation.

[0073] Furthermore, CXL memory has emerged. CXL memory is an emerging high-speed interconnect memory technology that provides an effective means to solve challenges such as limited memory capacity and bandwidth and memory stranding. Due to its byte-addressable, cache-coherent, low-latency and unified access features, it has gained rapid development in the HPC and cloud computing fields. CXL memory can alleviate the challenges of limited available memory.

[0074] Traditional workload allocation and memory layout strategies often have major flaws. Since CXL memory is used for memory expansion, the operating system considers it a logical extension of local memory and expands the physical memory address space, appending the CXL memory address at the end of the main memory address. Under this design, the initial allocation of memory starts from the main memory, and after the main memory is completely exhausted, further allocations are mapped to the CXL memory. Figure 1 A schematic diagram of a traditional hybrid memory allocation solution provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, it contains 4 GPUs and 2 tasks, among which task 0 is deployed on GPU a alone, and task 1 is deployed on GPU b, GPU c and GPU d. Each task is connected to the host through the fast peripheral component interconnect bus to access the system memory; and accesses the computing fast link memory through the fast peripheral component interconnect bus after passing through the host. Figure 1 As you can see, the earlier started tasks ( Figure 1 The orange part in the middle allocates and pins the required memory from the system memory (i.e., main memory) (consuming 90%), forcing the subsequent jobs ( Figure 1In this case, although the compute fast link memory increases memory capacity, the data read / write throughput of task 2 running on GPU b, GPU c, and GPU d is negatively affected by the contention on the fast peripheral component interconnect express (PCIE) interface of the compute fast link device. Assuming that all GPUs need to transfer data to the host in parallel, such memory allocation will allow GPU a to utilize all system memory bandwidth, while GPU b, GPU c, and GPU d compete for access to their respective data on the host and compute fast link memory, resulting in inefficient use of memory and bandwidth.

[0075] Therefore, a data processing method provided by an embodiment of the present invention divides the target memory space into each graphics processor in advance. Therefore, when the target memory to be occupied by the graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the available target memory space, each graphics processor can occupy the available target memory space allocated to it in advance, so that the tasks on each graphics processor will not occupy memory and bandwidth, thereby achieving efficient use of memory and bandwidth.

[0076] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 2 A flowchart of a data processing method provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method includes:

[0077] S10: Acquire the task and deploy each subtask divided from the task on the graphics processor respectively; wherein the subtask corresponds to the graphics processor one by one;

[0078] S11: obtaining additional memory space required by each graphics processor to process the subtask;

[0079] S12: Divide the target memory space into each graphics processor to obtain an available target memory space of each graphics processor;

[0080] S13: determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task.

[0081] There is no limitation on the tasks, which are determined according to the actual situation. The tasks need to be deployed on the graphics processor, and then interact with the memory through the graphics processor. There is no limitation on the number of deployed graphics processors. It should be noted that the memory here includes system memory (i.e. main memory), computing fast link memory and other memory (such as hard disk memory, etc.). In order to avoid processing a large number of tasks on one graphics processor while processing fewer tasks on other graphics processors, that is, the problem of uneven task distribution on each graphics processor, each task is divided into multiple subtasks in the embodiment of the present invention, and each subtask is deployed on a graphics processor, so that there is a large difference in the amount of tasks deployed on each graphics processor.

[0082] After each subtask is divided into tasks and deployed on the corresponding graphics processor, in order to ensure that the subtask can be processed, the additional memory space required for processing the subtask on each graphics processor is further obtained. The additional memory space is the difference between the sum of the memory space required for processing the subtask on the graphics processor and the memory space of the graphics processor. The target memory to which the additional memory space belongs includes at least the system memory and the computing fast link memory. In practice, if the system memory and the computing fast link memory are still not enough to process the subtask, other memory, such as hard disk memory, can continue to be used.

[0083] In order to avoid multiple graphics processors from competing for memory and bandwidth, in an embodiment of the present invention, the target memory space is divided into each graphics processor to obtain the available target memory space of each graphics processor. It should be noted that, in implementation, when it is determined that there is a graphics processor with occupied target memory space, the available target memory space of other graphics processors whose occupied target memory space has not been determined can be updated. For example, if there are originally three graphics processors with determined occupied target memory, the target memory space can be evenly divided among the three graphics processors as the available target memory space of the three graphics processors. However, if it has been determined that there is one graphics processor with occupied target memory space, it is necessary to evenly divide the target memory space remaining in the target memory except for the target memory occupied by the graphics processor with occupied target memory space among the remaining two graphics processors whose occupied target memory space is to be determined, thereby realizing the update of the available target memory space of the graphics processor.

[0084] After obtaining the additional memory space and available target memory space required for processing subtasks on each graphics processor, the target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task. Specifically, when the additional memory space required for processing subtasks on the graphics processor is greater than the corresponding available target memory space, it can be determined that the target memory to be occupied is a target memory space of another type other than the current target memory; if the additional memory space required for processing subtasks on the graphics processor is less than or equal to the corresponding available target memory space, it can be determined that the target memory to be occupied is the current target memory. If the additional memory space required for processing subtasks on the graphics processor is greater than the corresponding available target memory space on the system memory, it can be determined that the target memory to be occupied is a computing quick link memory, etc.; if the additional memory space required for processing subtasks on the graphics processor is less than or equal to the corresponding available target memory space on the system memory, it can be determined that the target memory to be occupied is the system memory.

[0085] In the method provided by the embodiment of the present invention, firstly, since the target memory space is divided into each graphics processor in advance, when the target memory to be occupied by the graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the available target memory space, each graphics processor can be allowed to occupy the available target memory space allocated to it in advance, so that the tasks on each graphics processor will not occupy memory and bandwidth, thereby achieving efficient use of memory and bandwidth; secondly, when obtaining the additional memory space required for processing subtasks on each graphics processor and determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space, that is, by calculating the relationship between different tasks on different graphics processors, the target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space. The occupancy of different types of memory is automatically allocated according to the additional memory size required by the task, so that different tasks occupy different memories according to their own characteristics; and because the additional memory space is the difference between the sum of the memory space required for processing subtasks on the graphics processor and the memory space of the graphics processor, that is, all subtasks are comprehensively considered on the graphics processor, and the selection of appropriate target memory for use by the graphics processor is guaranteed as much as possible; thirdly, the subtasks divided from the task are deployed on the graphics processor respectively; since the subtasks correspond to the graphics processor one by one, the resources of the graphics processor can be fully utilized; moreover, the target memory in this method includes at least system memory and computing fast link memory, which realizes the deployment of multiple memory resources on the server platform to support the huge computing power requirements in large models and even super-large models.

[0086] The following is a detailed description of the process of allocating tasks (such as AI workloads) under multiple GPUs. In implementation, there are multiple tasks. In order to evenly allocate each task to each GPU, the subtasks divided from the task are deployed on the GPUs separately, including:

[0087] Get the number of graphics processors in the system;

[0088] Divide each task into a preset number of subtasks; wherein the preset number is the same as the number of graphics processors in the system;

[0089] Deploy each subtask divided from each task on the corresponding graphics processor;

[0090] The additional memory space required to process subtasks on each GPU is obtained by:

[0091] The additional memory space required for processing the target subtask on each GPU is obtained; wherein the target subtask is the sum of the subtasks corresponding to all tasks deployed on each GPU.

[0092] There is no limit on the preset number, as long as it is the same as the number of graphics processors in the system. In this method, each subtask divided from the task is deployed on the graphics processor, and each task is divided into a preset number of subtasks, which is the same as the number of graphics processors, so that each task can be evenly distributed to each graphics processor.

[0093] In practice, since different tasks have different sizes, in order to ensure load balancing on each GPU, in implementation, each subtask divided from each task is deployed on the corresponding GPU, including:

[0094] Get the memory space required for each task;

[0095] Sort all tasks in the order of the memory space required by each task;

[0096] A subtask of each task is deployed on the same GPU according to the order of the tasks.

[0097] Here, sorting all the tasks in the order of the size of the memory space required by each task may be sorting all the tasks in the order from large to small or from small to large according to the size of the memory space required by each task.

[0098] Deploying a subtask of each task on the same GPU according to the order of the tasks includes:

[0099] Setting a unique number for each graphics processor and sorting the graphics processors in the order of the unique numbers corresponding to the graphics processors to obtain the order of the graphics processors;

[0100] Unique numbers are set for the subtasks in each task respectively and the subtasks are sorted in each task according to the unique numbers of the subtasks to obtain the order of the subtasks in each task;

[0101] Get the number of all tasks;

[0102] Determine the deployment order of subtasks in each task when they are deployed on the graphics processors according to the relationship between the number of tasks and the number of graphics processors in the system; wherein the deployment order includes forward deployment according to the order of the graphics processors and reverse deployment according to the order of the graphics processors; when forward deployment or reverse deployment of subtasks in each task, the starting subtasks in each task are deployed on different graphics processors;

[0103] The subtasks in each task are deployed on the corresponding graphics processor according to the order of the tasks and in combination with the order and deployment order of the subtasks in each task, so that a subtask in each task is deployed on the same graphics processor.

[0104] If there are three graphics processors, namely graphics processor a, graphics processor b and graphics processor c, the forward deployment is to deploy them in the order of graphics processor a, graphics processor b and graphics processor c, and the reverse deployment is to deploy them in the order of graphics processor c, graphics processor b and graphics processor a.

[0105] The order in which the subtasks in each task are deployed on the GPU is determined based on the relationship between the number of tasks and the number of GPUs in the system:

[0106] When it is detected that the number of tasks is less than or equal to the number of graphics processors in the system, determining that the deployment order of subtasks in each task when being deployed on the graphics processor is a forward deployment order;

[0107] When it is detected that the number of tasks is greater than the number of graphics processors in the system, the deployment order of subtasks in each task when being deployed on the graphics processor is determined to be a reverse deployment order.

[0108] In order to enable those skilled in the art to better understand the process of allocating tasks (such as AI workloads) under the multi-graphics processors provided by the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0109] Assume that the whole system has There are graphics processor devices, namely, graphics processor numbered 0, graphics processor numbered 1, ..., graphics processor numbered Graphics processor (expressed as: The tasks that need to be deployed are There are task 0, task 1, ..., task (expressed as ), the process of dividing each task is as follows:

[0110] 1) Divide each task into subtasks (i.e. Stages):

[0111] ;in, Indicates task.

[0112] It should be noted that the tasks of each graphics processor occupying the available target memory space on the determined target memory to be occupied include:

[0113] Each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the starting subtask of each task, and receives the result of processing the starting subtask of each task in the available target memory space, so as to process each subtask according to the result of processing the starting subtask and in the order of subtasks in each task. That is, after the stage tasks are divided, only the tasks of the first stage Only then will it interact with the system memory or other memory. The tasks in the later stages only receive the results sent by the previous stage;

[0114] 2) Calculate the memory required for each task , reorder the entire task by the required memory size:

[0115] ;

[0116] 3) Deploy each task in turn. The deployment principles are as follows:

[0117] For a task,

[0118] ;

[0119] ;

[0120] For Tasks, deployment method:

[0121] ;

[0122] When the number of tasks Greater than the number of GPUs When the GPU is deployed, the GPU is deployed in reverse order, that is, the deployment starts from the last GPU device;

[0123] .

[0124] Figure 3 A schematic diagram of a hybrid memory allocation solution provided by an embodiment of the present invention. Figure 3 As shown, the tasks are first divided and deployed on different graphics processor devices. Figure 3 The number of tasks in is 4, and the number of GPUs is 4. Among them, the subtasks of task 0 are subtask 00, subtask 01, subtask 02 and subtask 03; the subtasks of task 1 are subtask 10, subtask 11, subtask 12 and subtask 13; the subtasks of task 2 are subtask 20, subtask 21, subtask 22 and subtask 23; the subtasks of task 3 are subtask 30, subtask 31, subtask 32 and subtask 33. Among them, subtask 00, subtask 13, subtask 22 and subtask 31 are all deployed on GPU a; subtask 01, subtask 10, subtask 23 and subtask 33 are all deployed on GPU b; subtask 02, subtask 11, subtask 20 and subtask 33 are all deployed on GPU c; subtask 03, subtask 12, subtask 21 and subtask 30 are all deployed on GPU d.

[0125] After the workload is divided using the above strategy, the additional memory required by the workload deployed on each GPU is relatively balanced. The deployed GPUs access the system memory at a consistent frequency. There will not be a situation where one GPU accesses a large amount of memory while other GPUs do not need to access the memory, thus fully utilizing the bandwidth from each GPU to the memory.

[0126] The above describes the allocation of tasks under multiple graphics processors. In this implementation, memory is further allocated to each graphics processor. The target memory to be occupied by each graphics processor is determined based on the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space, including:

[0127] Get the priority order of each target memory;

[0128] When it is detected that the additional memory space required for processing the subtasks on each graphics processor is less than or equal to the available target memory space corresponding to the target memory of the first priority, determining the target memory to be occupied by each graphics processor to be the target memory of the first priority;

[0129] When it is detected that the additional memory space required for processing the subtasks on each graphics processor is greater than the available target memory space of the corresponding first-priority target memory, and is less than or equal to the available target memory space of the second-priority target memory, it is determined that the target memory to be occupied by each graphics processor is the first-priority target memory and the second-priority target memory.

[0130] In practice, it may happen that the target memory of the first priority and the target memory of the second priority are insufficient to satisfy the additional memory space required for processing the subtask on the graphics processor. However, in order to ensure that the subtask can be processed, the data processing method further includes:

[0131] When it is detected that the additional memory space required for processing the subtasks on each graphics processor is greater than the available target memory space of the first priority target memory and greater than the available target memory space of the second priority target memory, it is determined that the target memory to be occupied by each graphics processor is the first priority target memory, the second priority target memory and the third priority target memory; wherein the third priority target memory is other memory, and the other memory includes at least hard disk memory.

[0132] Taking the first priority target memory as system memory, the second priority target memory as computing fast link memory, and the third priority target memory as other memory as an example, the process of determining the target memory to be occupied by each graphics processor is described.

[0133] If it is detected that the additional memory space required for processing the subtask on each graphics processor is less than or equal to the available target memory space corresponding to the system memory, determining that the target memory to be occupied by each graphics processor is the system memory;

[0134] When it is detected that the additional memory space required for processing the subtask on each graphics processor is greater than the available target memory space of the corresponding system memory and less than or equal to the available target memory space of the computing fast link memory, determining that the target memory to be occupied by each graphics processor is the system memory and the computing fast link memory;

[0135] When it is detected that the additional memory space required for processing the subtask on each graphics processor is greater than the available target memory space of the system memory and greater than the available target memory space of the computing quick link memory, it is determined that the target memory to be occupied by each graphics processor is the system memory, the computing quick link memory and other memory.

[0136] In the embodiment of the present invention, in order to reasonably allocate memory, in implementation, the target memory to be occupied by each graphics processor is determined according to the relationship between the additional memory space required for processing subtasks on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task, including:

[0137] Determine the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing the subtask on the current graphics processor and the available target memory space of the current graphics processor, so that the current graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task;

[0138] Get the next graphics processor of the current graphics processor, and use the next graphics processor of the current graphics processor as the new current graphics processor, return to the step of determining the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing subtasks on the current graphics processor and the available target memory space of the current graphics processor, and stop returning until the target memory to be occupied by all graphics processors is determined.

[0139] Determine the available target memory space of the current graphics processor including:

[0140] Obtaining the number of remaining graphics processors and the remaining space capacity of target memory of each priority level; wherein the number of remaining graphics processors is the difference between the number of all graphics processors in the system and the number of graphics processors that have been determined to occupy the target memory; the remaining space capacity of the target memory of each priority level is the difference between the total space capacity of the target memory of each priority level and the space capacity occupied on the target memory of each priority level; wherein the target memory of each priority level includes at least a target memory of the first priority level and a target memory of the second priority level;

[0141] The available target memory space of the current graphics processor on the target memory of each priority level is determined according to the ratio of the remaining space capacity of the target memory of each priority level to the number of remaining graphics processors.

[0142] Specifically, determining the available target memory space of the current graphics processor on the target memory of each priority level according to the ratio of the remaining space capacity of the target memory of each priority level to the number of remaining graphics processors includes:

[0143] When it is detected that there is no graphics processor occupying the target memory of the first priority, obtaining a first ratio result between the space capacity of the target memory of each priority and the number of all graphics processors, and using each first ratio result as the available target memory space of the current graphics processor on the target memory of the corresponding priority;

[0144] In the case where it is detected that there is a graphics processor that has occupied the target memory of the first priority and there is no graphics processor that has occupied the target memory of the second priority, a second ratio result between the remaining space capacity of the target memory of the first priority and the number of remaining graphics processors is obtained, and the second ratio result is used as the available target memory space of the current graphics processor on the target memory of the first priority; a third ratio result between the space capacity of the target memory of the second priority and the number of remaining graphics processors is obtained, and the third ratio result is used as the available target memory space of the current graphics processor on the target memory of the second priority;

[0145] When it is detected that there is a graphics processor that has occupied the target memory of the first priority and there is a graphics processor that has occupied the target memory of the second priority, a fourth ratio result between the remaining space capacity of the target memory of the first priority and the number of remaining graphics processors is obtained, and the fourth ratio result is used as the available target memory space of the current graphics processor on the target memory of the first priority; and a fifth ratio result between the remaining space capacity of the target memory of the second priority and the number of remaining graphics processors is obtained, and the fifth ratio result is used as the available target memory space of the current graphics processor on the target memory of the second priority.

[0146] In this method, when determining the target memory to be occupied by each graphics processor, the space occupied by other graphics processors on the target memory is fully considered, and the remaining space capacity is evenly distributed to each graphics processor whose target memory has not been determined to be occupied, thereby ensuring balanced memory allocation as much as possible.

[0147] It should be noted that, in order to improve the efficiency of determining the target memory to be occupied by each graphics processor, after the target memory to be occupied by the graphics processor is determined, the unique number of the graphics processor that determines the target memory to be occupied and the situation of the target memory occupied by the graphics processor are obtained and recorded; wherein the situation of the occupied target memory at least includes the type of occupied target memory (including system memory, computing quick link memory and other memory) and the space position and size occupied on the target memory; the number of remaining graphics processors and the remaining space capacity of the target memory are determined in combination with the recorded unique number of the processor and the situation of the target memory occupied by the graphics processor.

[0148] By recording the unique number of the graphics processor that determines the target memory to be occupied and the target memory occupied by the graphics processor, the memory allocation situation can be quickly understood based on the recorded information and the efficiency of subsequently determining the target memory to be occupied by other graphics processors can be improved.

[0149] In order to enable those skilled in the art to better understand the process of allocating tasks (such as AI workloads) under the multi-graphics processors provided by the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0150] After all tasks are divided and deployed, the additional memory required by the workload on each GPU will be obtained. This additional memory needs to occupy system memory or other memory. Traditional memory allocation usually allocates memory in system memory, calculates fast link memory, and occupies other memory applications (such as Figure 1 As shown in the figure, this memory allocation scheme has obvious disadvantages, and often a task will drastically occupy the bandwidth of a certain memory. The embodiment of the present invention proposes a dynamic perception hybrid memory allocation strategy, which can balance the application occupation of hybrid memory by tasks on each graphics processor. Figure 4 A flowchart of a dynamic perception hybrid memory allocation method provided by an embodiment of the present invention, such as Figure 4 As shown, the method includes:

[0151] S14: obtaining the additional memory of the current graphics processor and the maximum available system memory of the current graphics processor;

[0152] S15: Determine whether the additional memory of the current graphics processor is greater than the maximum available system memory of the current graphics processor; if so, proceed to step S16; if not, proceed to step S19;

[0153] S16: Obtain required computing fast link memory;

[0154] S17: Allocate additional computing fast link memory according to the relationship between the required additional computing fast link memory and the maximum computing fast link memory available for the current graphics processor;

[0155] S18: updating the maximum memory available to the graphics processor according to the first method, obtaining a new current graphics processor, and returning to step S14;

[0156] S19: Determine that the required calculation fast link memory is 0;

[0157] S20: Update the maximum memory available to the graphics processor according to the second method, obtain a new current graphics processor, and return to step S14.

[0158] Specifically, the dynamic-aware hybrid memory allocation method includes the following steps:

[0159] 1) The hybrid memory allocation module calculates the additional memory totel_mem_gpu required by each task on the GPU, which is the sum of the memory required by all tasks on the GPU Subtract the memory of the graphics processing unit itself 。

[0160] ;

[0161] 2) Evenly distribute the available system memory (D_totel_mem) to each GPU (where gpus represents the number of graphics processing units), that is, the maximum available system memory (D_mem) for each GPU;

[0162] ;

[0163] 3) Evenly distribute the available CXL memory (C_totel_mem) to each GPU, that is, the maximum available CXL memory (C_mem) for each GPU;

[0164] ;

[0165] 4) Traverse the GPUs to allocate additional memory and dynamically update the available memory.

[0166] For the current GPU,

[0167] If totel_mem_gpu < D_mem, that is, all additional memory can be applied for on the system memory, update the available memory (including system memory and Compute Express Link memory, etc.) according to the second method. The second method is as follows:

[0168] D_mem = (D_totel_mem - totel_mem_gpu) / (gpus - 1);

[0169] C_mem = C_totel_mem / (gpus - 1);

[0170] If totel_mem_gpu > D_mem, the system memory needs to occupy the maximum memory D_mem, and the additional required CXL memory is:

[0171] cxl_mem = totel_mem_gpu - D_mem;

[0172] Apply for memory of size cxl_mem on the CXL memory. Then update the available memory according to the first method. The first method is as follows:

[0173] D_mem = (D_totel_mem - D_mem) / (gpus - 1);

[0174] C_mem = (C_totel_mem - cxl_mem) / (gpus - 1);

[0175] Go to the next GPU's additional memory request and repeat the above process.

[0176] As mentioned above Figure 3 As shown in the figure, a dynamic layout is given for a certain case, where the number of workloads is 4 and the number of GPUs is 4, and each workload is deployed on each GPU according to the load distribution strategy. Among them, the additional memory size required by Task 0, Task 2, and Task 3 exceeds the size of the system available memory and needs to occupy additional CXL memory, while the additional memory size required by Task 1 does not exceed the available system memory size and only needs to occupy the system memory.

[0177] The following is a summary of the present invention. Figure 5 A schematic diagram of a multi-GPU system supporting main memory and CXL memory provided by an embodiment of the present invention. Figure 5 As shown in the figure, multiple workloads are divided and deployed and memory is allocated under this hybrid memory architecture. First, all tasks are reasonably allocated to all GPUs. Then, according to different workloads and the different GPUs assigned, a special dynamic hybrid memory layout strategy is customized. This strategy can efficiently utilize all the memory in the system and ensure efficient communication between the GPU memory and the hybrid memory. Specifically:

[0178] 1) Task allocation under multiple graphics processors;

[0179] Since there are many different tasks in a multi-GPU system, and each task uses a different amount of memory, traditional memory usage solutions will lead to memory contention and bandwidth contention. How to determine which task uses which memory and how much memory to use, and how to use various memories and bandwidths more efficiently is an urgent problem to be solved. To solve this problem, an embodiment of the present invention proposes a new task division strategy, which first divides the tasks and deploys them on different GPU devices;

[0180] 2) Dynamically aware hybrid memory layout strategy;

[0181] After the tasks are divided and deployed, the present invention proposes a layout strategy for hybrid memory with dynamic perception, which automatically allocates the occupancy of different types of memory by calculating the additional memory size required by different tasks on different graphics processors. Different tasks occupy different memory according to their own characteristics. During the layout process, the optimal memory layout is achieved by dynamically adjusting the size of the available system memory, thereby achieving efficient utilization of memory and bandwidth.

[0182] The hybrid memory layout strategy for accelerating tasks provided by the present invention can effectively improve the efficiency of hybrid memory use, maximize the communication efficiency of different bandwidths, and improve the performance of tasks. At the same time, this implementation method can make full use of the resources of each underlying hardware (i.e., hybrid memory), successfully solve the problem of low communication efficiency of data-intensive tasks, and support data-intensive workloads and even huge memory requirements in ultra-large model training by deploying a variety of memory resources on the server platform. After testing, it was found that compared with the default memory allocation method, the method provided by the present invention can reduce data transmission overhead by up to 65%.

[0183] In the above embodiments, the data processing method is described in detail, and the present invention also provides embodiments corresponding to the data processing device and the server. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.

[0184] An embodiment of the present invention provides a data processing device. This embodiment is based on the perspective of functional modules and includes:

[0185] A first deployment module is used to obtain a task and deploy each subtask divided from the task on a graphics processor respectively; wherein the subtask corresponds to the graphics processor one by one;

[0186] A first acquisition module is used to acquire the additional memory space required for processing the subtasks on each graphics processor; wherein the additional memory space is the difference between the sum of the memory spaces required for processing the subtasks on the graphics processor and the memory space of the graphics processor, and the target memory to which the additional memory space belongs includes at least the system memory and the computing fast link memory;

[0187] A first partitioning module is used to partition the target memory space to each graphics processor to obtain an available target memory space of each graphics processor;

[0188] The first determination module is used to determine the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task.

[0189] In some embodiments, there are multiple tasks, and the first deployment module includes:

[0190] A second acquisition module is used to acquire the number of graphics processors in the system;

[0191] A second division module is used to divide each task into a preset number of subtasks; wherein the preset number is the same as the number of graphics processors in the system;

[0192] The second deployment module is used to deploy each subtask divided from each task on a corresponding graphics processor;

[0193] The first acquisition module is specifically used to acquire the additional memory space required by each graphics processor to process the target subtask; wherein the target subtask is the sum of the subtasks corresponding to all tasks deployed on each graphics processor.

[0194] In some embodiments, the second deployment module includes:

[0195] The third acquisition module is used to obtain the memory space required by each task;

[0196] A first sorting module is used to sort all tasks in the order of the size of the memory space required by each task;

[0197] The third deployment module is used to deploy a subtask of each task on the same graphics processor according to the order of the tasks.

[0198] In some embodiments, the third deployment module includes:

[0199] A second sorting module is used to set a unique number for each graphics processor and sort the graphics processors in the order of the unique numbers corresponding to the graphics processors to obtain the order of the graphics processors;

[0200] The third sorting module is used to set unique numbers for the subtasks in each task and sort the subtasks in each task according to the unique numbers of the subtasks to obtain the order of the subtasks in each task;

[0201] The fourth acquisition module is used to obtain the number of all tasks;

[0202] A second determination module is used to determine the deployment order of subtasks in each task when they are deployed on the graphics processors according to the relationship between the number of tasks and the number of graphics processors in the system; wherein the deployment order includes forward deployment according to the order of the graphics processors and reverse deployment according to the order of the graphics processors; when forward deployment or reverse deployment of subtasks in each task, the starting subtasks in each task are deployed on different graphics processors;

[0203] The fourth deployment module is used to deploy the subtasks in each task on the corresponding GPU according to the order of the tasks and in combination with the order and deployment order of the subtasks in each task, so as to deploy a subtask in each task on the same GPU.

[0204] In some embodiments, the second determining module specifically includes:

[0205] A first determining submodule is used to determine that the deployment order of subtasks in each task when being deployed on the graphics processor is a forward deployment order when it is detected that the number of tasks is less than or equal to the number of graphics processors in the system;

[0206] The second determining submodule is used to determine that the deployment order of subtasks in each task when deployed on the graphics processor is a reverse deployment order when it is detected that the number of tasks is greater than the number of graphics processors in the system.

[0207] In some embodiments, the first determining module specifically includes:

[0208] A fifth acquisition module, used to acquire the priority order of each target memory;

[0209] A third determination submodule is used to determine that the target memory to be occupied by each graphics processor is the target memory of the first priority when it is detected that the additional memory space required for processing the subtask on each graphics processor is less than or equal to the available target memory space corresponding to the target memory of the first priority;

[0210] The fourth determination submodule is used to determine that the target memory to be occupied by each graphics processor is the target memory of the first priority and the target memory of the second priority when it is detected that the additional memory space required for processing the subtask on each graphics processor is greater than the available target memory space of the corresponding first priority target memory, and is less than or equal to the available target memory space of the second priority target memory.

[0211] In some embodiments, the data processing apparatus further comprises:

[0212] The fifth determination submodule is used to determine that the target memory to be occupied by each graphics processor is the target memory of the first priority, the target memory of the second priority, and the target memory of the third priority when it is detected that the additional memory space required for processing the subtask on each graphics processor is greater than the available target memory space of the target memory of the first priority and greater than the available target memory space of the target memory of the second priority; wherein the target memory of the third priority is other memory, and the other memory includes at least the hard disk memory.

[0213] In some embodiments, the first determining module specifically includes:

[0214] a sixth determination submodule, configured to determine the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing the subtask on the current graphics processor and the available target memory space of the current graphics processor, so that the current graphics processor occupies the available target memory space on the determined target memory to be occupied to process the task;

[0215] The sixth acquisition module is used to acquire the next GPU of the current GPU and use the next GPU of the current GPU as the new current GPU, return to trigger the sixth determination submodule, and stop returning until the target memory to be occupied by all GPUs is determined.

[0216] In some embodiments, the data processing device includes a third determination module, which is used to determine the available target memory space of the current graphics processor;

[0217] The third determination module specifically includes:

[0218] The seventh acquisition module is used to acquire the number of remaining graphics processors and the remaining space capacity of the target memory of each priority level; wherein the number of remaining graphics processors is the difference between the number of all graphics processors in the system and the number of graphics processors that have been determined to occupy the target memory; the remaining space capacity of the target memory of each priority level is the difference between the total space capacity of the target memory of each priority level and the space capacity occupied on the target memory of each priority level; wherein the target memory of each priority level includes at least the target memory of the first priority level and the target memory of the second priority level;

[0219] The seventh determination submodule is used to determine the available target memory space of the current graphics processor on the target memory of each priority level according to the ratio of the remaining space capacity of the target memory of each priority level to the number of remaining graphics processors.

[0220] In some embodiments, the seventh determining submodule specifically includes:

[0221] The first module is used to obtain a first ratio result between the space capacity of the target memory of each priority level and the number of all the graphics processors when it is detected that there is no graphics processor occupying the target memory of the first priority level, and use each first ratio result as the available target memory space of the current graphics processor on the target memory of the corresponding priority level;

[0222] The second module is used to obtain a second ratio result between the remaining space capacity of the target memory of the first priority and the number of remaining graphics processors when it is detected that there is a graphics processor that has occupied the target memory of the first priority and there is no graphics processor that has occupied the target memory of the second priority, and use the second ratio result as the available target memory space of the current graphics processor on the target memory of the first priority; obtain a third ratio result between the space capacity of the target memory of the second priority and the number of remaining graphics processors, and use the third ratio result as the available target memory space of the current graphics processor on the target memory of the second priority;

[0223] The third module is used to obtain a fourth ratio result between the remaining space capacity of the first-priority target memory and the number of remaining graphics processors when it is detected that there is a graphics processor that has occupied the first-priority target memory and there is a graphics processor that has occupied the second-priority target memory, and use the fourth ratio result as the available target memory space of the current graphics processor on the first-priority target memory; and obtain a fifth ratio result between the remaining space capacity of the second-priority target memory and the number of remaining graphics processors, and use the fifth ratio result as the available target memory space of the current graphics processor on the second-priority target memory.

[0224] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, and they will not be repeated here. The effects are the same as above.

[0225] Figure 6 This is a structural diagram of a server provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 6 As shown, the server includes:

[0226] A memory 50, for storing computer programs;

[0227] The processor 51 is used to implement the steps of the data processing method mentioned in the above embodiment when executing the computer program.

[0228] Among them, the processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 51 can be implemented in at least one hardware form of a digital signal processor (DSP), an FPGA, and a programmable logic array (PLA). The processor 51 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 51 may be integrated with a GPU for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 51 may also include an AI processor, which is used to process computing operations related to machine learning.

[0229] The memory 50 may include one or more computer-readable storage media, which may be non-transitory. The memory 50 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 50 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 51, it can implement the relevant steps of the data processing method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 50 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the above-mentioned data processing method, etc.

[0230] In some embodiments, the server may further include a display screen 52 , an input / output interface 53 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0231] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure.

[0232] The server provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: a data processing method, the effect is the same as above.

[0233] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above data processing method when executed by a processor.

[0234] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0235] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0236] The computer-readable storage medium provided by the present invention includes the above-mentioned data processing method, and the effect is the same as above.

[0237] The above is a detailed introduction to a data processing method, product, server and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

[0238] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A data processing method, It is characterized in that include: Acquire a task and deploy each subtask divided from the task on a graphics processor, wherein the subtask corresponds to the graphics processor one by one; Acquire additional memory space required for processing subtasks on each of the graphics processors; wherein the additional memory space is the difference obtained by subtracting the memory space of the graphics processor from the sum of the memory space required for processing subtasks on the graphics processor, and the target memory to which the additional memory space belongs includes at least system memory and computing fast link memory; Dividing the target memory space into each of the graphics processors to obtain available target memory space of each of the graphics processors; Determine the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the determined available target memory to be occupied to process the task; Determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space comprises: Obtaining the priority order of each of the target memories; When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is less than or equal to the available target memory space corresponding to the target memory of the first priority, determining that the target memory to be occupied by each of the graphics processors is the target memory of the first priority; When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is greater than the available target memory space of the corresponding first-priority target memory, and is less than or equal to the available target memory space of the second-priority target memory, it is determined that the target memory to be occupied by each of the graphics processors is the first-priority target memory and the second-priority target memory.

2. The data processing method according to claim 1, It is characterized in that There are multiple tasks, and the step of dividing the tasks into subtasks and deploying them on the graphics processor includes: Obtain the number of graphics processors in the system; Divide each of the tasks into a preset number of subtasks; wherein the preset number is the same as the number of graphics processors in the system; Deploy the subtasks divided from the tasks on corresponding graphics processors respectively; The acquiring of the additional memory space required for processing the subtasks on each of the graphics processors comprises: The additional memory space required for processing the target subtask on each of the graphics processors is obtained; wherein the target subtask is the sum of the subtasks corresponding to all the tasks deployed on each of the graphics processors.

3. The data processing method according to claim 2, It is characterized in that The step of respectively deploying the subtasks divided from the tasks on the corresponding graphics processors includes: Obtaining the memory space required for each of the tasks; Sorting all the tasks in order of the size of the memory space required by each task; A subtask in each of the tasks is deployed on the same graphics processor according to the order of the tasks.

4. The data processing method according to claim 3, It is characterized in that The step of deploying a subtask in each of the tasks on the same graphics processor according to the order of the tasks comprises: Setting a unique number for each of the graphics processors and sorting the graphics processors in the order of the unique numbers corresponding to the graphics processors to obtain the order of the graphics processors; Unique numbers are set for the subtasks in each of the tasks respectively and the subtasks are sorted in each of the tasks according to the unique numbers of the subtasks to obtain the order of the subtasks in each of the tasks; Get the number of all said tasks; Determining the deployment order of the subtasks in each of the tasks when they are deployed on the graphics processors according to the relationship between the number of the tasks and the number of the graphics processors in the system; wherein the deployment order includes forward deployment according to the order of the graphics processors and reverse deployment according to the order of the graphics processors; when the subtasks in each of the tasks are forward deployed or reverse deployed, the starting subtasks in each of the tasks are deployed on different graphics processors; The subtasks in each of the tasks are deployed on the corresponding graphics processor according to the order of the tasks and in combination with the order of the subtasks in each of the tasks and the deployment order, so that a subtask in each of the tasks is deployed on the same graphics processor.

5. The data processing method according to claim 4, It is characterized in that The step of determining the deployment order of the subtasks in each task when being deployed on the graphics processor according to the relationship between the number of the tasks and the number of the graphics processors in the system comprises: When it is detected that the number of the tasks is less than or equal to the number of the graphics processors in the system, determining that the deployment order of the subtasks in each of the tasks when being deployed on the graphics processor is a forward deployment order; When it is detected that the number of the tasks is greater than the number of the graphics processors in the system, the deployment order of the subtasks in each of the tasks when being deployed on the graphics processor is determined to be a reverse deployment order.

6. The data processing method according to claim 1, It is characterized in that The method further comprises: When it is detected that the additional memory space required for processing the subtask on each of the graphics processors is greater than the available target memory space of the target memory of the first priority and greater than the available target memory space of the target memory of the second priority, it is determined that the target memory to be occupied by each of the graphics processors is the target memory of the first priority, the target memory of the second priority and the target memory of the third priority; wherein the target memory of the third priority is other memory, and the other memory includes at least hard disk memory.

7. The data processing method according to claim 6, It is characterized in that The target memory of the first priority is the system memory, the target memory of the second priority is the computing quick link memory, and the target memory of the third priority is other memory.

8. The data processing method according to claim 1, It is characterized in that The step of determining the target memory to be occupied by each graphics processor according to the relationship between the additional memory space required for processing the subtask on each graphics processor and the corresponding available target memory space, so that each graphics processor occupies the determined available target memory to be occupied to process the task, comprises: Determine the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing the subtask on the current graphics processor and the available target memory space of the current graphics processor, so that the current graphics processor occupies the determined available target memory space on the target memory to be occupied to process the task; Obtain the next graphics processor of the current graphics processor, and use the next graphics processor of the current graphics processor as the new current graphics processor, return to the step of determining the target memory to be occupied by the current graphics processor according to the relationship between the additional memory space required for processing subtasks on the current graphics processor and the available target memory space of the current graphics processor, and stop returning until the target memory to be occupied by all the graphics processors is determined.

9. The data processing method according to claim 8, It is characterized in that Determining the available target memory space of the current graphics processor includes: Obtaining the number of remaining graphics processors and the remaining space capacity of target memory of each priority level; wherein the number of remaining graphics processors is the difference between the number of all graphics processors in the system and the number of graphics processors that have been determined to occupy target memory; the remaining space capacity of target memory of each priority level is the difference between the total space capacity of target memory of each priority level and the occupied space capacity of target memory of each priority level; wherein the target memory of each priority level includes at least a target memory of a first priority level and a target memory of a second priority level; The available target memory space of the current graphics processor on the target memory of each priority level is determined according to the ratio of the remaining space capacity of the target memory of each priority level to the number of the remaining graphics processors.

10. The data processing method according to claim 9, It is characterized in that The step of determining the available target memory space of the current graphics processor on the target memory of each priority level according to the ratio of the remaining space capacity of the target memory of each priority level to the number of the remaining graphics processors comprises: When it is detected that there is no graphics processor occupying the target memory of the first priority, obtaining a first ratio result between the space capacity of the target memory of each priority and the number of all the graphics processors, and using each of the first ratio results as the available target memory space of the current graphics processor on the target memory of the corresponding priority; In the case where it is detected that there is the graphics processor that has occupied the target memory of the first priority and there is no graphics processor that has occupied the target memory of the second priority, obtaining a second ratio result between the remaining space capacity of the target memory of the first priority and the number of the remaining graphics processors, and using the second ratio result as the available target memory space of the current graphics processor on the target memory of the first priority; obtaining a third ratio result between the space capacity of the target memory of the second priority and the number of the remaining graphics processors, and using the third ratio result as the available target memory space of the current graphics processor on the target memory of the second priority; When it is detected that there is the graphics processor that has occupied the target memory of the first priority and there is the graphics processor that has occupied the target memory of the second priority, a fourth ratio result between the remaining space capacity of the target memory of the first priority and the remaining number of the graphics processors is obtained, and the fourth ratio result is used as the available target memory space of the current graphics processor on the target memory of the first priority; and a fifth ratio result between the remaining space capacity of the target memory of the second priority and the remaining number of the graphics processors is obtained, and the fifth ratio result is used as the available target memory space of the current graphics processor on the target memory of the second priority.

11. The data processing method according to claim 4, It is characterized in that Each of the graphics processors occupies the determined available target memory space on the target memory to be occupied to process the task, including: Each of the graphics processors occupies the determined available target memory space on the target memory to be occupied to process the starting subtask of each of the tasks, and receives the result of processing the starting subtask of each of the tasks in the available target memory space, so as to process each subtask according to the result of processing the starting subtask and in the order of the subtasks in each of the tasks.

12. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the data processing method according to any one of claims 1 to 11 are implemented.

13. A server, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 11 are implemented.