A memory allocation method, apparatus, electronic device, storage medium, and product.

CN121387768BActive Publication Date: 2026-09-01LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511959429.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-09-01
Estimated Expiration
2045-12-24

AI Technical Summary

Technical Problem

[0004]本申请提供了一种内存分配方法、装置、电子设备、计算机可读存储介质及计算机程序产品,以至少解决相关技术中带宽争用严重、数据传输时延高、传输效率低的问题

Benefits of technology

本申请中提供的一种内存分配方法,在对待分配作业集合中的每个待分配作业进行内存分配的过程中,通过确定每个待分配作业的作业参数信息以及异构计算系统的当前系统剩余内存容量、当前剩余带宽及各个计算单元的当前占用状态信息这些当前系统状态数据,然后进一步根据每个待分配作业的作业参数信息以及以后计算系统得当前系统状态数据,结合预设目标函数确定出满足预设约束条件的与每个待分配作业分别对应的目标计算单元和目标内存。由于本申请中预设目标函数是以最小化总数据传输时间为目标的函数,并且结合异构计算系统的当前系统剩余内存容量、当前剩余带宽及各个计算单元的当前占用状态信息为每个待分配作业进行计算单元分配和内存分配,以满足预设约束条件,因此在作业执行过程中可以减少带宽争用,降低数据传输时延,提高数据传输效率,降低数据传输时间,确保数据传输作业能够高效及时地完成。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387768B_ABST
    Figure CN121387768B_ABST
Patent Text Reader

Abstract

This application discloses a memory allocation method, apparatus, electronic device, storage medium, and product, applied in the field of computer storage technology. To address the problems of severe bandwidth contention and high data transmission latency in related technologies, the method determines the job parameter information corresponding to each job in the current set of jobs to be allocated; determines the current system status data of the heterogeneous computing system, including the current remaining memory capacity, current remaining bandwidth, and the current occupancy status information of each computing unit; and determines the target computing unit and target memory allocated to each job to be allocated based on the job parameter information of each job to be allocated and the current system status data, combined with preset constraints and a preset objective function aimed at minimizing the total data transmission time. This reduces bandwidth contention, lowers data transmission latency, improves data transmission efficiency, and ensures that jobs can be completed efficiently and in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer storage technology, and in particular to a memory allocation method, apparatus, electronic device, storage medium and product. Background Technology

[0002] CXL (Compute Express Link) based memory expansion systems enable seamless connection between host and device memory via the CXL interface, enhancing system memory capacity scalability and increasing bandwidth. In multi-GPU (Graphics Processing Unit) systems, CXL memory also provides larger memory capacity, faster data transfer speeds, and lower transfer overhead.

[0003] However, in multi-GPU systems within a distributed computing environment, the CXL memory-extended architecture still faces several performance bottlenecks. Firstly, the GPU's built-in HBM (High Bandwidth Memory) has limited capacity and requires frequent read / write operations with main memory, increasing data processing latency, reducing computational efficiency, and consuming PCIe (Peripheral Component Interconnect express) bus bandwidth. Secondly, when multiple GPUs simultaneously access or modify CXL memory in the same slot, severe bandwidth contention arises. The limited PCIe interconnect bandwidth is divided among multiple GPUs, reducing the available bandwidth for a single GPU, increasing data transfer request queuing latency, and potentially causing significant delays or even job execution failures. Therefore, how to allocate memory to reduce bandwidth contention and ensure efficient and timely completion of data transfer jobs has become a problem that those skilled in the art need to solve. Summary of the Invention

[0004] This application provides a memory allocation method, apparatus, electronic device, computer-readable storage medium, and computer program product to at least solve the problems of severe bandwidth contention, high data transmission latency, and low transmission efficiency in the related art.

[0005] This application provides a memory allocation method, including: Determine the job parameter information for each job to be assigned in the current set of jobs to be assigned; Determine the current system status data of the heterogeneous computing system. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit. Based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions, the target computing unit and target memory to be assigned to each job to be assigned are determined; the preset objective function aims to minimize the total data transfer time.

[0006] This application also provides a memory allocation device, including: The first determining module is used to determine the job parameter information corresponding to each job to be assigned in the current set of jobs to be assigned. The second determining module is used to determine the current system status data of the heterogeneous computing system. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit. The allocation module is used to determine the target computing unit and target memory to be allocated to each job based on the job parameter information of each job to be allocated and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions; the preset objective function aims to minimize the total data transfer time.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above memory allocation methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described memory allocation methods.

[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described memory allocation methods.

[0010] As can be seen from the above technical solution, the beneficial effects of this application are as follows: This application provides a memory allocation method. During the memory allocation process for each job in a set of jobs to be allocated, the method determines the job parameter information of each job, as well as the current system state data of the heterogeneous computing system, including the current remaining memory capacity, current remaining bandwidth, and current occupancy status of each computing unit. Then, based on the job parameter information of each job and the current system state data, and combined with a preset objective function, it determines the target computing units and target memory corresponding to each job that satisfy preset constraints. Since the preset objective function in this application aims to minimize the total data transfer time, and by combining the current remaining memory capacity, current remaining bandwidth, and current occupancy status of each computing unit in the heterogeneous computing system to allocate computing units and memory for each job to meet the preset constraints, bandwidth contention can be reduced, data transfer latency can be lowered, data transfer efficiency can be improved, data transfer time can be reduced, and data transfer jobs can be completed efficiently and promptly during job execution.

[0011] Furthermore, this application also provides corresponding implementation devices, electronic devices, computer-readable storage media, and computer programs for the memory allocation method, further making the method more practical. The devices, electronic devices, computer-readable storage media, and computer programs have corresponding advantages. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a diagram of a multi-GPU architecture based on CXL memory extension in related technologies. Figure 2 A flowchart illustrating a memory allocation method provided in an embodiment of this application; Figure 3 A flowchart for determining the target graphics processor and target memory to be allocated to each job to be assigned, provided in an embodiment of this application; Figure 4 A flowchart illustrating another memory allocation method provided in this application embodiment; Figure 5 This is a structural diagram of a memory allocation device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] It should be noted that CXL is a high-speed interconnect standard based on the PCIe physical layer, designed to address memory expansion and resource sharing issues in data centers and high-performance computing (HPC) scenarios through cache coherency and low-latency communication. The CXL protocol significantly improves communication efficiency between the CPU (Central Processing Unit), accelerators, and memory by unifying the memory address space, while maintaining low latency and high bandwidth. CXL technology provides an effective solution to problems such as memory stranding and uneven resource allocation in traditional memory systems.

[0017] CXL-based memory expansion systems can achieve seamless connection between host and device memory through the CXL interface, improving the scalability and bandwidth of system memory capacity. They can also adapt to scenarios such as ultra-large-scale AI (Artificial Intelligence) model training, and can integrate heterogeneous storage media such as DDR (Double Data Rate SDRAM), HBM, and MRAM (Magneto-resistive Random Access Memory) to further optimize the performance and cost of the memory system.

[0018] In multi-GPU systems based on CXL memory extensions, while CXL memory offers larger memory capacity, faster data transfer speeds, and lower data transfer overhead, in distributed computing environments, when multiple GPUs simultaneously access or modify CXL memory in the same slot, memory and bandwidth contention occurs, impacting job performance. For example...Figure 1 The diagram shown illustrates a multi-GPU architecture based on compute-fast linked CXL memory extensions, including multiple GPUs (e.g., Figure 1 In the CXL memory (G0 to GN, GN+1 to G2N), for example, job 1 is assigned to G0-G1-G2, and job 2 is assigned to G3-G4. G0-G1-G2 is allocated 80% of the total DRAM (Dynamic Random Access Memory). The remaining DRAM memory is insufficient for G3-G4, therefore, the additional memory required by G3-G4 needs to be allocated from CXL memory. During the execution of job 2, because multiple GPUs (G3-G4) simultaneously access CXL memory through a single PCIe channel, the actual available bandwidth for each GPU is reduced, resulting in a decrease in the speed at which GPUs read or write data, thus affecting the data transfer rate of the job. Here, a job refers to a specific computational task or program.

[0019] On the one hand, the HBM memory integrated into the GPU has a relatively small capacity and requires frequent data read and write operations with main memory. This increases data processing time, reduces computational efficiency, and consumes PCIe bus bandwidth, causing other operations to wait for data transfer to complete. On the other hand, when multiple GPUs simultaneously perform read and write operations on the CXL memory of a single slot, the limited PCIe interconnect bandwidth is divided and allocated, reducing the actual available bandwidth for each GPU. Data transfer requests are queued, causing latency, affecting data transfer efficiency and overall job performance, and in severe cases, may lead to a significant increase in job execution time or even failure.

[0020] To optimize the performance of multi-GPU systems based on CXL memory extension, effective memory management and scheduling strategies are needed to reduce bandwidth contention and ensure efficient and timely data transmission. Relevant strategies include adjusting job scheduling, optimizing memory allocation, or adopting more advanced interconnect technologies.

[0021] Currently, research on memory management and scheduling strategies for this scenario mainly focuses on two directions: one is to develop efficient memory management technologies to fully utilize CXL's memory expansion capabilities, reduce access latency, and improve resource utilization; the other is to focus on dynamic memory management and scheduling optimization, dynamically adjusting allocation by monitoring memory usage in real time, reducing bandwidth contention, and providing support for high-performance computing and AI training.

[0022] In heterogeneous memory allocation strategies in related technologies, data can be dynamically allocated to DRAM or CXL memory based on data access patterns and performance requirements. When there are multiple CXL memory modules, there will be unallocated CXL memory modules, resulting in the CXL memory not being fully utilized. Furthermore, since DRAM and CXL memory are clearly distinguished as two independent memory layers, data is explicitly stored in different memory layers according to data type and access patterns, leading to complex memory management.

[0023] Another approach in related technologies is to build a test platform based on a real CXL device and combine it with a dynamic memory management strategy to monitor memory usage in real time and dynamically adjust the allocation. However, this approach increases the complexity of system design and has additional requirements for software and hardware support.

[0024] In view of the above problems, this application proposes a memory allocation method that can accurately determine the optimal allocation between main memory and extended memory, minimizing data transfer time and thus reducing job execution latency. To enable those skilled in the art to better understand the solution of this application, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments. Please refer to... Figure 2 The flowchart shown illustrates a memory allocation method, which includes the following steps S110 to S130.

[0025] S110: Determine the job parameter information corresponding to each job in the current set of jobs to be assigned.

[0026] It should be noted that, in this embodiment of the application, a current set of jobs to be assigned can be obtained, each job to be assigned in the current set of jobs to be assigned can be determined, and job parameter information corresponding to each job to be assigned can be obtained. The current set of jobs to be assigned includes at least one job to be assigned.

[0027] S120: Determine the current system status data of the heterogeneous computing system. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit.

[0028] It is understood that, since the heterogeneous computing system may be executing other already allocated jobs while the memory allocation process is being performed on each job in the current set of jobs to be allocated, the embodiments of this application can determine the current system status data of the heterogeneous computing system, including determining the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit in the heterogeneous computing system. The current occupancy status information can be allocated jobs or unallocated jobs, and the computing unit can be a graphics processing unit (GPU).

[0029] S130: Based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions, determine the target computing unit and target memory to be assigned to each job to be assigned; the preset objective function aims to minimize the total data transfer time.

[0030] It should be noted that, in order to minimize the total data transfer time when allocating memory and GPU for each job to be assigned in this embodiment, an objective function aimed at minimizing the total data transfer time can be pre-set, and various preset constraints can be determined. After obtaining the job parameter information corresponding to each job to be assigned in the current set of jobs to be assigned and the current system status data of the heterogeneous computing system, target computing units and target memory can be allocated to each job to be assigned based on the job parameter information corresponding to each job to be assigned and the current system remaining memory capacity, current remaining bandwidth, and current occupancy status information of each computing unit in the current system status data of the heterogeneous computing system. The target computing units and target memory allocated to each job to be assigned should satisfy the preset constraints and the preset objective function, thereby minimizing the total data transfer time of each job to be assigned while meeting the memory requirements of the jobs to be assigned, maximizing the data transfer rate, reducing bandwidth contention, reducing data transfer latency, improving data transfer efficiency, reducing data transfer time, and ensuring that data transfer jobs can be completed efficiently and in a timely manner.

[0031] Therefore, in the memory allocation process for each job in the set of jobs to be allocated, this application determines the job parameter information of each job, as well as the current system state data such as the current remaining memory capacity, current remaining bandwidth, and current occupancy status of each computing unit in the heterogeneous computing system. Then, based on the job parameter information of each job and the current system state data, combined with a preset objective function, the target computing units and target memory corresponding to each job that meet the preset constraints are determined. Since the preset objective function in this application aims to minimize the total data transmission time, and by combining the current remaining memory capacity, current remaining bandwidth, and current occupancy status of each computing unit in the heterogeneous computing system to allocate computing units and memory for each job to meet the preset constraints, bandwidth contention can be reduced, data transmission latency can be lowered, data transmission efficiency can be improved, data transmission time can be reduced, and data transmission jobs can be completed efficiently and promptly during job execution.

[0032] Based on the above embodiments, the embodiments of this application further optimize and explain the solution.

[0033] In one implementation, the job parameter information may include job memory requirements. Of course, in practical applications, it may also include job identification information (e.g., job ID), job name, job submission time, and the maximum allowed execution time of the job. The job memory requirements can be determined based on the computational tasks of the job to be executed.

[0034] And / or, the current remaining system memory capacity in the embodiments of this application may include the current remaining capacity of main memory and the current remaining capacity of extended memory. That is, when determining the current remaining system memory capacity of a heterogeneous computing system, the current remaining capacity of main memory and the current remaining capacity of extended memory can be determined.

[0035] It should be noted that, in order to ensure the performance of the data system, the heterogeneous computing system in this embodiment can be composed of dynamic random access memory (DRAM) and compute fast link (CXL). Therefore, the main memory in this embodiment can be DRAM, and the extended memory can be CXL memory. The current remaining capacity of the main memory is the current remaining capacity of the DRAM, and the current remaining capacity of the extended memory is the current remaining capacity of the CXL.

[0036] In addition, it should be noted that in practical applications, after a task starts, the job scheduler can initialize the memory state structure, record the initial resource data of main memory (DRAM) and extended memory (CXL memory), the initial idle state of computing units, and determine the current jobs to be assigned in the current set of jobs to be assigned, providing a data basis for subsequent resource allocation.

[0037] In one embodiment, the process of determining the target computing unit and target memory allocated to each job to be assigned in S130, based on the job parameter information of each job to be assigned and the current system state data of the heterogeneous computing system, combined with preset constraints and a preset objective function, is as follows: Figure 3 As shown, the steps may include the following steps S210 to S240.

[0038] S210: Get the maximum allowed execution time for each job to be assigned.

[0039] It should be noted that in practical applications, the job parameter information for each pending job may include not only the job memory requirement but also the maximum allowed execution time. Therefore, after determining the job parameters for each pending job, the maximum allowed execution time for each pending job can be obtained. Alternatively, the maximum allowed execution time can be preset in the system, allowing it to be directly retrieved from pre-stored system data. The maximum allowed execution time for each pending job can be a preset value, and the numerical value of the maximum allowed execution time can be a preset value. The specific value can be set according to the actual situation, and the embodiments of this application do not impose special limitations on it.

[0040] S220: Based on the maximum allowable execution time of the job and the current system status data of the heterogeneous computing system, update the corresponding parameters in the preset constraints and the corresponding parameters in the preset objective function to obtain the updated preset constraints and the updated preset objective function.

[0041] It is understood that in the embodiments of this application, preset constraints and preset objective functions are pre-set, and the preset constraints and preset objective functions have various parameters corresponding to the maximum allowed execution time of the job and the system state data. Since the system state parameters may be different at different times, in the embodiments of this application, after obtaining the maximum allowed execution time of the job and the current system state data of the heterogeneous computing system, the corresponding parameters in the preset constraints and the corresponding parameters in the preset objective function can be updated according to the maximum allowed execution time of the job and the current system state data of the heterogeneous computing system to obtain the updated preset constraints and the updated preset objective function.

[0042] S230: Determine each available computing unit based on the current occupancy status information of each computing unit in the current system status data.

[0043] Understandably, to further reduce bandwidth contention, this embodiment can select available computing units from among the various computing units in the system. Since the current occupancy status information of each computing unit can be obtained, and this information can be either assigned to a job or not assigned to a job—that is, for a computing unit that has been assigned a job, its current occupancy status information is "assigned job," and for a computing unit that has not been assigned a job, its current occupancy status information is "not assigned job"—the computing units without assigned jobs are available computing units. Therefore, in this embodiment, each available computing unit can be accurately and quickly determined based on the current occupancy status information of each GPU.

[0044] In the case where the computing unit is a graphics processing unit (GPU), that is, each available GPU can be determined based on the current occupancy status information of each GPU in the current system status data.

[0045] S240: Based on the job parameter information of each job to be assigned, the available computing units, and the current system remaining memory capacity and current remaining bandwidth in the current system status data, combined with the updated preset constraints and the updated preset objective function, determine the target computing unit and target memory to be assigned to each job to be assigned.

[0046] After determining the updated preset constraints, the updated preset objective function, and all available computing units, the target computing units and target memory corresponding to each job to be assigned can be further determined based on the job parameter information of each job to be assigned, the available computing units, and the current system state data of the heterogeneous computing system, with the goal of minimizing the total data transfer time in the updated preset objective function. That is, at least one target computing unit and target memory allocated to each job to be assigned are ultimately determined. This target memory is the memory ultimately allocated to the job in main memory and / or in extended memory.

[0047] In one embodiment, in order to minimize the total data transfer time and maximize the data transfer efficiency while meeting the memory requirements of each job to be allocated memory, the preset constraints in this embodiment may include at least one of memory allocation constraints, bandwidth constraints, computing unit allocation constraints, and computing unit concurrency constraints.

[0048] Furthermore, to further ensure that the total data transfer time is minimized and the data transfer efficiency is maximized while meeting the memory requirements of each pending job, and to ensure the effectiveness and rationality of memory allocation, the memory allocation constraints in this application embodiment may include: the total memory required by each pending job does not exceed the current remaining memory capacity of the system; the bandwidth constraint may include: the total bandwidth of each pending job during data transfer does not exceed the current remaining bandwidth; the computing unit allocation constraint may include: the number of computing units allocated to each pending job does not exceed the total number of available computing units; and the computing unit concurrency constraint may include: a single available computing unit can run at most one pending job at the same time, thereby avoiding resource contention and improving processing efficiency.

[0049] In one implementation, the preset objective function is constructed based on preset decision variables and the current remaining bandwidth; The memory allocation constraints are based on preset decision variables, the current remaining capacity of main memory, and the current remaining capacity of extended memory. The bandwidth constraint is constructed based on preset decision variables, the current remaining bandwidth, and the maximum allowed execution time of the job; The computational unit allocation constraints are constructed based on preset decision variables and the total number of available computational units; The concurrent constraints of the computing units are constructed based on preset decision variables.

[0050] In other words, in practical applications, preset decision variables can be set in advance, and then a preset objective function and various preset constraints can be constructed based on the preset decision variables to better allocate memory and computing units for each job to be assigned.

[0051] Furthermore, the method may also include: Pre-set the preset decision variables corresponding to the tasks to be assigned; Preset decision variables include , and Wherein, for the i-th job to be assigned and the j-th available computing unit, if the i-th job to be assigned is assigned to the j-th available computing unit, If the i-th job to be assigned is not assigned to the j-th available computing unit, When the i-th job to be assigned is allocated to the j-th available computing unit, the required memory is the first memory size of main memory. When the i-th job to be assigned is allocated to the j-th available computing unit, the memory required is not the main memory size of the first memory unit. When the memory required for the i-th job to be assigned to the j-th available computing unit is an extended memory of the second memory size, If the memory required when the i-th job to be assigned is assigned to the j-th available computing unit is not an extension of the second memory size, .

[0052] It should be noted that, in this embodiment of the application, it is assumed that the set of jobs to be assigned is... The set of available computing units is ,definition J represents the i-th job to be assigned. i Assigned to the j-th computing unit The required main memory size (i.e., DRAM memory size) is defined. Represents the i-th assignment Assigned to the j-th computing unit The required extended memory size (i.e., CXL memory size) is defined. and These represent the total capacity of DRAM memory and the total capacity of CXL memory, respectively, and are defined as follows: and These represent the bandwidth of DRAM and the bandwidth of PCIe, respectively.

[0053] The preset decision variables in this application embodiment are defined as follows: for For example, if the i-th job to be assigned Assigned to the j-th computing unit At that time, If not assigned to the j-th computing unit ,but . That is, , This represents the j-th job to be assigned. The j-th computing unit is assigned to the available computing units. superior, This represents the j-th job to be assigned. The j-th computing unit not assigned to the available computing units superior.

[0054] for For example, if the i-th job to be assigned Assigned to the j-th computing unit The required main memory (DRAM memory) size is (That is, the first memory size), then ,otherwise .

[0055] for Let's say the i-th job to be assigned Assigned to the j-th computing unit The required extended memory (CXL memory) size is (That is, the second memory size), then ,otherwise .

[0056] The preset objective function defined in this embodiment is: ; The predefined objective function T aims to minimize the total data transfer time of all jobs in the set of jobs to be assigned in the system, including the transfer time from host memory DRAM to computing units (such as GPUs) and the possible transfer time from CXL memory to computing units (such as GPUs). In other words, the purpose of the predefined objective function is to minimize the total data transfer time.

[0057] For each preset constraint, the preset constraints constructed in this application embodiment include the following: memory allocation constraints, bandwidth constraints, computing unit allocation constraints, and computing unit concurrency constraints.

[0058] The memory allocation constraints, based on preset decision variables, the current remaining capacity of main memory, and the current remaining capacity of extended memory, are as follows: ; .

[0059] It should be noted that the purpose of this memory allocation constraint is to ensure that the memory requirement of each job to be allocated does not exceed the DRAM and CXL memory in the system.

[0060] The bandwidth constraint, constructed based on preset decision variables, current remaining bandwidth, and the maximum allowed execution time of the job, is as follows: ; ; This bandwidth constraint ensures that data transfer for each pending job will not exceed the bandwidth limits of DRAM and PCIe (which may be the available bandwidth limit).

[0061] The computational unit allocation constraints (i.e., jobs to be allocated) are constructed based on preset decision variables and the total number of available computational units. Assigned to the j-th computing unit The mapping constraints are: .

[0062] The concurrency constraints of the computational units constructed based on preset decision variables are as follows: .

[0063] It should be noted that this compute unit allocation constraint ensures that each job can be assigned to multiple compute units, and the number of compute units assigned cannot exceed the total number m of available compute units in the system. Additionally, the compute unit concurrency constraint guarantees that a single compute unit runs only one job at a time. If a single compute unit runs multiple jobs simultaneously, the read / write requests between that compute unit and memory will double, further consuming PCIe bandwidth and failing to achieve the goal of "reducing bandwidth contention."

[0064] Of course, in practical applications, preset constraints can also include non-negativity constraints, that is: Ensure that the decision variables are binary values.

[0065] Understandably, in practical applications, the number of currently pending jobs in the current execution queue can be a single job to be assigned, for example... , This represents a job to be assigned, numbered k'; it can also represent multiple concurrent jobs to be assigned, for example... In the actual allocation process, the type of the set of jobs to be allocated can be determined based on the number of jobs contained in the set, and then the computing units and memory allocation for the jobs to be allocated can be carried out according to the subsequent process.

[0066] In practical applications, during the process of determining the current system status data of the heterogeneous computing system in S120 above, the total capacity of the main DRAM of the heterogeneous computing system can be obtained. and the current memory usage This allows us to obtain the current remaining memory capacity of the DRAM. ,in, Obtain the total memory capacity of the extended memory (CXL) of the heterogeneous computing system. and the current memory usage This allows us to obtain the current remaining memory capacity of CXL. ,in, Obtain the bandwidth of main memory DRAM. and PCIe bandwidth And obtain the current occupancy status information of each computing unit.

[0067] Therefore, the process of updating the corresponding parameters in the preset constraints and the corresponding parameters in the preset objective function based on the maximum allowable execution time of the job and the current system state data of the heterogeneous computing system, to obtain the updated preset constraints and the updated preset objective function, may include: To obtain the current remaining memory capacity of DRAM CXL's current remaining memory capacity DRAM bandwidth and PCIe bandwidth Afterwards, the memory information of each currently executing allocated job can be obtained, and then combined with the memory information of each currently executing allocated job and the maximum allowed execution time of the job. This yields the remaining bandwidth of DRAM and the remaining bandwidth of PCIe, where... , Where k represents the number of assigned jobs currently being executed. This represents the size of the DRAM memory required when the i-th allocated job is assigned to the j-th free computing unit; This represents the size of CXL memory required when the i-th allocated job is assigned to the j-th free computing unit.

[0068] Current remaining memory capacity using DRAM CXL's current remaining memory capacity The remaining bandwidth of DRAM and PCIe, combined with the total number of jobs to be assigned in the current set of jobs to be assigned J, and the total number of available computing units in the set of available computing units G, are used to update the corresponding parameters in each constraint condition, that is, to update the corresponding parameters in each constraint condition and the objective function: , ; ; This allows us to obtain the updated preset constraints and the updated preset objective function.

[0069] For example, the updated preset objective function is: Where J and G are the updated values.

[0070] In practical applications, an integer programming solver can be used to determine the target computing units and target memory allocated to each job based on the job parameters, available computing units, and the current system state data (current remaining memory capacity and bandwidth). This is done in conjunction with updated preset constraints and an updated preset objective function. Based on the updated preset constraints, the updated preset objective function is solved to obtain the optimal solution that satisfies all the updated preset constraints. This optimal solution includes… The specific data allows us to obtain the target computing units and target memory allocated to each job to be assigned.

[0071] For each job to be assigned, if the job corresponds to... , If all values ​​are greater than 0, it means that the current remaining memory capacity of the DRAM needs to be considered separately. CXL's current remaining memory capacity The corresponding resources are allocated. Additionally, after allocation, the current remaining DRAM memory capacity can be updated. CXL's current remaining memory capacity .

[0072] It should be noted that for a single job scenario, if there is at least one available computing unit, the solution will assign that job to one or more available computing units; for multiple job scenarios, the solution will assign each job to a non-conflicting available computing unit, that is, the same available computing unit will only be assigned to one job.

[0073] In one implementation, before determining the target computing unit and target memory to be allocated to each job in S130 based on the job parameter information of each job to be allocated and the current system state data of the heterogeneous computing system, combined with preset constraints and preset objective functions, the method may further include: Determine the total memory required based on the memory requirements of each job in the current set of jobs to be assigned; Provided that the total memory required does not exceed the current system's remaining memory capacity, the steps are as follows: based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions, determine the target computing unit and target memory to be assigned to each job to be assigned.

[0074] Understandably, in practical applications, to improve memory allocation efficiency and better ensure that data transmission does not exceed the bandwidth limitations of DRAM and PCIe, this embodiment of the application, after determining the memory requirements of each job in the current set of jobs to be allocated, can further determine the total memory required by each job. Then, this total memory required is compared with the current remaining memory capacity of the system. If the total memory required does not exceed the current remaining memory capacity of the system, the subsequent steps of S130 are executed.

[0075] In one implementation, before determining the job parameter information corresponding to each job in the current set of jobs to be assigned, the method may further include: After memory allocation is completed for each job in the previous set of jobs to be allocated, the current set of jobs to be allocated is determined from the queue of jobs to be allocated.

[0076] It should be noted that in this embodiment, each job to be assigned can be stored in a queue. After allocating the corresponding computing units and memory to each job in the previous batch of jobs to be assigned, the current set of jobs to be assigned can be determined from the queue. If the queue is not empty, all jobs to be assigned in the queue can be obtained to form the current set of jobs to be assigned. The jobs to be assigned in the queue are sorted according to the order of their submission time. That is, the first job to be assigned is placed at the head of the queue, and each subsequent job to be assigned is placed at the tail of the queue, so that the jobs to be assigned are sorted and placed according to the order of their submission time.

[0077] In one embodiment, the method may further include: If the total memory required exceeds the current system's remaining memory capacity, the last job in the current set of jobs to be assigned is added to the assignment queue, and it is determined whether the total memory required by the remaining jobs in the current set of jobs to be assigned exceeds the current system's remaining memory capacity. If the limit is not exceeded, the set of jobs to be assigned, including the remaining jobs to be assigned, will be used as the new set of jobs to be assigned. Then, the steps of determining the target computing unit and target memory to be assigned to each job to be assigned will be performed based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions. If the number of pending jobs exceeds the limit, the set of pending jobs including the remaining pending jobs will be used as the new current set of pending jobs, and the process will return to the step of adding the last pending job in the current set of pending jobs to the pending queue.

[0078] It should be noted that after determining the total memory required based on the memory needs of each job in the current set of jobs to be allocated, if the total memory required exceeds the current system's remaining memory capacity, the last job at the tail of the queue can be removed from the current set of jobs to be allocated and placed into the allocation queue, for example, at the head of the queue, so that memory can be allocated to that last job as quickly as possible. For the current set of jobs to be allocated after removing the last job, it can be further determined whether the total memory required by the remaining jobs in the current set of jobs to be allocated exceeds the current system's remaining memory capacity. If it does not exceed the current system's remaining memory capacity, subsequent memory allocation operations can be performed on the new set of jobs to be allocated. If the current system's remaining memory capacity is still exceeded, the last current job to be allocated in the new set of current jobs to be allocated can be deleted until the total memory required by the remaining jobs in the current set of current jobs to be allocated does not exceed the current system's remaining memory capacity, thus obtaining the final set of current jobs to be allocated, and performing memory allocation procedures S110 to S130 on each job to be allocated in the final set of current jobs to be allocated.

[0079] In other words, in this embodiment of the application, if the total memory required by each job in the current set of jobs to be assigned exceeds the current remaining memory capacity of the system, the total memory required can be reduced by decreasing the number of jobs in the current set of jobs to be assigned one by one, so that the total memory required does not exceed the current remaining memory capacity of the system.

[0080] In one implementation, after determining the target computing unit and target memory to be allocated to each job to be assigned, the method may further include: Execute the corresponding job according to the target computing unit and target memory for each job to be assigned; During the execution of pending jobs, monitor the job execution status.

[0081] It should be noted that in S130, the allocation of computing units and memory for each job to be assigned is completed. After obtaining the allocation scheme, each job to be assigned can be executed. During the execution of the job to be assigned, the execution status of the job is monitored. This execution status can include computing progress, actual memory usage, data transfer rate, etc., to monitor whether the actual resource usage meets the constraints.

[0082] Furthermore, the method may also include: Based on the job execution status corresponding to each job to be assigned, determine the overall actual bandwidth and overall actual memory usage of each job to be assigned; Determine whether the overall actual bandwidth exceeds the current remaining bandwidth, and determine whether the overall actual memory usage exceeds the current remaining system memory capacity; If the overall actual bandwidth exceeds the current remaining bandwidth, or if the overall actual memory usage exceeds the current system's remaining memory capacity, then all currently executing pending jobs will be interrupted, and each pending job will be re-added to the pending queue.

[0083] In other words, job execution status includes computation progress, actual memory usage, and data transfer rate. Therefore, based on the data transfer rate in the execution status of each pending job, the overall actual bandwidth of each pending job can be determined. Similarly, based on the actual memory usage of each pending job, the overall actual memory usage can be determined. This overall actual bandwidth is then compared to the system's current remaining bandwidth. If the overall actual bandwidth exceeds the current remaining bandwidth, it indicates that the actual data transfer does not meet the bandwidth constraint. In this case, to ensure system performance, currently executing jobs can be interrupted, and these interruptions can be added back to the allocation queue for memory reallocation. This ensures that data transfer during job execution does not exceed the bandwidth constraint, thus guaranteeing system performance. Similarly, the overall actual memory usage is compared to the current remaining system memory capacity. If the overall actual memory usage exceeds the current remaining system memory capacity, it indicates that memory usage does not meet the memory allocation constraint. In this case, to ensure system performance, currently executing jobs also need to be interrupted, and these interruptions can be added back to the allocation queue for memory reallocation. This ensures that memory usage during job execution does not exceed the memory allocation constraint, thus guaranteeing system performance.

[0084] It should also be noted that before executing each job to be assigned, data transfer can be initiated according to the allocation scheme. This involves transferring the data required for each job from the allocated DRAM memory and / or CXL memory to the corresponding computing unit. During data transfer, the data transfer rate can be monitored to ensure it does not exceed the bandwidth limit, thus satisfying bandwidth constraints. Furthermore, after the data transfer required for each job to be assigned is completed, the execution of that job can be initiated.

[0085] In one implementation, after determining the target computing unit and target memory to be allocated to each job to be assigned, the method may further include: For each job to be assigned, record the mapping relationship between the job to be assigned and the corresponding target computing unit and target memory; Update the occupancy status information for each target computing unit.

[0086] It should also be noted that after allocating resources for each job, the target computing unit and target memory corresponding to each job can be further recorded. For example, job identification information and a list of target computing units can be recorded. - This mapping relationship, in addition, can also record the bandwidth limit (job identification information - target computing unit list - - -Bandwidth limit), the bandwidth limit is the remaining bandwidth after allocation. Additionally, this application can update the occupancy status information of each target computing unit, changing it from an unallocated job to an allocated job. At this point, the target computing unit is no longer an idle computing unit, facilitating the screening and identification of idle computing units during subsequent memory allocation. Furthermore, the current system status data of the heterogeneous computing system can also be updated.

[0087] In one embodiment, the method may further include: After the execution of the pending job is detected, the target memory corresponding to the completed pending job is reclaimed according to the mapping relationship between the pending job and the corresponding target computing unit and target memory. Update the occupancy status information of the target computing unit corresponding to the completed pending job.

[0088] It should also be noted that, in order to further improve system performance and optimize the memory allocation results of subsequent jobs, so that the computing units and memory allocation of subsequent jobs are optimal, in this embodiment of the application, after the job to be allocated is executed, the mapping relationship between the job to be allocated and the corresponding target computing unit and target memory can be further determined based on the previously recorded mapping relationship between the job to be allocated and the corresponding target computing unit and target memory. For example, identification information - target computing unit list - - The mapping relationship is used to reclaim the target memory corresponding to the job to be allocated. That is, the DRAM memory and / or CXL memory occupied by the job to be allocated are accurately reclaimed, and the current system's remaining memory capacity can also be updated. After reclamation, the occupancy status information of the target computing unit corresponding to the completed job to be allocated can be further updated. For example, the occupancy status information of the target computing unit can be changed from allocated to unallocated. After the update, the target computing unit becomes an available computing unit, thereby releasing computing unit resources for subsequent job allocation. It can be understood that by reclaiming the target memory corresponding to the completed job and modifying the occupancy status of the corresponding target computing unit in this application, the system's remaining memory capacity can be increased, and the number of available computing units can be increased. This provides more sufficient resources for the memory allocation and computing unit allocation of the next batch of jobs to be allocated, so that the next batch of jobs to be allocated can obtain more optimized allocation results during the memory allocation and computing unit allocation process, thereby improving the overall system performance.

[0089] In addition, after the assigned jobs are completed, the actual execution time, resource usage deviation, transmission delay, etc. can be collected during the execution process to provide data support for subsequent optimization of job scheduling and memory allocation methods, thereby better improving system performance.

[0090] It is understood that by monitoring the job execution status and promptly reclaiming memory resources in this embodiment, the process ensures high resource utilization and rapid response capability of the system, thereby improving the performance and reliability of the system when processing high-performance computing tasks.

[0091] In one embodiment, the method may further include: If a new job is detected, the new job is added to the job queue as a job to be assigned.

[0092] It should be noted that in this embodiment of the application, it is possible to detect in real time whether a new job has been generated in the system. If a new job is detected, the new job is added to the job queue to be assigned.

[0093] Additionally, after reclaiming resources from completed jobs, the system can check if there are any unassigned new jobs in the allocation queue. If so, these jobs are used to form a new set of jobs to be allocated, and the system returns to steps S110 to S130 to begin a new round of resource allocation and job execution. If the allocation queue is empty, the system can continuously monitor the inflow of new jobs and add them to the allocation queue when detected. If there are no jobs to be allocated at present, the new job is used as the current set of jobs to be allocated, and the system returns to steps S110 to S130.

[0094] In other words, such as Figure 4 As shown in the embodiments of this application, after task startup and initialization (e.g., memory state structure initialization), computing unit (e.g., GPU) resources and memory can be allocated to each job in the current set of jobs to be allocated. After allocation, the remaining memory capacity and bandwidth are updated. Then, the data required by the jobs to be allocated is transmitted and the jobs are executed. After the jobs are executed, memory reclamation and system state updates are performed. If new jobs are detected, memory allocation continues for multiple new jobs. That is, the entire memory process in this application forms a complete closed loop of "allocation--execution--reclamation--reallocation", which can flexibly adapt to continuous job access scenarios, ensure that jobs in a multi-computing unit system can be executed efficiently and orderly, thereby maximizing resource utilization and minimizing data transmission time, thus improving overall performance.

[0095] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0096] Embodiments of this application also provide a memory allocation device, please refer to... Figure 5 The diagram shows the structure of a memory allocation device. This memory allocation device includes: The first determining module 11 is used to determine the job parameter information corresponding to each job to be assigned in the current set of jobs to be assigned; The second determining module 12 is used to determine the current system status data of the heterogeneous computing system. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit. The allocation module 13 is used to determine the target computing unit and target memory to be allocated to each job based on the job parameter information of each job to be allocated and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions; the preset objective function aims to minimize the total data transfer time.

[0097] In one implementation, the job parameter information includes job memory requirements; And / or, the current remaining system memory capacity includes the current remaining capacity of main memory and the current remaining capacity of extended memory.

[0098] In one embodiment, the allocation module 13 includes: The first acquisition unit is used to acquire the maximum allowed execution time for each job to be assigned; The update unit is used to update the corresponding parameters in the preset constraints and the corresponding parameters in the preset objective function based on the maximum allowed execution time of the job and the current system status data of the heterogeneous computing system, so as to obtain the updated preset constraints and the updated preset objective function. The first determining unit is used to determine each available computing unit based on the current occupancy status information of each computing unit in the current system status data; The allocation unit is used to determine the target computing unit and target memory to be allocated to each job based on the job parameter information of each job to be allocated, the available computing units, and the current system remaining memory capacity and current remaining bandwidth in the current system status data, combined with the updated preset constraints and the updated preset objective function.

[0099] In one implementation, the preset constraints include at least one of memory allocation constraints, bandwidth constraints, computing unit allocation constraints, and computing unit concurrency constraints.

[0100] In one implementation, memory allocation constraints include: the total memory required by each job to be allocated does not exceed the current remaining memory capacity of the system; Bandwidth constraints include: the total bandwidth for each job to be assigned during data transmission shall not exceed the currently available bandwidth; The computing unit allocation constraints include: the number of computing units allocated to each job to be assigned shall not exceed the total number of available computing units; The concurrency constraint for computing units includes: a single available computing unit can run at most one job to be assigned at any given time.

[0101] In one implementation, the preset objective function is constructed based on preset decision variables and the current remaining bandwidth; The memory allocation constraints are based on preset decision variables, the current remaining capacity of main memory, and the current remaining capacity of extended memory. The bandwidth constraint is constructed based on preset decision variables, the current remaining bandwidth, and the maximum allowed execution time of the job; The computational unit allocation constraints are constructed based on preset decision variables and the total number of available computational units; The concurrent constraints of the computing units are constructed based on preset decision variables.

[0102] In one embodiment, the device further includes: The settings module is used to pre-set the preset decision variables corresponding to the jobs to be assigned. Preset decision variables include , and Wherein, for the i-th job to be assigned and the j-th available computing unit, if the i-th job to be assigned is assigned to the j-th available computing unit, If the i-th job to be assigned is not assigned to the j-th available computing unit, When the i-th job to be assigned is allocated to the j-th available computing unit, the required memory is the first memory size of main memory. When the i-th job to be assigned is allocated to the j-th available computing unit, the memory required is not the main memory size of the first memory unit. When the memory required for the i-th job to be assigned to the j-th available computing unit is an extended memory of the second memory size, If the memory required when the i-th job to be assigned is assigned to the j-th available computing unit is not an extension of the second memory size, .

[0103] In one embodiment, the device further includes: The third determining module is used to determine the total memory required based on the memory requirements of each job in the current set of jobs to be assigned. The trigger module is used to trigger the allocation module 13 when the total memory required does not exceed the current system's remaining memory capacity.

[0104] In one embodiment, the device further includes: The fourth determination module is used to determine the current set of jobs to be allocated from the queue of jobs to be allocated after memory allocation has been completed for each job in the previous set of jobs to be allocated.

[0105] In one embodiment, the device further includes: The fifth determination module is used to add the last job to be assigned in the current set of jobs to the assignment queue when the total memory required exceeds the current system's remaining memory capacity, and to determine whether the total memory required by the remaining jobs in the current set of jobs exceeds the current system's remaining memory capacity; if it does not exceed, the sixth determination module is triggered; if it does exceed, the seventh determination module is triggered. The sixth determination module is used to take the set of jobs to be assigned, including the remaining jobs to be assigned, as the new current set of jobs to be assigned, and to trigger the assignment module 13. The seventh determination module is used to take the set of jobs to be assigned, including the remaining jobs to be assigned, as the new current set of jobs to be assigned, and to trigger the fifth determination module.

[0106] In one embodiment, the device further includes: The execution module is used to execute the corresponding job according to the target computing unit and target memory corresponding to each job to be assigned; The monitoring module is used to monitor the execution status of the jobs to be assigned during the execution process.

[0107] In one embodiment, the device further includes: The eighth determination module is used to determine the overall actual bandwidth and overall actual memory usage of each job to be assigned based on the job execution status corresponding to each job to be assigned. The judgment module is used to determine whether the overall actual bandwidth exceeds the current remaining bandwidth and whether the overall actual memory usage exceeds the current system remaining memory capacity; if the overall actual bandwidth exceeds the current remaining bandwidth, or the overall actual memory usage exceeds the current system remaining memory capacity, the interrupt module is triggered. The interrupt module is used to interrupt each currently executing job and add it back to the job queue.

[0108] In one embodiment, the device further includes: The recording module is used to record the mapping relationship between each job to be assigned and its corresponding target computing unit and target memory. The first update module is used to update the occupancy status information of each target computing unit.

[0109] In one embodiment, the device further includes: The recycling module is used to reclaim the target memory corresponding to the completed job after detecting that the job to be assigned has been executed, based on the mapping relationship between the job to be assigned and the corresponding target computing unit and target memory. The second update module is used to update the occupancy status information of the target computing unit corresponding to the completed pending job.

[0110] In one embodiment, the device further includes: The add module is used to add new jobs as pending jobs to the assignment queue when a new job is detected.

[0111] In one implementation, the current remaining capacity of the main memory is the current remaining capacity of the dynamic random access memory, which is the current remaining capacity of the memory used for calculating fast links.

[0112] The memory allocation device provided in this application has the same beneficial effects as the memory allocation method provided in the above embodiments. For the description of the features of the memory allocation device in the corresponding embodiments, please refer to the relevant description of the memory allocation method in the corresponding embodiments, which will not be repeated here.

[0113] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the memory allocation method embodiments described above.

[0114] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described memory allocation method embodiments at runtime.

[0115] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0116] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described memory allocation method embodiments.

[0117] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described memory allocation method embodiments.

[0118] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0119] The foregoing has provided a detailed description of a memory allocation method, apparatus, computer program product, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A memory allocation method, characterized in that, include: Determine the job parameter information for each job to be assigned in the current set of jobs to be assigned; The current system status data of the heterogeneous computing system is determined. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit. The current occupancy status information is either assigned jobs or unassigned jobs. If the current occupancy status information of a computing unit is unassigned jobs, the computing unit is an available computing unit. Based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions, the target computing unit and target memory to be assigned to each job to be assigned are determined. The preset objective function aims to minimize the total data transmission time; wherein: The preset constraints include: memory allocation constraints, bandwidth constraints, computing unit allocation constraints, and computing unit concurrency constraints; the computing unit allocation constraints include: the number of computing units allocated to each of the jobs to be allocated does not exceed the total number of available computing units; the computing unit concurrency constraints include: a single available computing unit can run at most one job to be allocated at any given time; Before determining the target computing unit and target memory allocated to each of the jobs to be assigned based on the job parameter information of each job to be assigned and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions, the method further includes: determining the total memory required at present based on the job memory requirements corresponding to each job to be assigned in the current set of jobs to be assigned. If the total memory required at present does not exceed the remaining memory capacity of the current system, the step of determining the target computing unit and target memory to be allocated to each of the jobs to be allocated is performed based on the job parameter information of each job to be allocated and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions. If the total memory required exceeds the current system's remaining memory capacity, the last job to be assigned in the current set of jobs to be assigned is removed from the current set of jobs to be assigned, and the last job to be assigned is placed at the head of the queue to be assigned. It is then determined whether the total memory required by the remaining jobs to be assigned in the current set of jobs to be assigned exceeds the current system's remaining memory capacity. If the limit is not exceeded, the set of jobs to be assigned, including the remaining jobs to be assigned, will be used as the new set of jobs to be assigned. Then, the step of determining the target computing unit and target memory to be assigned to each job to be assigned will be executed, based on the job parameter information of each job to be assigned and the current system state data of the heterogeneous computing system, combined with preset constraints and preset objective functions. If the number of pending jobs exceeds the limit, the set of pending jobs including the remaining pending jobs will be used as the new current set of pending jobs, and the process will return to the step of removing the last pending job from the current set of pending jobs and placing the last pending job into the head of the pending job queue. Based on the job execution status corresponding to each of the jobs to be assigned, the overall actual bandwidth and overall actual memory usage of each job to be assigned are determined; the job execution status includes computation progress, actual memory usage, and data transfer rate; Determine whether the overall actual bandwidth exceeds the current remaining bandwidth, and determine whether the overall actual memory usage exceeds the current system remaining memory capacity; If the overall actual bandwidth exceeds the current remaining bandwidth, or if the overall actual memory usage exceeds the current system remaining memory capacity, then all currently executing pending jobs will be interrupted, and all pending jobs will be re-added to the pending allocation queue.

2. The memory allocation method according to claim 1, characterized in that, The job parameter information includes the job memory requirements; And / or, the current remaining system memory capacity includes the current remaining capacity of main memory and the current remaining capacity of extended memory.

3. The memory allocation method according to claim 2, characterized in that, The step of determining the target computing unit and target memory to be allocated to each of the jobs to be allocated, based on the job parameter information of each job to be allocated and the current system state data of the heterogeneous computing system, combined with preset constraints and preset objective functions, includes: Get the maximum allowed execution time for each job to be assigned; Based on the maximum allowed execution time of the job and the current system status data of the heterogeneous computing system, the corresponding parameters in the preset constraints and the corresponding parameters in the preset objective function are updated to obtain the updated preset constraints and the updated preset objective function. Based on the current occupancy status information of each computing unit in the current system status data, determine each available computing unit; Based on the job parameter information of each job to be assigned, the available computing units, and the current system remaining memory capacity and current remaining bandwidth in the current system status data, combined with the updated preset constraints and the updated preset objective function, the target computing unit and target memory to be assigned to each job to be assigned are determined.

4. The memory allocation method according to claim 1, characterized in that, The memory allocation constraints include: the total memory required by each job to be allocated does not exceed the current remaining memory capacity of the system; The bandwidth constraint includes: the total bandwidth of each job to be assigned during data transmission does not exceed the current remaining bandwidth.

5. The memory allocation method according to claim 4, characterized in that, The preset objective function is constructed based on preset decision variables and the current remaining bandwidth; The memory allocation constraint is based on the preset decision variables, the current remaining capacity of the main memory, and the current remaining capacity of the extended memory; The bandwidth constraint is constructed based on the preset decision variables, the current remaining bandwidth, and the maximum allowed execution time of the job; The computing unit allocation constraints are constructed based on the preset decision variables and the total number of available computing units; The concurrency constraints of the computing unit are constructed based on the preset decision variables.

6. The memory allocation method according to claim 5, characterized in that, Also includes: Pre-set the preset decision variables corresponding to the tasks to be assigned; The preset decision variables include , and Wherein, for the i-th job to be assigned and the j-th available computing unit, if the i-th job to be assigned is assigned to the j-th available computing unit, If the i-th job to be assigned is not assigned to the j-th available computing unit, When the memory required by the i-th job to be assigned to the j-th available computing unit is the first memory size of main memory, If the memory required when the i-th job to be assigned is allocated to the j-th available computing unit is not the main memory size of the first memory unit, When the memory required for the i-th job to be assigned to the j-th available computing unit is an extended memory of the second memory size, If the memory required when the i-th job to be assigned is allocated to the j-th available computing unit is not an extended memory of the second memory size, .

7. The memory allocation method according to claim 1, characterized in that, Before determining the job parameter information corresponding to each job in the current set of jobs to be assigned, the method further includes: After memory allocation is completed for each job in the previous set of jobs to be allocated, the current set of jobs to be allocated is determined from the queue of jobs to be allocated.

8. The memory allocation method according to claim 7, characterized in that, After determining the target computing unit and target memory to be allocated to each of the jobs to be assigned, the method further includes: Execute the corresponding job to be allocated based on the target computing unit and target memory corresponding to each job to be allocated; During the execution of the job to be assigned, the job execution status is monitored.

9. The memory allocation method according to claim 1, characterized in that, After determining the target computing unit and target memory to be allocated to each of the jobs to be assigned, the method further includes: For each job to be assigned, the mapping relationship between the job to be assigned and the corresponding target computing unit and target memory is recorded; Update the occupancy status information of each target computing unit.

10. The memory allocation method according to claim 9, characterized in that, Also includes: After the execution of the job to be assigned is detected, the target memory corresponding to the completed job is reclaimed according to the mapping relationship between the job to be assigned and the corresponding target computing unit and target memory. Update the occupancy status information of the target computing unit corresponding to the completed pending job.

11. The memory allocation method according to claim 9, characterized in that, Also includes: If a new job is detected, the new job is added to the job queue as a job to be assigned.

12. The memory allocation method according to any one of claims 2 to 11, characterized in that, The current remaining capacity of main memory is the current remaining capacity of dynamic random access memory; the current remaining capacity of extended memory is the current remaining capacity of memory used for fast link calculation.

13. A memory allocation device, characterized in that, include: The first determining module is used to determine the job parameter information corresponding to each job to be assigned in the current set of jobs to be assigned. The second determining module is used to determine the current system status data of the heterogeneous computing system. The current system status data includes the current remaining memory capacity, the current remaining bandwidth, and the current occupancy status information of each computing unit. The current occupancy status information is either an assigned job or an unassigned job. If the current occupancy status information of a computing unit is an unassigned job, the computing unit is an available computing unit. The allocation module is used to determine the target computing unit and target memory to be allocated to each of the jobs to be allocated based on the job parameter information of each job to be allocated and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions. The preset objective function aims to minimize the total data transmission time; wherein: The preset constraints include: memory allocation constraints, bandwidth constraints, computing unit allocation constraints, and computing unit concurrency constraints; the computing unit allocation constraints include: the number of computing units allocated to each of the jobs to be allocated does not exceed the total number of available computing units; the computing unit concurrency constraints include: a single available computing unit can run at most one job to be allocated at any given time; It also includes: a third determining module, used to determine the total memory required at present before determining the target computing unit and target memory to be allocated to each of the jobs to be allocated based on the job parameter information of each job to be allocated and the current system status data of the heterogeneous computing system, combined with preset constraints and preset objective functions; the preset objective function aims to minimize the total data transmission time; The triggering module is used to trigger the allocation module when the total memory required at present does not exceed the current remaining memory capacity of the system. The fifth determining module is used to, when the total memory required exceeds the current system's remaining memory capacity, remove the last job to be assigned from the current set of jobs to be assigned, place the last job to be assigned at the head of the assignment queue, and determine whether the total memory required by the remaining jobs to be assigned in the current set of jobs to be assigned exceeds the current system's remaining memory capacity; if it does not exceed, the sixth determining module is triggered; if it does exceed, the seventh determining module is triggered. The sixth determination module is used to take the set of jobs to be assigned, including the remaining jobs to be assigned, as the new current set of jobs to be assigned, and to trigger the assignment module; The seventh determination module is used to take the set of jobs to be assigned, including the remaining jobs to be assigned, as the new current set of jobs to be assigned, and to trigger the fifth determination module. The eighth determining module is used to determine the overall actual bandwidth and overall actual memory usage of each job to be assigned based on the job execution status corresponding to each job to be assigned; the job execution status includes calculation progress, actual memory usage, and data transfer rate; The judgment module is used to determine whether the overall actual bandwidth exceeds the current remaining bandwidth and whether the overall actual memory usage exceeds the current system remaining memory capacity; if the overall actual bandwidth exceeds the current remaining bandwidth, or the overall actual memory usage exceeds the current system remaining memory capacity, the interrupt module is triggered. The interrupt module is used to interrupt each of the currently executing jobs to be assigned and to re-add each of the jobs to be assigned to the queue.

14. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the steps of the memory allocation method as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the memory allocation method as described in any one of claims 1 to 12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the memory allocation method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data processing method, product, server and medium

    CN118409871A

  • Task allocation method and system for heterogeneous computing architecture, terminal and medium

    CN120560851A

  • Big data task scheduling method and device, equipment and readable storage medium

    CN120687217A