A memory pool configuration method and system based on machine learning
By analyzing the memory allocation mode of artificial intelligence training and using genetic algorithms to optimize memory pool configuration, the problem of difficult optimization of memory pool configuration parameters in the existing technology is solved, and adaptive optimization of memory pool configuration and efficient memory management are realized.
Patent Information
- Application Number
- CN202510051797.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-14
AI Technical Summary
The existing technology fails to fully utilize the program's memory usage pattern characteristics in scenarios such as artificial intelligence training, which makes it difficult to optimize memory pool configuration parameters and lacks an adaptive optimization mechanism.
The memory operation data of the artificial intelligence training program is obtained through a memory interceptor, statistical analysis and timing feature analysis are performed, initial populations are generated and evolved through genetic algorithms to obtain the memory pool configuration of the optimal solution.
Adaptive optimization of memory pool configuration is realized, reducing memory management overhead, improving memory utilization, and reducing memory fragmentation.
Smart Images

Figure CN119512764B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a memory pool configuration method and system based on machine learning. Background Art
[0002] Memory pool technology is an important method to improve memory management efficiency. In scenarios such as artificial intelligence training, programs need to frequently dynamically allocate and release memory, and these operations will bring significant performance overhead. Existing memory management methods mainly include dynamic memory allocation, fixed-size memory pools, and variable-size memory pools. Dynamic memory allocation is flexible but has high overhead; fixed-size memory pools have low overhead but are prone to memory waste; variable-size memory pools can balance the relationship between performance and memory waste, but are complex to manage and difficult to optimize.
[0003] For example, the patent CN118377624A discloses a memory data management method, system and related equipment for obtaining task information of a memory application task, wherein the memory application task is used to apply for memory space for accessing memory data; the task information of the memory application task is input into a pre-trained memory access prediction model, and the memory space allocated for the memory application task is output to store the memory data applied for access by the memory application task, wherein the memory space includes: memory and / or cache. However, the above method fails to fully utilize the memory usage pattern characteristics of the program, especially in scenarios such as artificial intelligence training, and does not consider that the memory usage pattern of each iteration is similar, and the memory pool is reasonably configured based on this similar pattern feature, which makes it difficult to optimize the memory pool configuration parameters and lacks an adaptive optimization mechanism. Summary of the invention
[0004] In view of the shortcomings existing in the related technologies, the purpose of the present invention is to provide a memory pool configuration method and system based on machine learning to solve the technical problems that the prior art does not consider the similarity of the memory usage pattern of each iteration in scenarios such as artificial intelligence training, and reasonably configures the memory pool based on the characteristics of this similar pattern, resulting in difficulty in optimizing the memory pool configuration parameters and lack of an adaptive optimization mechanism.
[0005] The present invention provides a memory pool configuration method based on machine learning, comprising the following steps:
[0006] Memory operation data acquisition step: obtain the memory operation data of the artificial intelligence training program through the memory interceptor;
[0007] The memory interceptor obtains the memory operation data by overloading the memory allocation function and the memory release function, and the memory operation data includes the memory block size, the allocation sequence number, and the release sequence number;
[0008] Memory allocation analysis step: performing statistical analysis, timing analysis of operation events, and timing feature analysis based on the memory operation data to obtain the size of memory blocks, the number of memory blocks, and the type of memory blocks;
[0009] Configuration strategy generation step: using the memory block size, the number of memory blocks and the memory block category to represent the memory allocation mode of artificial intelligence training, generating an initial population based on the memory block size, the number of memory blocks and the memory block category, and evolving to obtain a final evolved population, and obtaining the optimal solution memory pool configuration according to the final evolved population.
[0010] The embodiment of the present invention analyzes the memory allocation pattern of artificial intelligence training and automatically optimizes the number, size and category of memory pools to reduce memory management overhead, improve memory utilization, reduce memory fragmentation, and achieve adaptive optimization of memory pool configuration.
[0011] In some embodiments of the present invention, the memory allocation analysis step includes:
[0012] Memory block size analysis step: analyzing the value of the memory block size based on preset statistical indicators to obtain statistical information, identifying the category of the memory block size through a clustering algorithm, and using it to analyze the memory block size in the memory pool configuration;
[0013] Memory block quantity analysis steps: Build and traverse the time series event list, count the concurrent number of memory blocks according to the time series moment and record the maximum concurrent number and average concurrent number, analyze the usage frequency of memory blocks, and use it to analyze the number of memory blocks in the memory pool configuration;
[0014] Timing feature analysis steps: Calculate the life cycle of the memory block and identify whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training.
[0015] The embodiment of the present invention analyzes the memory block size and the number of memory blocks configured by the memory pool and the memory allocation mode of artificial intelligence training, and automatically determines the size, number and category of the memory pool for subsequent memory pool configuration strategy generation, thereby improving the efficiency of the memory pool configuration.
[0016] In some embodiments of the present invention, the configuration strategy generating step is specifically:
[0017] Decoding step: defining a solution as a set of memory pool configurations, wherein the set of memory pool configurations includes the number of memory pools, and any memory pool configuration includes a memory block size, a memory block number, and a memory block category, and the memory pools are sorted in order of memory block size;
[0018] Initial population generation step: clustering and generating a basic solution based on the memory block size, the number of memory blocks and the memory block category, generating a heuristic solution according to the statistical information, randomly generating a supplementary solution, and obtaining an initial population according to the basic solution, the heuristic solution and the supplementary solution;
[0019] Configuration optimization step: calculate a fitness score, perform selection operation, crossover operation and mutation operation based on the fitness score, and when the iterative optimization reaches a preset number of iterations, obtain the final evolution population, and decode the final evolution population to obtain the optimal solution memory pool configuration.
[0020] The configuration optimization steps are specifically as follows:
[0021] The fitness score is calculated based on weighted performance indicators, including memory utilization, memory waste rate, and allocation success rate;
[0022] The selection operation is specifically to select the target solution in the initial population as the evolutionary population according to the fitness score through an elite retention strategy;
[0023] The crossover operation specifically involves exchanging parameters between memory pools at the same position and adjusting the memory pool parameters;
[0024] The mutation operation specifically balances the memory pool parameters through an adaptive mutation rate to obtain a final evolutionary population.
[0025] The embodiment of the present invention can iteratively optimize the optimal memory pool configuration strategy through the crossover operation, mutation operation and selection operation of the genetic algorithm, improve the memory allocation success rate and optimize the memory pool utilization rate.
[0026] Some embodiments of the present invention further provide a memory pool configuration system based on machine learning, including:
[0027] Memory operation data acquisition module: obtains the memory operation data of the AI training program through the memory interceptor;
[0028] Memory allocation analysis module: performs statistical analysis, timing analysis of operation events, and timing feature analysis based on the memory operation data to obtain the size of memory blocks, the number of memory blocks, and the type of memory blocks;
[0029] Configuration strategy generation module: using the memory block size, the number of memory blocks and the memory block category to represent the memory allocation mode of artificial intelligence training, generating an initial population based on the memory block size, the number of memory blocks and the memory block category, and evolving to obtain a final evolved population, and obtaining the optimal solution memory pool configuration according to the final evolved population.
[0030] Wherein, the memory operation data acquisition module includes:
[0031] The memory interceptor obtains the memory operation data by overloading the memory allocation function and the memory release function, and the memory operation data includes the memory block size, the allocation sequence number, and the release sequence number.
[0032] Among them, the memory allocation analysis module includes:
[0033] A memory block size analysis unit: analyzing the value of the memory block size based on preset statistical indicators to obtain statistical information, identifying the category of the memory block size through a clustering algorithm, and used for analyzing the memory block size in the memory pool configuration;
[0034] Memory block quantity analysis unit: builds and traverses the time series event list, counts the concurrent number of memory blocks according to the time series moment and records the maximum concurrent number and the average concurrent number, analyzes the usage frequency of memory blocks, and is used to analyze the number of memory blocks in the memory pool configuration;
[0035] Timing feature analysis unit: calculates the life cycle of memory blocks and identifies whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training.
[0036] The configuration strategy generation module is specifically:
[0037] Decoding unit: defining a solution as a set of memory pool configurations, wherein the set of memory pool configurations includes the number of memory pools, and any memory pool configuration includes a memory block size, a memory block number, and a memory block category, and the memory pools are sorted in order of memory block size;
[0038] An initial population generating unit: clustering and generating a basic solution based on the memory block size, the number of memory blocks and the memory block category, generating a heuristic solution according to the statistical information, randomly generating a supplementary solution, and obtaining an initial population according to the basic solution, the heuristic solution and the supplementary solution;
[0039] Configuration optimization unit: calculates a fitness score, performs selection operation, crossover operation and mutation operation based on the fitness score, obtains the final evolution population when the iterative optimization reaches a preset number of iterations, and decodes the final evolution population to obtain the memory pool configuration of the optimal solution.
[0040] The configuration optimization units are specifically:
[0041] The fitness score is calculated based on weighted performance indicators, including memory utilization, memory waste rate, and allocation success rate;
[0042] The selection operation is specifically to select the target solution in the initial population as the evolutionary population according to the fitness score through an elite retention strategy;
[0043] The crossover operation specifically involves exchanging parameters between memory pools at the same position and adjusting the memory pool parameters;
[0044] The mutation operation specifically balances the memory pool parameters through an adaptive mutation rate to obtain a final evolutionary population.
[0045] The embodiment of the present invention analyzes the memory allocation pattern of artificial intelligence training, automatically optimizes the number, size and category of memory pools, reduces memory management overhead, improves memory utilization, reduces memory fragmentation, and realizes adaptive optimization of memory pool configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0047] Figure 1 A flowchart of a memory pool configuration method based on machine learning provided in an embodiment of the present invention;
[0048] Figure 2 A flowchart of a memory allocation analysis step S2 provided in an embodiment of the present invention;
[0049] Figure 3 A flowchart of a configuration strategy generation step S3 provided in an embodiment of the present invention;
[0050] Figure 4 A structural diagram of a memory pool configuration system based on machine learning provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0052] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0053] During the AI training process, memory allocation has regularity. Due to the regularity, multiple fixed memory pools can be allocated before training. Each memory pool has multiple memory blocks of fixed sizes, thereby reducing memory management overhead. However, how to determine the number of memory pools, the size of the memory blocks of each memory pool, and the number of memory blocks to minimize memory waste is an urgent problem to be solved.
[0054] The present invention summarizes the regularity of memory allocation found in the process of artificial intelligence training into a memory allocation mode for artificial intelligence training.
[0055] Among them, the memory allocation modes for artificial intelligence training are divided into:
[0056] 1) Static allocation mode: a fixed size is pre-allocated before training, and the memory block is held for a long time, and its life cycle runs through the entire training process. The advantage is that the memory management overhead is small, but the disadvantage is that it may cause memory waste;
[0057] 2) Dynamic allocation mode: Memory is dynamically allocated and released on demand. The memory block has a short life cycle and is released after use. The advantage is high memory utilization, but the disadvantage is that frequent allocation and release bring additional overhead.
[0058] 3) Hybrid allocation mode: Combining the characteristics of static and dynamic allocation, key data structures use static allocation, temporary calculations use dynamic allocation, and balance memory efficiency and management overhead.
[0059] The problem is solved through a genetic algorithm, and the solution can be matched according to the memory allocation mode. The memory pool configuration is obtained according to the solution. The solution is a specific plan to implement a specific allocation mode. The solution needs to design memory pool parameters according to the characteristics of the memory allocation mode. The static mode corresponds to configuring a larger fixed memory pool; the dynamic mode corresponds to configuring multiple small reusable memory pools; the mixed mode corresponds to configuring a combination of memory pools for different purposes.
[0060] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0061] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.
[0062] As attached Figure 1 As shown, the present invention provides a memory pool configuration method based on machine learning, comprising the following steps:
[0063] Memory operation data acquisition step S1: acquiring memory operation data of the artificial intelligence training program through a memory interceptor;
[0064] The memory interceptor obtains memory operation data by overloading memory allocation function and memory release function. The memory operation data includes memory block size, allocation sequence number and release sequence number. Optionally, the memory block size is in bytes. The allocation sequence number records the allocation sequence through an auto-incrementing ID. The release sequence number records the release sequence through an auto-incrementing ID to ensure that the timing characteristics of memory use can be accurately reproduced. The memory operation data is saved as a complete memory operation track in chronological order in JSON format.
[0065] Memory allocation analysis step S2: performing statistical analysis, timing analysis of operation events, and timing feature analysis based on memory operation data to obtain memory block size, memory block quantity, and memory block category;
[0066] Configuration strategy generation step S3: Use memory block size, memory block number and memory block category to represent the memory allocation mode of artificial intelligence training, generate an initial population based on the memory block size, memory block number and memory block category, and evolve to obtain the final evolved population, and obtain the optimal solution memory pool configuration based on the final evolved population.
[0067] Based on the above method, by analyzing the memory allocation pattern of AI training, the number, size and category of memory pools are automatically optimized to reduce memory management overhead, improve memory utilization, reduce memory fragmentation, and achieve adaptive optimization of memory pool configuration.
[0068] Combined with Figure 2 As shown, the memory allocation analysis step S2 includes:
[0069] Memory block size analysis step S21: Analyze the value of the memory block size based on preset statistical indicators to obtain statistical information, identify the category of the memory block size through a clustering algorithm, and use it to analyze the memory block size in the memory pool configuration; optionally, the process of analyzing the memory block size in the memory pool configuration is to analyze the memory request distribution in the memory operation data, identify the most frequently used memory block size interval, and design a reasonable memory block size sequence according to the analysis results; optionally, the statistical indicators include the minimum value, maximum value, average value, median and ninety-fifth quantile of the memory block size; optionally, the clustering algorithm is a K-means clustering algorithm;
[0070] Memory block quantity analysis step S22: construct and traverse the time series event list, count the concurrent number of memory blocks according to the time series moment and record the maximum concurrent number and the average concurrent number, analyze the usage frequency of the memory blocks, and use it to analyze the number of memory blocks in the memory pool configuration; optionally, the process of analyzing the number of memory blocks in the memory pool configuration is to allocate based on the total memory capacity limit, allocate more blocks for the high-frequency used size, and reserve an appropriate amount of space to handle burst requests; optionally, the time series event list includes all memory allocation events and memory release events;
[0071] Timing feature analysis step S23: Calculate the life cycle of the memory block and identify whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training; optionally, the life cycle is obtained by subtracting the allocation number from the release number.
[0072] Combined with Figure 3 As shown, the configuration strategy generation step S3 is specifically as follows:
[0073] Decoding step S31: defining a solution as a set of memory pool configurations, wherein a set of memory pool configurations includes the number of memory pools, and any memory pool configuration includes a memory block size, a memory block number, and a memory block category, and the memory pools are sorted in order of memory block size; optionally, the memory pools are sorted in order of increasing memory block size;
[0074] Initial population generation step S32: clustering based on memory block size, number of memory blocks and memory block category and generating basic solutions, generating heuristic solutions according to statistical information, randomly generating supplementary solutions, and obtaining initial populations according to basic solutions, heuristic solutions and supplementary solutions; optionally, the initial population size is set to 50 solutions to ensure genetic diversity; optionally, the clustering process is clustering by K-means clustering algorithm; optionally, randomly generating supplementary solutions within a reasonable range;
[0075] Configuration optimization step S33: Calculate a fitness score, perform selection operations, crossover operations and mutation operations based on the fitness score, and when the iterative optimization reaches a preset number of iterations, obtain the final evolutionary population, and decode the final evolutionary population to obtain the memory pool configuration of the optimal solution; optionally, the termination condition of the iterative optimization also includes when the performance of the solution meets the target requirements.
[0076] The configuration optimization step S33 is specifically as follows:
[0077] The fitness score is calculated based on the weighted performance indicators, which include memory utilization, memory waste rate, and allocation success rate. Optionally, memory utilization is the ratio of the number of used memory blocks to the total number of memory blocks, which is used to evaluate the efficiency of memory space usage; memory waste rate is the difference between the allocation size and the actual used size; allocation success rate is the ratio of the number of successful allocations to the total number of allocations, which is used to measure whether the solution can meet the memory request requirements;
[0078] The selection operation is specifically to select the target solution in the initial population as the evolution population according to the fitness score through the elite retention strategy; optionally, the target solution is the first 10 solutions retained by the elite retention strategy;
[0079] The crossover operation specifically involves exchanging parameters between memory pools at the same position and adjusting the memory pool parameters; optionally, the process of adjusting the memory pool parameters involves making a small range adjustment to the memory block size and dynamically adjusting the number of blocks of different sizes to ensure that the total memory constraint is met after the adjustment; optionally, the orderliness of the memory pool size is maintained while exchanging the parameters;
[0080] The mutation operation specifically balances the memory pool parameters by adaptively varying the mutation rate to obtain the final evolutionary population.
[0081] To further verify which solutions are optimal, the complete memory allocation and release process is reproduced through timing simulation, the usage status of each memory pool is tracked, allocation failures are recorded, and memory utilization is calculated in real time to verify whether the total memory usage exceeds the limit, check whether the memory pool size covers all requirements, evaluate whether the number of memory pools is reasonable, and analyze the stability of long-term operation, so as to ensure the feasibility of the optimization results in practical applications.
[0082] Combined with Figure 4 As shown, some embodiments of the present invention further provide a memory pool configuration system based on machine learning, including:
[0083] Memory operation data acquisition module 1: obtains the memory operation data of the artificial intelligence training program through the memory interceptor;
[0084] Memory allocation analysis module 2: Perform statistical analysis, timing analysis of operation events, and timing feature analysis based on memory operation data to obtain memory block size, number of memory blocks, and memory block category;
[0085] Configuration strategy generation module 3: Use memory block size, number of memory blocks and memory block category to represent the memory allocation mode of artificial intelligence training, generate an initial population based on the memory block size, number of memory blocks and memory block category, and evolve to obtain the final evolved population, and obtain the optimal solution memory pool configuration based on the final evolved population.
[0086] Among them, the memory operation data acquisition module 1 includes:
[0087] The memory interceptor obtains memory operation data by overloading memory allocation function and memory release function. The memory operation data includes memory block size, allocation sequence number, and release sequence number.
[0088] Among them, the memory allocation analysis module 2 includes:
[0089] Memory block size analysis unit: analyzes the value of the memory block size based on preset statistical indicators to obtain statistical information, identifies the category of the memory block size through a clustering algorithm, and is used to analyze the memory block size in the memory pool configuration;
[0090] Memory block quantity analysis unit: builds and traverses the time series event list, counts the concurrent number of memory blocks according to the time series moment and records the maximum concurrent number and the average concurrent number, analyzes the usage frequency of memory blocks, and is used to analyze the number of memory blocks in the memory pool configuration;
[0091] Timing feature analysis unit: calculates the life cycle of memory blocks and identifies whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training.
[0092] Among them, the configuration strategy generation module 3 is specifically:
[0093] Decoding unit: defines a solution as a set of memory pool configurations. A set of memory pool configurations includes the number of memory pools. Any memory pool configuration includes the size of memory blocks, the number of memory blocks, and the type of memory blocks. The memory pools are sorted in the order of the memory block size.
[0094] Initial population generation unit: clustering and generating basic solutions based on memory block size, number of memory blocks and memory block category, generating heuristic solutions based on statistical information, randomly generating supplementary solutions, and obtaining the initial population based on the basic solutions, heuristic solutions and supplementary solutions;
[0095] Configuration optimization unit: calculates a fitness score, performs selection operations, crossover operations and mutation operations based on the fitness score, and obtains the final evolutionary population when the iterative optimization reaches a preset number of iterations. The final evolutionary population is decoded to obtain the optimal solution memory pool configuration.
[0096] Among them, the configuration optimization units are specifically as follows:
[0097] The fitness score is calculated based on the weighted performance indicators, which include memory utilization, memory waste rate, and allocation success rate;
[0098] The selection operation is specifically to select the target solution in the initial population as the evolutionary population according to the fitness score through an elite retention strategy;
[0099] The crossover operation specifically involves exchanging parameters between memory pools at the same location and adjusting the memory pool parameters;
[0100] The mutation operation specifically balances the memory pool parameters through an adaptive mutation rate to obtain the final evolutionary population.
[0101] It should be noted that the above is a reference method for configuring a memory pool based on machine learning and a system, and the present invention is not limited thereto.
[0102] The embodiments of the present invention realize automatic optimization of the number, size and category of memory pools by analyzing the memory allocation pattern of artificial intelligence training, so as to reduce memory management overhead, improve memory utilization, reduce memory fragmentation, and realize adaptive optimization of memory pool configuration. This solves the technical problem that the prior art does not consider the similarity of memory usage pattern of each iteration in scenarios such as artificial intelligence training, and reasonably configures the memory pool according to the similar characteristics of this pattern, resulting in difficulty in optimizing memory pool configuration parameters and lack of adaptive optimization mechanism.
[0103] Finally, it should be noted that: the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0104] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.
Claims
1. A memory pool configuration method based on machine learning, characterized in that: The steps include: Memory operation data acquisition step: obtain the memory operation data of the artificial intelligence training program through the memory interceptor; Memory allocation analysis step: performing statistical analysis, timing analysis of operation events, and timing feature analysis based on the memory operation data to obtain the size of memory blocks, the number of memory blocks, and the type of memory blocks; Configuration strategy generation step: using the memory block size, the number of memory blocks and the memory block category to represent the memory allocation mode of artificial intelligence training, generating an initial population based on the memory block size, the number of memory blocks and the memory block category, and evolving to obtain a final evolved population, and obtaining an optimal solution memory pool configuration according to the final evolved population; Wherein, the memory operation data acquisition step includes: The memory interceptor obtains the memory operation data by overloading the memory allocation function and the memory release function, and the memory operation data includes the memory block size, the allocation sequence number, and the release sequence number; Wherein, the memory allocation analysis step includes: Memory block size analysis step: analyzing the value of the memory block size based on preset statistical indicators to obtain statistical information, identifying the category of the memory block size through a clustering algorithm, and using it to analyze the memory block size in the memory pool configuration; Memory block quantity analysis steps: Build and traverse the time series event list, count the concurrent number of memory blocks according to the time series moment and record the maximum concurrent number and average concurrent number, analyze the usage frequency of memory blocks, and use it to analyze the number of memory blocks in the memory pool configuration; Timing feature analysis steps: Calculate the life cycle of the memory block and identify whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training; The configuration strategy generation step is specifically as follows: Decoding step: defining a solution as a set of memory pool configurations, wherein the set of memory pool configurations includes the number of memory pools, and any memory pool configuration includes a memory block size, a memory block number, and a memory block category, and the memory pools are sorted in order of memory block size; Initial population generation step: clustering and generating a basic solution based on the memory block size, the number of memory blocks and the memory block category, generating a heuristic solution according to the statistical information, randomly generating a supplementary solution, and obtaining an initial population according to the basic solution, the heuristic solution and the supplementary solution; Configuration optimization step: calculate a fitness score, perform selection operation, crossover operation and mutation operation based on the fitness score, and when the iterative optimization reaches a preset number of iterations, obtain the final evolution population, and decode the final evolution population to obtain the optimal solution memory pool configuration.
2. The memory pool configuration method based on machine learning according to claim 1, characterized in that: The configuration optimization steps are specifically as follows: The fitness score is calculated based on weighted performance indicators, where the performance indicators include memory utilization, memory waste rate, and allocation success rate.
3. The memory pool configuration method based on machine learning according to claim 1, characterized in that: The configuration optimization steps are specifically as follows: The selection operation is specifically to select the target solution in the initial population as the evolutionary population according to the fitness score through an elite retention strategy; The crossover operation specifically involves exchanging parameters between memory pools at the same position and adjusting the memory pool parameters; The mutation operation specifically balances the memory pool parameters through an adaptive mutation rate to obtain a final evolutionary population.
4. A memory pool configuration system based on machine learning, characterized in that: include: Memory operation data acquisition module: obtains the memory operation data of the AI training program through the memory interceptor; Memory allocation analysis module: performs statistical analysis, timing analysis of operation events, and timing feature analysis based on the memory operation data to obtain the size of memory blocks, the number of memory blocks, and the type of memory blocks; Configuration strategy generation module: using the memory block size, the number of memory blocks and the memory block category to represent the memory allocation mode of artificial intelligence training, generating an initial population based on the memory block size, the number of memory blocks and the memory block category, and performing evolution to obtain a final evolved population, and obtaining the optimal solution memory pool configuration according to the final evolved population; Wherein, the memory operation data acquisition module includes: The memory interceptor obtains the memory operation data by overloading the memory allocation function and the memory release function, and the memory operation data includes the memory block size, the allocation sequence number, and the release sequence number; Among them, the memory allocation analysis module includes: A memory block size analysis unit: analyzing the value of the memory block size based on preset statistical indicators to obtain statistical information, identifying the category of the memory block size through a clustering algorithm, and used for analyzing the memory block size in the memory pool configuration; Memory block quantity analysis unit: builds and traverses the time series event list, counts the concurrent number of memory blocks according to the time series moment and records the maximum concurrent number and the average concurrent number, analyzes the usage frequency of memory blocks, and is used to analyze the number of memory blocks in the memory pool configuration; Timing feature analysis unit: calculates the life cycle of memory blocks and identifies whether the memory block category is long-term holding, which is used to analyze the memory allocation pattern of artificial intelligence training; The configuration strategy generation module is specifically: Decoding unit: defining a solution as a set of memory pool configurations, wherein the set of memory pool configurations includes the number of memory pools, and any memory pool configuration includes a memory block size, a memory block number, and a memory block category, and the memory pools are sorted in order of memory block size; An initial population generating unit: clustering and generating a basic solution based on the memory block size, the number of memory blocks and the memory block category, generating a heuristic solution according to the statistical information, randomly generating a supplementary solution, and obtaining an initial population according to the basic solution, the heuristic solution and the supplementary solution; Configuration optimization unit: calculates a fitness score, performs selection operation, crossover operation and mutation operation based on the fitness score, obtains the final evolution population when the iterative optimization reaches a preset number of iterations, and decodes the final evolution population to obtain the memory pool configuration of the optimal solution.
Citation Information
Patent Citations
Memory management method and system adopting analysis-feedback-tuning mode
CN106547617A
Method, system and equipment for optimizing energy consumption of server and storage medium
CN116627241A