Operating system kernel parameter tuning system and method for deep learning tasks
By constructing an operating system kernel parameter tuning system for deep learning tasks and using a large language model to intelligently explore the optimal configuration, the problem of improper resource allocation in traditional operating systems for deep learning tasks is solved. This achieves efficient and dynamic kernel parameter optimization, improving the running efficiency and resource utilization of deep learning tasks.
Patent Information
- Application Number
- CN202511111940.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2026-07-21
- Estimated Expiration
- 2045-08-08
AI Technical Summary
Traditional operating systems struggle to accurately adapt to resource requirements in deep learning tasks, leading to performance bottlenecks and resource waste. Existing kernel parameter optimization schemes rely on human experience and cannot dynamically adapt to different model or task characteristics.
By constructing an operating system kernel parameter tuning system for deep learning tasks, a large language model (LLM) is used as an agent to perform intelligent exploration based on a structured training dataset, generate the optimal kernel parameter configuration, and perform automated tuning by combining a virtual machine and dataset preparation module.
It improves the efficiency of deep learning tasks, reduces resource consumption and training time, enables dynamic adaptation to different model architectures and task characteristics, simplifies the tuning process, and improves accuracy and efficiency.
Smart Images

Figure CN121092223B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of operating system parameter optimization technology, and also to the field of deep learning acceleration technology, and particularly to an operating system kernel parameter tuning system and method for deep learning tasks. Background Technology
[0002] With the breakthroughs achieved by deep learning in various fields such as artificial intelligence, computer vision, and natural language processing, the training scale and complexity of deep learning models continue to grow. Deep neural network (DNN) tasks typically require substantial computing resources, relying on high-performance computing (HPC) clusters, distributed computing frameworks, and dedicated hardware (such as GPUs and TPUs). However, as the scale of deep neural networks expands, computational efficiency, resource utilization, and training time have become core bottlenecks restricting the further development of deep learning models.
[0003] To address these issues, researchers have proposed various methods, including hardware acceleration, parallel computing, and distributed optimization, to improve training efficiency. However, research on resource scheduling and management for deep learning tasks at the operating system (OS) level remains insufficient. Due to the high concurrency, high bandwidth requirements, and high data throughput of deep learning tasks, traditional operating system scheduling algorithms and kernel parameter configurations struggle to fully match their resource demands. During deep learning training, large-scale tensor operations and frequent data I / O operations (such as batch training in image classification and sequence unrolling in language model training) involve significant memory page scheduling and context switching. For example, an improperly configured dirty page ratio threshold (vm.dirty_ratio parameter) can lead to data loading blockage due to the inability of page caches to be written back to disk in a timely manner; an improperly set task migration latency threshold (sched_migration_cost_ns parameter) can cause threads to migrate frequently between different cores, increasing context switching overhead and resulting in severe training task jitter and a significant decrease in GPU utilization. Furthermore, default network buffer parameters, such as the maximum receive socket buffer size (net.core.rmem_max), often fail to meet the demands of high-speed data transmission, thus impacting data prefetching efficiency and model communication performance. Traditional kernel parameter configuration methods, which rely on manual experience, suffer from limitations such as long tuning cycles, complex processes, and difficulty in dynamically adapting to different model or task requirements. Therefore, there is an urgent need for a technical solution that can automate and intelligently optimize kernel parameters based on the characteristics of deep learning tasks and the hardware environment.
[0004] To address this gap, this invention proposes an operating system kernel parameter tuning system and method for deep learning tasks. By analyzing the parameters in the operating system kernel that significantly impact deep learning tasks and their value ranges, a dedicated parameter search space is constructed, and a small dataset containing the performance of various deep learning tasks under different parameter configurations is established. This dataset is then used to fine-tune an open-source large language model, enabling the model to grasp the correlation between kernel parameters and task performance. Finally, the large language model (LLM) is used as an agent, leveraging its decision-making capabilities to explore the optimal kernel parameter configuration, thereby improving the efficiency of deep learning task execution and reducing resource waste and training time.
[0005] Considering the unique requirements of resource management and system optimization for deep learning tasks, traditional fixed-configuration kernel parameters are no longer sufficient to meet their complex needs. By deeply studying the impact of operating system kernel parameters on the performance of deep learning tasks and combining this with the decision-making capabilities of modern deep learning models, more efficient optimization strategies can be developed. In particular, the method of fine-tuning a large language model with a small dataset achieves precise tuning of operating system kernel parameters, thereby significantly improving deep learning training efficiency and reducing resource consumption.
[0006] CN117032955A discloses an operating system kernel parameter adjustment method, system, device, and medium. The method includes: selecting operating system kernel parameters and obtaining an operating system performance score based on the kernel parameters; adjusting the operating system kernel parameters based on preset kernel parameter adjustment rules; the kernel parameter adjustment rules include: adjusting the kernel parameters within a parameter setting range based on a first iteration direction and a preset step size; obtaining a first performance score of the operating system and the performance score difference between the adjusted kernel parameters and the first performance score; if the performance score difference is negative, updating the first performance score to the performance score, and repeatedly executing the kernel parameter adjustment rules until the performance score difference is positive.
[0007] This technical solution is essentially based on the linear assumption of the relationship between operating system parameters and performance, failing to consider the nonlinear system response characteristics unique to deep learning tasks. The preset parameter adjustment direction of this solution has a monotonic correlation with performance improvement, which contradicts the dynamic nature of parameter sensitivity changes in deep learning workloads. Specifically, when parameter configurations exceed critical thresholds, memory contention or processor scheduling conflicts may occur, and a fixed-step parameter adjustment mechanism struggles to effectively identify such nonlinear inflection points. Furthermore, the method for determining the preset "parameter setting range" relies on human experience and lacks systematic verification, potentially leading to the omission of key parameters or an excessive number of redundant parameters. Moreover, the performance score difference-based judgment mechanism of this solution is prone to premature convergence—when the performance score difference approaches the evaluation error threshold (typically ±3%), the stopping condition of this mechanism may prematurely terminate the effective optimization process.
[0008] Therefore, this invention proposes an operating system kernel parameter tuning system and method for deep learning tasks. First, it analyzes the parameters in the operating system kernel that significantly affect deep learning tasks and their value ranges, constructing an operating system kernel parameter search space for deep learning tasks. Based on this, a performance dataset containing various deep learning tasks under different parameter configurations is constructed through testing. Then, a Large Language Model (LLM) is used to fine-tune this dataset, enabling the model to understand the mapping relationship between kernel parameters and deep learning performance. Finally, the LLM is used as an agent, leveraging its decision-making capabilities to intelligently explore the parameter space and identify the optimal kernel parameter configuration, thereby improving the running efficiency of deep learning tasks, reducing resource consumption, and shortening training time.
[0009] Furthermore, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making this invention, but due to space limitations, not all details and contents were listed in detail. However, this does not mean that the present invention does not possess the features of these prior art. On the contrary, the present invention already possesses all the features of the prior art, and the applicant reserves the right to add relevant prior art to the background art. Summary of the Invention
[0010] Given the unique system resource requirements of deep learning tasks, such as significantly increased concurrency, bandwidth demands, and data throughput, traditional operating systems often struggle to accurately adapt their scheduling mechanisms and kernel parameter settings to these demands. During model training, the system frequently performs large-scale tensor computations accompanied by high-frequency input / output operations—for example, using batch training in image recognition tasks or performing long sequence processing during language model training. This typically involves complex memory page management and context switching operations.
[0011] Performance bottlenecks may occur when key parameters are not optimized specifically for the system. For example, an improperly configured dirty page ratio threshold (vm.dirty_ratio parameter) may prevent page cache data from being persisted to storage devices in a timely manner, leading to data loading delays. Similarly, an unreasonable task migration delay threshold (sched_migration_cost_ns parameter) can trigger abnormal migration of threads between different CPU cores, increasing context switching overhead and ultimately causing significant jitter in the training task and a substantial reduction in GPU utilization. Furthermore, default network transport layer configurations (such as the maximum receive socket buffer size net.core.rmem_max) are often insufficient to support the high-speed data stream transmission requirements during training, which will directly affect data prefetching efficiency and node communication performance in distributed training.
[0012] Current mainstream kernel parameter optimization schemes still rely on manual experience and judgment. Not only is the tuning process complex and time-consuming, but it also cannot achieve dynamic adaptation to different model architectures or task characteristics. This static configuration method has become a key bottleneck restricting the performance optimization of deep learning at the system level.
[0013] To address the shortcomings of existing technologies, this invention provides, from a first aspect, an operating system kernel parameter tuning system for deep learning tasks. The system includes a first server and a second server. The first server includes a virtual machine, a parameter filtering module, a dataset preparation module, a tuning instruction generation module, and a shell generation and execution module.
[0014] The virtual machine performs application configuration and model training based on different deep learning models and configuration execution lists, while updating the result logs. The parameter filtering module filters system parameters that have a significant impact on performance based on the performance changes during the adjustment process of each parameter and obtains the filtered result logs, which are then sent to the dataset processing module. The dataset processing module summarizes the result logs and forms a kernel parameter search space and a structured training dataset for fine-tuning the large language model. The tuning instruction generation module generates tuning instructions based on the kernel parameter search space and sends them to the second server. The shell generation and execution module receives recommended configuration files from the second server, organizes them into an executable configuration execution list, and sends it to the virtual machine. The LoRA fine-tuning module in the second server adjusts the large language model based on the structured training dataset. The adjusted large language model acts as an agent and generates a new round of recommended configuration files based on the tuning instructions. The second server then sends the recommended configuration files to the shell generation and execution module.
[0015] The technical solution of the present invention can bring the following advantages:
[0016] First, by validating and optimizing different deep learning models and configurations using virtual machines, the system generates detailed runtime logs, providing data support for subsequent parameter selection. The parameter selection module can filter out system parameters that significantly impact performance based on the performance changes during parameter adjustments, resulting in filtered logs and a kernel parameter search space. This not only simplifies the complex process of manual judgment but also improves the efficiency and accuracy of optimization.
[0017] Secondly, the dataset processing module aggregates the result logs and forms a structured training dataset, providing a training basis for the LoRA fine-tuning module in the second server. This enables the system to adjust the large language model based on the structured training dataset, forming a new round of recommendation configuration files. In this way, the system can achieve dynamic adaptation to different model architectures or task characteristics, avoiding the bottlenecks caused by static configuration methods.
[0018] Finally, the tuning instruction generation module generates tuning instructions based on the result logs and sends them to the second server. The recommended configuration file sent by the second server is compiled into an executable configuration execution list and sent to the virtual machine for application configuration and model training. This dynamic adjustment mechanism can optimize system parameters in real time, ensuring that deep learning tasks can fully utilize system resources during the training phase, reducing performance bottlenecks, improving the utilization rate of the processor (GPU) and data prefetching efficiency in the second server, thereby significantly improving overall performance.
[0019] According to a preferred embodiment, in the initial stage, the virtual machine calculates the degree of influence of key parameters in the operating system kernel parameters on the performance of deep learning tasks, and adjusts the key parameters and their value ranges based on the degree of influence.
[0020] This invention determines which parameters have the greatest impact on the performance of deep learning tasks by calculating the degree of influence of key parameters. These parameters are typically the most important parameters in system resource scheduling and data processing. By adjusting the key parameters and their value ranges based on the degree of influence, this invention ensures that the adjustments are targeted, avoiding unnecessary optimization of unimportant parameters, thereby improving efficiency.
[0021] According to a preferred embodiment, the second server further includes a LoRA fine-tuning module for fine-tuning the large language model based on a structured training dataset. The processing steps of the LoRA fine-tuning module include: normalizing the text of the structured training dataset to convert it into a fixed-length vector representation; inserting a low-rank trainable matrix into the attention layer of the large language model to reduce the number of parameter updates; fine-tuning the training parameters of the large language model and training the low-rank trainable matrix; mounting the low-rank trainable matrix and running the fine-tuned large language model as an agent.
[0022] These steps ensure that the model maintains high performance while more efficiently updating parameters and adapting to new task requirements. Normalized encoding ensures the consistency and standardization of input data, facilitating subsequent model training and parameter updates. Inserting a low-rank matrix significantly reduces the number of parameter updates, lowering model complexity and computational cost. Fine-tuning training parameters and the low-rank matrix further optimizes model performance. Ultimately, attaching the low-rank matrix allows the fine-tuned large language model to adapt more quickly to new tasks and data, improving overall performance and flexibility.
[0023] According to a preferred embodiment, the steps of the tuning instruction generation module in generating tuning instructions include: formatting the kernel parameter fields in the built-in kernel parameter search space into text based on a preset parameter description template; and simultaneously extracting the CPU, memory, operating system, model, task, dataset fields and default training duration from the input command line parameters, and integrating these data into a semantically clear task context.
[0024] The steps described above, including receiving command-line arguments and result logs and extracting key fields, ensure that the tuning instruction generation module accurately obtains the necessary parameter information and performance data. Calling built-in parameter templates and structuring adjustable kernel parameters into natural language text improves the accuracy and readability of the generated instructions. Formatting model information, dataset information, training task type, hardware environment configuration, and training duration into a contextual description provides comprehensive contextual information, helping the system better understand the current operating environment and requirements, thereby generating more appropriate tuning instructions.
[0025] According to a preferred embodiment, the large language model generates a recommended configuration file based on the received tuning instructions and sends it to the shell generation and execution module in the first server, so that the shell generation and execution module generates a configuration execution list.
[0026] In this invention, the recommended configuration files generated by the large language model based on tuning instructions ensure greater accuracy and suitability, reducing the possibility of human error. The shell generation and execution module automatically generates the configuration execution list, reducing the tedious manual configuration process and improving configuration efficiency and consistency. The large language model can generate corresponding recommended configuration files based on different tuning instructions, enhancing the system's flexibility and adaptability, and better handling various application scenarios. The automatically generated configuration execution list can be directly executed by the shell generation and execution module, reducing intermediate steps and improving execution efficiency.
[0027] According to a preferred implementation, the large language model calculates the adaptation index of the configuration execution list in each round of configuration;
[0028]
[0029] ΔT=T baseline -T i ;
[0030] Among them, T baseline This indicates the training duration of the deep learning task under the default configuration; i represents the training epoch; T represents the training time. i T represents the training duration corresponding to the recommended configuration file in the i-th round; i-1 Indicates the training duration corresponding to the recommended configuration in the previous round; ΔT i ΔT represents the training time difference between two rounds; ΔT represents each round relative to T. baseline The training time difference.
[0031] In this invention, by incorporating detailed task description information, deep learning task information, and a kernel parameter search space, the large language model can more accurately understand task requirements and generate a more suitable configuration execution list. The large language model calculates the fit index for each round of configuration, quantitatively evaluating the degree of matching between the configuration execution list and task requirements, thereby ensuring the optimization effect of the configuration. The setting of the kernel parameter search space allows the large language model to explore more parameter combinations, enhancing the system's flexibility and adaptability, and better handling complex and ever-changing task requirements. By quantitatively evaluating the fit index, the large language model can more efficiently select the optimal configuration, reducing unnecessary configuration attempts and improving optimization efficiency.
[0032] According to a preferred implementation, after the training task is completed, the virtual machine sends the result log and system configuration result log parameter file to the tuning instruction generation module; the tuning instruction generation module generates a new round of tuning instructions until the conditions are met.
[0033] This invention provides, from a second aspect, a method for operating system kernel parameter tuning for deep learning tasks. The method includes: configuring applications and training models based on different deep learning models and configuration execution lists, while simultaneously updating result logs; filtering system parameters that significantly impact performance based on the performance changes during the adjustment process of each parameter and obtaining the filtered result logs; summarizing the result logs to form a kernel parameter search space and a structured training dataset for fine-tuning a large language model; generating tuning instructions based on the kernel parameter search space; organizing recommended configuration files into an executable configuration execution list; adjusting the large language model based on the structured training dataset, with the adjusted large language model acting as an agent to generate a new round of recommended configuration files based on the tuning instructions.
[0034] This method utilizes testing based on different deep learning models and configuration execution lists for verification and optimization. This systematically collects runtime logs, ensuring the comprehensiveness and accuracy of the optimization process. By filtering system parameters with significant performance impact based on the performance changes during parameter adjustments, a filtered result log and kernel parameter search space are obtained, effectively reducing unnecessary parameter adjustments and improving optimization efficiency. The result logs are aggregated to form a structured training dataset for fine-tuning the large language model, ensuring the quality and diversity of training data, thereby improving the generalization ability and optimization effect of the large language model. Optimization instructions are generated based on the result logs, ensuring their accuracy and relevance, avoiding random or unreasonable configuration schemes, and improving the scientific nature and effectiveness of optimization. Based on the received optimization instructions, recommended configuration files are compiled into an executable configuration execution list and sent to the virtual machine for application configuration and model training, achieving automated configuration, reducing manual intervention, and improving configuration efficiency and consistency. The result logs are updated, and the large language model is adjusted based on the structured training dataset. The adjusted large language model, acting as an agent, generates a new round of recommended configuration files based on the optimization instructions, achieving continuous optimization and iteration, ensuring the system can continuously adapt to new task requirements and environmental changes.
[0035] According to a preferred embodiment, the method further includes: calculating the degree of influence of key parameters in the operating system kernel parameters on the performance of deep learning tasks, and adjusting the key parameters and their value ranges based on the degree of influence; and generating a kernel parameter search space based on the adjusted key parameters and their value ranges.
[0036] This method accurately identifies parameters that significantly impact performance by calculating the degree of influence of key parameters on deep learning task performance. This targeted adjustment avoids unnecessary optimization of unimportant parameters, thus improving the efficiency and effectiveness of tuning. By adjusting key parameters and their value ranges based on the degree of influence, this method effectively narrows the kernel parameter search space. This not only reduces the complexity of parameter search but also improves search efficiency, making the parameter optimization process more efficient. By adjusting key parameters and their value ranges, system performance can be optimized more precisely. This optimization not only improves the speed and efficiency of model training but also enhances the model's training effect and generalization ability.
[0037] According to a preferred embodiment, the method further includes: fine-tuning a large language model based on a structured training dataset, and normalizing the text in the structured training dataset to convert it into a fixed-length vector representation. This step simplifies the data processing process and improves its efficiency and consistency. Normalizing the structured training dataset better captures key information in the text, enabling the large language model to have stronger generalization ability when processing different types of text. Converting the structured training dataset into a fixed-length vector representation makes the model training process more efficient and reduces the time and complexity of data preprocessing.
[0038] Inserting low-rank trainable matrices into the attention layer of a large language model reduces the number of parameter updates, thereby lowering model complexity and computational cost. This reduction in parameters improves the training speed and efficiency of the large language model, particularly on large datasets, where this optimization significantly shortens training time. The reduced parameter count also lowers the model's storage requirements, making it more lightweight and suitable for deployment in resource-constrained environments.
[0039] The training parameters of a large language model are fine-tuned, and a low-rank trainable matrix is trained. This low-rank trainable matrix is then attached, and the fine-tuned large language model is run as an agent. Attaching the low-rank trainable matrix allows the agent to dynamically adjust parameters according to task requirements, improving its flexibility and adaptability. By fine-tuning and attaching the low-rank trainable matrix, the agent can better handle complex tasks, improving its performance and effectiveness in practical applications. Attached Figure Description
[0040] Figure 1 This is a simplified schematic diagram of the module connection relationship of the operating system kernel parameter tuning system provided by the present invention;
[0041] Figure 2 This is a schematic diagram of the physical environment and virtual machine configuration of the first server provided by the present invention;
[0042] Figure 3 This is a complete flowchart of the result log generation process provided by the present invention;
[0043] Figure 4 This is an example diagram illustrating the structured training dataset used for fine-tuning large language models and the dataset structure provided by this invention.
[0044] Figure 5 This is a schematic diagram of the tuning instructions provided by the present invention;
[0045] Figure 6 This is a flowchart of the intelligent agent guiding the iterative optimization of operating system kernel parameters provided by the present invention;
[0046] Figure 7 This is a schematic diagram of the entire process of the operating system kernel parameter tuning system provided by the present invention;
[0047] Figure 8 This is a schematic diagram of the control logic of the operating system kernel parameter tuning system provided by the present invention.
[0048] List of reference numerals
[0049] 100: First server; 110: Virtual machine; 120: Data set organization module; 130: Tuning instruction generation module; 140: Shell generation and execution module; 150: Parameter filtering module; 200: Second server; 210: LoRA fine-tuning module; 220: Large language model. Detailed Implementation
[0050] The following is a detailed explanation with reference to the accompanying drawings.
[0051] The following is an explanation of some of the terms and concepts in this invention.
[0052] DeepSeek is an open-source Large Language Model (LLM) 220. In this invention, DeepSeek is used as an agent after being fine-tuned.
[0053] The tuning prompt is a task description input to the large language model 220, typically passed to the model in natural language or a structured format to trigger its response generation. In this invention, the tuning prompt includes the specific requirements of the deep learning task, dataset information, server hardware configuration, and the relevant kernel parameter search space. By parsing the information in the tuning prompt and combining historical performance data with task characteristics, the large language model 220 generates optimal kernel parameter configuration suggestions, thereby automatically optimizing the operating system kernel parameters and improving the execution efficiency of the deep learning task.
[0054] JSONL (JSON Lines): A lightweight data storage format based on JSON. Unlike traditional JSON, JSONL allows multiple JSON objects to be stored line by line, with each line capable of being read and parsed independently.
[0055] Virtual Machine (VM) 110: A virtual machine is a specific running instance created by kernel-based virtualization technology. Essentially, it is a logical computing unit containing a complete virtual hardware environment. Each VM 110 has independent virtual CPU, memory, disk, and network interface card resources, and runs a complete operating system (such as Ubuntu or CentOS). VMs 110 can be dynamically created, configured, migrated, or destroyed using management tools such as Libvirt. For example, in the OpenStack cloud computing platform, KVM technology on a single physical server can pool hardware resources, thereby simultaneously supporting dozens of VMs 110 running different business workloads. These VMs 110 are strictly isolated from each other through a hypervisor, ensuring that even if one VM 110 fails, it will not affect the normal operation of other instances.
[0056] The dataset is structured using a standardized JSONL (JSON Lines) format to ensure ease of storage, retrieval, and processing. Each record represents a test result and details the following key information:
[0057] (1) Kernel parameter configuration (sysctl): Each record contains a description (desc), data type (dtype), and value (value) of a kernel parameter, explicitly indicating the parameters involved in each test and their specific values. These parameters reflect the core scheduling and resource management settings in the test environment.
[0058] (2) Virtual machine 110 environment configuration: Record the configuration settings of a virtual machine 110 on the first server 100, including operating system type (os-type), number of virtual CPU cores (vcpus), virtual memory size (mem), etc.
[0059] (3) Deep Learning Model (DL Model): To ensure the dataset covers diverse application scenarios, each record also includes a detailed description of the deep learning task, such as: task type (Area): such as image classification, natural language processing, etc.; model used (model_name): such as ResNet50, Transformer, etc.; dataset name (dataset_name): such as CIFAR-10, ImageNet. This information clearly labels the testing context, facilitating the correlation between model learning tasks.
[0060] (4) Performance metrics (total_train_time): Each record details the total training time for the test performance metrics. This provides a quantitative basis for evaluating the quality of kernel parameter configurations.
[0061] Deep learning tasks, characterized by high concurrency, large data transmission bandwidth requirements, and massive data throughput, make it difficult for traditional operating systems to effectively support their operational needs in terms of scheduling strategies and kernel parameter configurations. During model training, large-scale tensor operations and high-frequency data I / O operations (such as batch processing in image recognition and sequence unrolling in natural language processing) frequently trigger memory page management and thread context switching mechanisms. For example, in a typical scenario, if the virtual memory dirty page ratio threshold (the `vm.dirty_ratio` parameter) is not scientifically calibrated, page cache data may not be persisted in a timely manner, causing data loading blockage. Conversely, an unreasonable task migration cost threshold (the `sched_migration_cost_ns` parameter) can cause abnormal thread migration between CPU cores, increasing context switching overhead and causing significant jitter in the training task, ultimately resulting in a significant decrease in GPU computing resource utilization. It is worth noting that default network communication layer parameter configurations (such as the upper limit of the receive buffer defined by `net.core.rmem_max`) often fail to meet the requirements of high-speed data transmission scenarios, directly impacting data prefetching efficiency and the communication performance of distributed models. The current kernel parameter tuning model, which relies on human experience, has inherent drawbacks such as long optimization cycles, high operational complexity, and lack of dynamic adaptability. There is an urgent need to build a kernel parameter optimization system that can adapt and be intelligent based on deep learning task characteristics and hardware environment.
[0062] To address the shortcomings of existing technologies, this invention provides a system and method for optimizing operating system kernel parameters for deep learning tasks. This invention can also provide a storage medium and electronic device for optimizing operating system kernel parameters. Furthermore, this invention can provide a server group for optimizing operating system kernel parameters.
[0063] Example 1
[0064] like Figure 1 As shown, the first server 100 is configured with several virtual machines (VMs) 110, a dataset organization module 120, a tuning instruction generation module 130, a shell generation and execution module 140, and a parameter filtering module 150. The second server 200 is configured with an open-source large language model 220 and a LoRA fine-tuning module 210. The open-source large language model 220 is, for example, the DeepSeek model. The first server 100 and the second server 200 establish a communication connection via wired or wireless means.
[0065] Preferably, the first server 100 includes a multi-core processor, memory, storage, and a network interface. The multi-core processor is used to perform computing tasks. A multi-core processor is a single integrated circuit chip containing multiple processing cores (or kernels). Each processing core can execute instructions independently, thus allowing multiple tasks to be processed in parallel. Multi-core processors improve overall computing efficiency by increasing computing power, accelerating data processing speed, and improving system performance.
[0066] Memory is used for data processing and caching. Memory provides sufficient cache space, making data processing more efficient and reducing the frequency of reading data from the hard drive. As a cache, memory can store frequently accessed data, improving data processing speed.
[0067] Storage devices, such as high-speed SSDs or NVMe SSDs, are used to store large datasets and model files, ensuring fast data read and write speeds. Storage is also used to centrally store large datasets and results logs for easy management and access.
[0068] Network interfaces can be switches and routers, used to establish communication connections and support wired or wireless communication.
[0069] The first server 100 is deployed with a virtual machine cluster consisting of several virtual machines 110, which is mainly used to run and deploy different deep learning models (DL models) and configure execution lists for verification and optimization tests.
[0070] Virtual machine 110 refers to a logical computing environment created on a physical server using virtualization technology. Virtual machine 110 can simulate a complete computer system, including CPU, memory, storage, and network interfaces, thereby allowing multiple independent operating systems and applications to run on a single physical server.
[0071] A virtual machine cluster refers to a collection of multiple virtual machines 110 created on a physical server using virtualization technology. These virtual machines 110 share the resources of the physical server and are connected together via a network to jointly perform specific tasks or services.
[0072] Virtual machine 110 consumes the multi-core processor, memory, storage, and network interface of the first server 100 during runtime. Virtual machine 110 performs application configuration and model training based on different deep learning models and configuration execution manifests, while updating the result logs.
[0073] The parameter filtering module 150 is used to filter system parameters that have a significant impact on performance based on the performance change magnitude of each parameter adjustment process, obtain the filtered result log, and send the filtered result log to the dataset processing module 120.
[0074] Preferably, the parameter filtering module 150 is a program-encoded module that executes specific algorithms and logic, stored in the memory of the first server 100. The operation of the parameter filtering module 150 depends on the processor, memory, storage devices, and network interfaces within the first server 100; these hardware components collectively support the efficient operation and data processing capabilities of the parameter filtering module 150. With the support of this hardware, the parameter filtering module 150 can quickly and accurately complete parameter filtering tasks, ensuring the smooth progress of the system performance optimization process. Alternatively, the parameter filtering module 150 can run independently using a multi-core processor within the first server 100.
[0075] The dataset processing module 120 aggregates the result logs obtained from running each virtual machine 110, constructing a kernel parameter search space and a structured training dataset for fine-tuning the open-source large language model 220. The kernel parameter search space is used by the tuning instruction generation module 130 to generate tuning instructions.
[0076] Preferably, the dataset processing module 120 is stored in the memory of the first server 100 as a coded program module. The operation of the dataset processing module 120 depends on the processor, memory, storage devices, and network interfaces in the first server 100, and these hardware components collectively support the efficient operation and data processing capabilities of the dataset processing module 120. Alternatively, the dataset processing module 120 can operate independently using a multi-core processor in the first server 100.
[0077] After receiving the kernel parameter search space from the dataset preparation module 120, the tuning instruction generation module 130 generates tuning instructions based on the kernel parameter search space and sends the tuning instructions to the fine-tuned large language model 220 on the second server 200. The large language model 220 adjusts performance parameters based on the received tuning instructions to form a recommended configuration file. The large language model 220 sends the recommended configuration file to the shell generation and execution module 140.
[0078] Preferably, the tuning instruction generation module 130 is stored in the memory of the first server 100 as a coded program module. The operation of the tuning instruction generation module 130 depends on the processor, memory, storage devices, and network interfaces in the first server 100, which together support the efficient operation and data processing capabilities of the tuning instruction generation module 130. Alternatively, the tuning instruction generation module 130 can run independently using a multi-core processor in the first server 100.
[0079] After receiving the recommended configuration file from the second server 200, the shell generation and execution module 140 organizes the recommended configuration file into an executable configuration execution list and sends it to the virtual machine 110 for application configuration and model training to update the result log. The virtual machine 110 runs the newly generated result log and sends it to the tuning instruction generation module 130 as input for the next tuning instruction.
[0080] The shell generation and execution module 140 is stored in the memory of the first server 100 as a coded program module. The operation of the shell generation and execution module 140 depends on the processor, memory, storage devices, and network interface in the first server 100; these hardware components collectively support the efficient operation and data processing capabilities of the shell generation and execution module 140. Alternatively, the shell generation and execution module 140 can run independently using a multi-core processor in the first server 100.
[0081] Figure 2 The configuration parameters of the virtual machine 110 of the first server 100 are merely examples used to illustrate the system of the present invention, and are not intended to limit the parameter configuration.
[0082] Preferably, such as Figure 2 As shown, the host machine of the first server 100 is an x86_64 architecture server with 48 CPU cores, specifically a Hygon C86 7360 24-core Processor. The first server 100 creates several virtual machines 110, each with 4 virtual CPU cores (vcpus), 16GB of virtual memory (mem), and 80GB of disk space. The operating system for virtual machine 110 is Ubuntu 20.04. The host machine manages the virtual machine cluster using the virsh (Virtualization Shell) management command and performs file transfers using the scp (Secure Copy Protocol, a secure file transfer protocol based on SSH) transfer command.
[0083] S100: In the initial stage, the virtual machine 110 in the first server 100 calculates the degree of influence of each key parameter on the performance of the deep learning task, and selects the operating system kernel parameters and their value ranges based on the degree of influence.
[0084] Preferably, such as Figure 3 As shown, / proc / sys in virtual machine 110 represents all adjustable operating system kernel parameters manually retrieved to ensure comprehensive coverage of all kernel modules affecting the performance of deep learning tasks. Specifically, these adjustable parameters can be accessed through predefined paths (such as / proc / sys or / etc / sysctl.conf files in Linux systems).
[0085] First, virtual machine 110 receives a list of likely important sys-params from the port of the first server 100. This allows it to obtain information on key operating system kernel parameters that significantly impact task performance, along with their reasonable value ranges, thus ensuring that the selected parameters perform optimally in the actual operating environment. The list of key parameters in the candidate list can be pre-configured by professionals.
[0086] Secondly, virtual machine 110 calculates the impact of each key parameter on the performance of the deep learning task based on a preset test calculation method. Figure 3 Convert the key kernel parameter candidate list file into Figure 3 The .sh script in the file.
[0087] Subsequently, virtual machine 110 initiates the system configuration dynamic injection process: an iterative approach is used, modifying key parameters in the .sh script one by one, changing only one parameter's value at a time while keeping others constant, thus effectively isolating the individual impact of each parameter on the deep learning task's performance. After each round of parameter modification, the .sh script causes virtual machine 110 to execute a standardized deep learning task execution process, as follows: Figure 3 As shown, a pre-defined deep learning model training program (such as ResNet, AlexNet, etc.) is run to perform complete training under a fixed dataset and training epochs.
[0088] During training, the virtual machine 110 records various performance metrics in real time. These metrics include training speed, resource utilization, and model convergence time. All test data is stored in a structured format in the results log, ensuring efficient data processing and comparison for subsequent analysis.
[0089] Preferably, the parameter filtering module 150 in the first server 100 calculates the performance change range of each parameter adjustment process based on the test data in the result log.
[0090] Preferably, the parameter filtering module 150 uses the following formula to filter parameters based on the performance change magnitude:
[0091]
[0092] In the above formula, T baseline This indicates the training duration under the default configuration; T max T represents the maximum training time among all possible values of a parameter; minThis represents the minimum training time among all possible values of a parameter; γ represents the preset judgment threshold, which can be selected from 3% to 5%. Preferably, the preset judgment threshold is 0.05 (i.e., 5%).
[0093] If the performance fluctuation caused by adjusting a certain parameter is greater than or equal to γ, then the parameter is determined to have a significant impact on task performance. If the performance fluctuation caused by adjusting a certain parameter is less than γ, then the parameter screening module 150 determines that the parameter has a minor impact on task performance and can be ignored. Setting the value of γ to 3% to 5% can effectively filter out unimportant minor fluctuations while ensuring that the selected parameters have actual optimization value, thereby improving the accuracy of the parameter screening module 150 and the effectiveness of the subsequent search space. If the preset judgment threshold is too high (e.g., 10%), several parameters with moderate impact potential for combined gain may be missed.
[0094] Taking the vm.page-cluster parameter as an example, the training time for different values of the vm.page-cluster parameter in the AlexNet model is shown in the table below.
[0095] 1 6806.3282 2 6796.7514 3 7002.2371 4 6881.0552 5 6907.3160 6 6706.1914 7 6728.3314 8 6898.8229
[0096] In the table, T baseline = 6800 seconds, T max = 7002.2371 seconds, T min = 6706.1914 seconds, with a performance fluctuation of 4.4%. When γ = 0.05, the vm.page-cluster parameter has a small impact and is not included in the subsequent kernel parameter search space and structured training dataset.
[0097] Therefore, the parameter filtering module 150 filters out all system parameters and corresponding result logs that significantly affect performance, which are then used by the dataset preparation module 120 to construct the kernel parameter search space and structured training dataset. The kernel parameter search space is used by the tuning instruction generation module 130 to generate tuning instructions, specifying the value range of key kernel parameters and the number of iterations. The structured training dataset is used by the LoRA fine-tuning module 210 to perform LoRA fine-tuning on the large language model 220 on the second server 200.
[0098] The above process has clear and executable screening criteria. The parameter screening module 150 will output the set of important parameters as the filtered result log (see...). Figure 3 Furthermore, the key parameters in these filtered result logs typically directly affect system resource scheduling and management. Their value ranges have been verified through testing, ensuring that subsequent optimization processes can focus on the most influential parameters, thereby improving the execution efficiency of deep learning tasks.
[0099] Through the above process, virtual machine 110 can determine a set of operating system kernel parameters (such as vm.dirty_ratio, vm.swappiness, vm.nr_hugepages, etc.) that have a significant impact on the performance of deep learning tasks, and clarify their reasonable tuning value range.
[0100] The output file of parameter filtering module 150 is the filtered result log, such as... Figure 3 As shown.
[0101] The step performed by virtual machine 110 has two important technical effects:
[0102] First, effective compression of parameter space: Through preliminary screening, testing and verification, and indicator evaluation, kernel parameters that have little or no impact on training time or cause significant interference are initially eliminated, which significantly reduces the search space dimension and tuning cost that may be faced during the optimization process of the large language model 220.
[0103] Second, it forms the basis for building high-quality training samples: Because the optimization goal is clear and the parameter range is reasonable, the virtual machine 110 can efficiently collect training samples in subsequent stages, avoiding invalid or misleading configuration inputs, thereby improving the convergence speed and accuracy of the intelligent model's recommendation capabilities.
[0104] Furthermore, this step lays the data foundation for the subsequent closed-loop architecture of "feedback-driven + iterative optimization", enabling the large language model 220 to generate effective configuration suggestions more quickly on the convergence path, thereby improving the actual usability and performance optimization capabilities of the entire system under real training tasks.
[0105] S200: After receiving the filtered result logs, the dataset processing module 120 preprocesses the key parameters, their value ranges, and the running results recorded in the result logs to construct the kernel parameter search space and the structured training dataset. The dataset processing module 120 collects the filtered result logs sent by each virtual machine 110. Here, filtering refers to removing parameter adjustment log records where the performance fluctuation during parameter adjustment is less than γ, while maintaining the log structure unchanged. The dataset processing module 120 performs regular expression extraction on each log entry in the result logs according to a preset log structure template, obtaining the following fields:
[0106] model_name: The name of the deep learning model (e.g., AlexNet);
[0107] dataset_name: The name of the dataset used;
[0108] sys_param: Operating system kernel parameters used in the current test;
[0109] param_value: The value of the operating system kernel parameter used in the current test;
[0110] baseline_time: Training time (in seconds) for the same deep learning model under default configuration;
[0111] train_time: Training duration (seconds) under the current configuration.
[0112] The dataset preparation module 120 constructs a structured training dataset based on the above fields. Specifically,
[0113] The dataset organization module 120 formats the above fields into a standardized JSONL format and adds the following fields based on the extraction of each log.
[0114] Instruction: Inform the large language model 220 of the current task scenario, explain the parameters contained in the structured training dataset, and clarify that the large language model 220 needs to learn the relationship between parameter configuration and performance.
[0115] The `environment` section under `input` describes the operating system, CPU, and memory configuration of virtual machine 110.
[0116] domain: describes the current task scenario.
[0117] By adding fields as described above, each log entry is converted into a standardized JSONL data sample; the specific format can be found here. Figure 4 An example of a structured training dataset is shown. Meanwhile, Figure 4 It also demonstrates the entire process of fine-tuning the large language model 220 on the second server 200, as well as its important configurations and functional modules.
[0118] The instruction describes the task objective: "Given a set of operating system kernel parameters, hardware environment specifications, and the name of a deep learning task along with the dataset used, predict the training time required for that task. Learn the relationship between system configuration and training time." This instruction clarifies the current task scenario, specifies the parameters included in the structured training dataset, and explicitly states that the large language model 220 needs to learn the relationship between parameter configuration and performance.
[0119] The input represents the input, which includes the environment, DL model, and sysctl. It is further subdivided into multiple substructures to convey various types of information required for the task.
[0120] Environment refers to the system environment configuration, which describes the operating system of virtual machine 110, such as os-type (operating system type), vcpus (number of CPU cores), and mem (memory size). These operating system parameters will affect the tuning strategy.
[0121] DL model represents deep learning model information, which describes the data source. Deep learning model information includes Area (domain, such as Vision computer vision), Problem (task, such as image recognition), model_name (model name, such as ResNet), and dataset_name (dataset, such as ImageNet), clearly specifying the scenario for which optimization is being performed.
[0122] Sysctl specifies kernel parameter configuration, describing the parameter's description, type, and possible values. For example, consider `vm.dirty_background_ratio`:
[0123] desc: Parameter description (dirty page percentage related logic), to help understand the function of the parameters;
[0124] dtype: Parameter type (int integer);
[0125] value: The current value of the parameter (e.g., 10) is the "initial condition" or "observation object" for tuning.
[0126] "output" refers to the output, i.e. the result of task execution. In the example, "total_train_time" (total training time, such as 8600 seconds) is the training time of the optimized large language model 220 under the current configuration and other key indicators, reflecting the optimization effect.
[0127] The domain indicates the domain to which the labeled data belongs, which describes the current task scenario. In the example, kernelparameters tuning for DL model is used to help the large language model 220 distinguish task scenarios.
[0128] Preferably, the dataset processing module 120 collects the result logs sent by each virtual machine 110, and constructs a kernel parameter search space based on the summarized result logs and the list of key kernel parameter candidates on a fixed path on the first server 100.
[0129] The specific implementation logic is as follows: record all parameters that have appeared in the result log, compare them with the list of key kernel parameter candidates, and if a parameter in the list of key kernel parameter candidates does not appear in the result log, then remove that parameter from the list of key kernel parameter candidates.
[0130] Through this process, the list of key kernel parameter candidates will become the kernel parameter search space, which includes experimentally verified kernel parameters, value ranges, parameter descriptions, data types, and iteration steps.
[0131] The kernel parameter search space includes, for example, vm.swappiness and vm.dirty_background_ratio.
[0132] {
[0133] "vm.swappiness":{#vm.swappiness is the name of the parameter.}
[0134] "desc": "A larger value indicates that the swap partition is used more actively. A smaller value indicates that the memory is used more actively." The "desc" attribute describes the parameter: a larger value indicates that the system uses the swap partition more actively; a smaller value indicates that the system uses physical memory more actively.
[0135] "dtype":"int", # The dtype attribute describes the data type of the parameter; vm.swappiness is an integer.
[0136] "range":[10,90], #The range attribute specifies the range of values the parameter can take.
[0137] "step":1 # The step attribute is the number of steps that can be iterated over in each iteration.
[0138] },
[0139] "vm.dirty_background_ratio":{#vm.dirty_background_ratio is the name of the parameter.}
[0140] The `#desc` attribute describes the parameter: When the percentage of dirty pages reaches `dirty_background_ratio`, the write function wakes up the kernel's flusher thread to write back dirty page data until the percentage is less than the value of `dirty_background_ratio`.
[0141] "dtype":"int", # The dtype attribute describes the data type of the parameter; vm.dirty_background_ratio is an integer.
[0142] "range":[10,50], #The range attribute specifies the range of values the parameter can take.
[0143] "step":1 # The step attribute is the number of steps that can be iterated over in each iteration.
[0144] }
[0145] }
[0146] S300: After receiving the structured training dataset from the dataset preparation module 120, the second server 200 fine-tunes the large language model 220 based on the structured training dataset.
[0147] Specifically, after receiving the structured training dataset from the dataset preparation module 120, the LoRA fine-tuning module 210 inserts a trainable low-rank matrix into the attention layer of the large language model 220, and then trains the low-rank matrix.
[0148] To address the current lack of research on resource scheduling and management for deep learning tasks at the operating system (OS) level, this invention proposes a solution using a large language model 220 to guide kernel parameter tuning. While the large language model 220 possesses strong generalization capabilities, it still has limitations in terms of specialization for specific tasks. Through fine-tuning on a small dataset, the large language model 220 can achieve precise matching of the input and output formats of the tuning task, enabling it to capture the mapping patterns between key input features and output results during the tuning process. This process not only reduces the manual intervention cost of subsequent tuning instruction design but also significantly improves the performance stability of the large language model 220 in terms of structured output and format consistency.
[0149] Therefore, to improve the performance of the large language model 220 in the operating system kernel parameter optimization task, it is necessary to perform targeted fine-tuning of the large language model 220 using a small dataset. This process is as follows: Figure 8 As shown, the structured training dataset constructed by the dataset organization module 120 on the first server 100 is sent to the second server 200. The second server 200 then performs targeted fine-tuning tasks on the locally deployed open-source large language model 220.
[0150] The fine-tuning process of the second server 200 on the large language model 220 (DeepSeek) is shown below.
[0151] S310: The dataset preparation module 120 aligns the structured training dataset with a low-rank trainable matrix format. After the structured training dataset is uniformly formatted, the dataset preparation module 120 transmits the structured training dataset to the second server 200 via the network interface of the first server 100. The LoRA fine-tuning module 210 in the second server 200 receives the structured training dataset, such as... Figure 4 As shown, the structured training dataset is then aligned with the instruction-tuning format required by the large language model 220 to form fine-tuned sample pairs. These fine-tuned sample pairs are packaged into .jsonl files (one sample per line).
[0152] S320: The LoRA fine-tuning module 210 performs data preprocessing on the fine-tuned sample pairs.
[0153] To enable the data to be recognized and processed by the large language model 220, the LoRA fine-tuning module 210 performs normalization encoding on the structured training dataset before fine-tuning. The LoRA fine-tuning module 210 uses a tokenizer corresponding to the pre-trained model to convert the text in the structured training dataset into fixed-length vector representations (tokens acceptable to the large language model 220). During the training phase, the encoded text vectors are used as input to the large language model 220, while the output to be predicted is labeled as the training target.
[0154] S330: LoRA tuning module 210 loads the existing large language model 220 (DeepSeek) on the second server 200 and loads the LoRA configuration parameters.
[0155] LoRA configuration parameters refer to the set of hyperparameters used to define the insertion position and behavior of the low-rank adapter structure during fine-tuning. LoRA configuration parameters include the rank of the low-rank matrix (r=16), the insertion position parameter (linear mapping module of the attention layer), the type of the target module to be adapted (Query / Value weights), the weight initialization strategy (normal distribution initialization), the Dropout setting (0.05), and whether to enable the weight merging strategy (no), etc.
[0156] To reduce the computational and storage overhead of fine-tuning and avoid corrupting pre-trained parameters, the LoRA fine-tuning module 210 employs the LoRA configuration (low-rank adapter) method, inserting a low-rank trainable matrix into the attention layer of the large language model 220 instead of updating all parameters.
[0157] The steps for LoRA fine-tuning module 210 to insert a low-rank trainable matrix are as follows:
[0158] S331: Select several modules from the large language model 220 as target modules. The target modules are linear mapping modules of the attention layer in the large language model 220.
[0159] S332: Introduce trainable low-rank matrix A and trainable low-rank matrix B into the target module.
[0160] Trainable low-rank matrices A and B satisfy the condition: W≈W0+ΔW, where ΔW=A×B. W0 represents the original weight matrix.
[0161] S333: Freeze the original LoRA configuration parameters and train only the inserted trainable low-rank matrix A or trainable low-rank matrix B to form a new knowledge injection channel.
[0162] This method significantly reduces the number of parameter updates, requires less video memory and computing resources, and allows for more flexible deployment.
[0163] S334: Configure the training parameters of the large language model 220 and train the large language model 220.
[0164] During the fine-tuning of the large language model 220, the LoRA fine-tuning module 210 inputs the formatted vector representation text line by line into the large language model 220 and uses the output as a supervision signal for error backpropagation. Since the structure of the LoRA configuration parameters limits the weight updates to only occur on the inserted low-rank matrix, the large language model 220 can complete the fine-tuning process with less computational resources and faster speed while keeping the original parameters frozen.
[0165] The LoRA fine-tuning module 210 performs this step by including:
[0166] S3341: Send the vector-represented text sequentially to the large language model 220;
[0167] S3342: Calculate the difference (loss) between the output of the large language model 220 and the expected output;
[0168] S3343: Update two trainable low-rank matrices using gradient descent based on their differences;
[0169] S3344: Iterate repeatedly until the large language model 220 converges or reaches the set number of training rounds.
[0170] S335: Perform large language model 220 adaptation and deployment.
[0171] like Figure 4 As shown, after the large language model 220 is fine-tuned, the LoRA fine-tuning module 210 saves the fine-tuned LoRA parameters as an agent component. At this point, the agent component can be optionally mounted and deployed onto the large language model 220.
[0172] The data used for fine-tuning comes from a small dataset built in the early stages. This small dataset contains various kernel parameter configurations, deep learning task characteristics, and corresponding performance metrics, ensuring that the knowledge used in the fine-tuning process fully covers the task requirements.
[0173] Through fine-tuning, the system of the present invention possesses the following advantages:
[0174] (1) The large language model 220 can obtain kernel parameter optimization reasoning and decision-making capabilities for different task environments, thereby improving its adaptability and accuracy in optimizing the performance of deep learning tasks.
[0175] (2) This targeted fine-tuning process enables the large language model 220 to make more accurate optimization decisions based on specific hardware configurations and task requirements when performing kernel parameter optimization.
[0176] S400: The finely tuned large language model 220 is used as an agent, and the second server 200 optimizes the operating system kernel parameters of the first server 100 based on the agent.
[0177] S410: After receiving data from the kernel parameter search space, the tuning instruction generation module 130 in the first server 100 generates tuning instructions.
[0178] Tuning instructions are constructed using structured natural language. The tuning instruction generation module 130 generates tuning instructions based on the command-line parameters input during program runtime. Based on a preset parameter description template, the module 130 formats the kernel parameter fields in its built-in kernel parameter search space into text; simultaneously, it extracts CPU, memory, operating system, model, task, dataset fields, and the default training duration `baseline_time` from the input command-line parameters, ultimately integrating this data into a semantically clear task context. The input command-line parameters include deep learning task information: task type, dataset name, model structure, hardware environment configuration (such as CPU core count, memory, etc.), and the training duration under default configuration.
[0179] The tuning instruction generation module 130 in the first server 100 sends the generated tuning instructions to the intelligent agent (large language model 220) of the second server 200 to generate a recommendation configuration file.
[0180] Recommended configuration file: Taking tuning instructions as input, the agent, based on the "system parameter configuration" → "performance impact" mapping pattern learned during the fine-tuning phase, infers the optimal value for each parameter while understanding the task and hardware environment. The inference goal is to minimize training time. Internally, the model implicitly captures the statistical relationship between parameters and performance through contextual modeling. Tuning instructions include parameter ranges, task descriptions, and hardware environment information.
[0181] The recommended output format for the configuration file is JSONL, for example:
[0182] {
[0183] "vm.dirty_ratio":15, / / Sets the maximum percentage of dirty pages allowed by the system (in percentage of total memory); the smaller the value, the more frequently the system performs disk write operations, which helps keep memory clean and is suitable for I / O-intensive tasks;
[0184] "vm.swappiness":40, / / Controls the system's swap policy; the lower the value, the more the system tends to use physical memory; the higher the value, the more actively the system uses swap partitions.
[0185] "vm.dirty_background_ratio":5 / / Sets the dirty page ratio threshold (below dirty_ratio) for triggering a background write-back thread; when the system dirty page ratio reaches this value, the kernel starts a background thread to asynchronously write back dirty data. ...
[0187] }
[0188] After the agent on the second server 200 generates the recommendation configuration file, it transmits the recommendation configuration file to the shell generation and execution module 140 on the first server 100, such as... Figure 6 and Figure 8 As shown. Taking the recommended configuration file (JSONL format) as input, the shell generation and execution module 140 parses and formats the recommended configuration file to generate a script file containing the following commands:
[0189] `Sysctl -w vm.dirty_ratio=15` # Sets the maximum allowed dirty page ratio to 15%;
[0190] Sysctl -w vm.swappiness=40 # Sets the kernel's swappiness value to 40;
[0191] Sysctl -w vm.dirty_background_ratio = 5 # Sets the dirty page ratio that triggers the background write-back thread to 5%;
[0192] python linux_resnet.py # Start the deep learning training task.
[0193] This script file is a configuration execution manifest. The shell generation and execution module 140 transmits the generated configuration execution manifest to the virtual machine 110. The configuration execution manifest also contains commands to run deep learning training tasks, enabling the virtual machine 110 to run the predefined model training (that is, the target model for this optimization, such as the ResNet model) again under the new environment configuration.
[0194] After the deep learning task training is completed, the shell generation and execution module 140 records the runtime status information in the results log. The status information includes the training duration.
[0195] Result log (e.g.) Figure 6 As shown, the tuning instruction generation module 130 on the first server 100 is sent by the virtual machine 110. Simultaneously, the virtual machine 110 will send the system configuration result log parameter file (as shown) to the virtual machine 110. Figure 6 (As shown) Together, they are sent to the tuning instruction generation module 130. The tuning instruction generation module 130 generates new tuning instructions through text processing. The new tuning instructions contain the recommendation configuration file and training duration of the agent in the previous recommendation, which are used to drive the large language model 220 to dynamically learn and update the parameter-performance mapping relationship in order to generate new recommendation configuration files.
[0196] The above process constructs a cyclical optimization feedback loop, enabling the system to continuously fine-tune parameters based on performance results. The system iteratively adjusts parameter configurations, gradually approaching the optimal or near-optimal parameter combination under the current test environment. At this point, the deep learning model can theoretically achieve the shortest training time under the current virtual machine 110 configuration. This dynamic feedback mechanism continuously optimizes parameter configurations, gradually approaching the optimal solution until the test results meet the preset convergence criteria. To ensure the efficiency and resource utilization of the tuning process, a convergence judgment criterion must be preset before optimization begins. For example, when the improvement in training time corresponding to N consecutive rounds of parameter recommendations is lower than a set threshold, or when the training time reaches a specific percentage of the default time, the system will determine that the optimization process is terminated. This criterion is used to measure the performance of the current parameter combination under the target hardware environment and task requirements. When the test results meet the preset conditions, it indicates that the parameter configuration has achieved a balance between performance and stability, at which point the optimization process can end.
[0197] Based on the aforementioned dynamic feedback mechanism, this method demonstrates significant advantages in parameter optimization compared to traditional grid search or manual parameter tuning: First, dynamic feedback shortens the search time for optimal configuration, significantly improving optimization efficiency; second, performance feedback eliminates redundant parameter combinations, avoiding ineffective searches and improving the targeting of exploration; third, real training results drive model inference, enhancing the reliability of parameter recommendations; finally, the system can dynamically adjust the tuning strategy according to task characteristics, supporting cross-scenario generalization capabilities. This closed-loop optimization process not only improves resource utilization but also ensures the adaptability and robustness of parameter configuration.
[0198] Figure 5 A schematic diagram of the tuning instructions is shown. Figure 5 The document includes a task description and corresponding code content: "Given the following system configuration, kernel parameter ranges and default values, virtual machine configuration, and baseline training time for the deep learning task, suggest the next set of kernel parameter values to reduce training time." The tuning instructions of this invention contain the following core information.
[0199] This task description information introduces the type of each input and explains what the expected output is.
[0200] Kernel parameter search space: This includes experimentally verified kernel parameters, their value ranges, parameter descriptions, data types, and iteration steps. When generating tuning instructions, parameter descriptions and data types are not included in the tuning instructions to maintain their conciseness.
[0201] like Figure 5 Tuning commands in the middle:
[0202] Kernel Parameters refers to kernel parameters.
[0203] Taking vm.dirty_background_ratio as an example, the value range is 10-50; the adjustment step is 5, and the number of iterations is 10.
[0204] VM config represents the virtual machine configuration. For example, the number of CPU cores (b+). Figure 5 The 4×Hygon C86 736024-core Processor indicates 4 Hygon C86 7360 processors (24 cores / processor), 16GB of RAM, and Ubuntu 20.04 operating system.
[0205] Task refers to a specific task, such as Image Recognition, which clarifies the application scenario of deep learning.
[0206] DL Model refers to a deep learning model, such as ResNet (a classic image recognition model), which needs to be optimized to suit its computational and memory access characteristics.
[0207] Dataset refers to a dataset, such as ImageNet (a standard dataset in the field of image recognition), used to determine the data size and computational load.
[0208] Baseline Training Time represents the baseline training time, for example, 6800 seconds. The training time under the current default parameters serves as a "reference benchmark" for tuning, with the goal of ensuring that the training time in the new recommended configuration file is lower than it.
[0209] Dynamic optimization and feedback mechanism: The baseline training time, i.e., the model training time under default configuration, is used as a reference point. The baseline training time is the time consumed to train the same deep learning task under the default system kernel parameter configuration, denoted as T. baseline In each round of optimization, the result log records the training duration T corresponding to the recommended configuration file in the current i-th round. i .
[0210] The large language model 220 calculates the fit index of the configuration execution list in each round of configuration.
[0211] The large language model 220 calculates the adaptation index of the configuration execution list for each round of configuration using the following formula.
[0212]
[0213] ΔT=T baseline -T i .
[0214] In the above formula, T baseiine This represents the training time for a deep learning task under the default configuration, where i represents the training epoch, and T represents the training duration. i T represents the training duration corresponding to the recommended configuration file in the i-th round. i-1 ΔT represents the training duration corresponding to the previous round of recommended configuration files. i ΔT represents the training time difference between two rounds, and ΔT represents the time difference between each round and T. baseline The training time difference.
[0215] Large language model 220 for ΔT i The understanding is as follows:
[0216] If ΔT i If the value is greater than ε, then the configuration in this round is considered superior to the configuration in the previous round (when i=1, it is the default configuration);
[0217] If ΔT i If the value is less than or equal to ε, then the configuration of this round is considered to have caused a performance degradation.
[0218] If |ΔT i If |≤ε, then the performance of this round of configuration is considered to be equivalent to that of the previous round of configuration.
[0219] ε is the preset minimum perceptible performance difference (e.g., 1% of the baseline training time). α is the preset tuning target, and N represents the maximum number of consecutive times without substantial improvement (e.g., 5 times).
[0220] Preferably, ε is 1% of the baseline training time, α is 10% of the baseline training time, and N is 5.
[0221] The decision logic of the large language model 220 is as follows:
[0222] If ΔT ≥ α, it means that the current configuration has reduced the training time to the expected extent. The large language model 220 determines that the optimization is successful, terminates the optimization process, and outputs the configuration for this round and its corresponding training time T. i This round of configuration is represented as configi.
[0223] If N consecutive rounds satisfy |ΔT i If |≤ε, it is considered that the optimization process has entered a oscillation range and there is no significant improvement. It is determined that the current optimization target is too high or the training performance has reached a plateau, and optimization can be stopped.
[0224] If ΔT < α and |ΔT i If |>ε, it is considered that there is still potential for optimization, and the next round of configuration suggestions will be generated to enter the next iteration.
[0225] The aforementioned judgment process is completed within the large language model 220 through a specific inference function. The inference function receives the current training feedback data as input and, together with the set hyperparameters such as α, ε, and N, participates in optimizing the judgment logic. Hyperparameters are parameters set before training to control the model's learning process or structure.
[0226] When generating a new round of tuning instructions, the large language model 220 will use historical configuration parameters and their corresponding ΔT and ΔT. i Value (see) Figure 8 This serves as additional input to the tuning instruction generation module 130, driving the large language model 220 to dynamically learn and update the parameter-performance mapping relationship to generate new configuration suggestions. Figure 6 In the closed-loop structure shown, dynamic optimization and feedback mechanisms drive the model to converge toward the direction of minimum training time, thereby achieving efficient search of system kernel parameters.
[0227] Example 2
[0228] This embodiment is a further improvement on embodiment 1, and repeated content will not be described again.
[0229] Figure 7 This is a schematic diagram of the entire system's operation process according to the present invention. Figure 6 The iterative loop demonstrated is supplemented with logic control. This logic control is implemented by the large language model 220, and the control logic has been described in Example 1.
[0230] S1: Start fine-tuning the large language model 220.
[0231] S2: Obtain information on key operating system kernel parameters that significantly affect task performance and their reasonable value ranges through testing, and update the results log.
[0232] S3: The dataset organization module 120 generates the kernel parameter search space and structured training dataset based on the filtered result logs.
[0233] S4: The dataset preparation module 120 transmits the structured training dataset to the LoRA fine-tuning module 210, which then fine-tunes the large language model 220.
[0234] S5: The LoRA fine-tuning module 210 attaches the fine-tuned LoRA parameters to the large language model 220 to form a new intelligent agent.
[0235] S6: The new agent optimizes system parameters and sends the recommended configuration file to the shell generation and execution module 140 in the first server 100.
[0236] S7: After receiving the kernel parameter search space, the first server 100 runs the tuning instruction generation module 130, adds the necessary command-line parameters, and generates tuning instructions. That is, the virtual machine 110 sends the current configuration, the model to be accelerated, and the baseline training time to the tuning instruction generation module 130 to generate the first round of tuning instructions.
[0237] S8: The tuning instruction generation module 130 transmits the first round of tuning instructions to the LoRA fine-tuning module 210 of the second server 200 through the network interface to generate new LoRA parameters.
[0238] S9: The new agent updates again based on the received LoRA parameters and determines whether the training time reduction has met the target.
[0239] S10: If so, obtain the best recommended matching value and the corresponding training time, then end.
[0240] S11: If not, obtain the recommended configuration file.
[0241] Specifically, the new intelligent agent receives the first round of tuning instructions and, based on ΔT and ΔT i Perform logic control:
[0242] If ΔT ≥ α, it means that the current configuration has reduced the training time to the expected extent. The system determines that the optimization is successful, terminates the optimization process, and outputs the configuration configi and its corresponding training time T. i If for N consecutive rounds |ΔT i If | ≤ ε, then the optimization process is considered to have entered a oscillation range and has not shown significant improvement. It is determined that the current optimization target is too high or the training performance has plateaued, and optimization can be stopped. If ΔT < α and |ΔT i If |>ε, then it is considered that there is still potential for optimization, and the next round of configuration suggestions will continue to be generated (see [link]). Figure 6 The recommended configuration file is returned to the Shell generation and execution module 140 of the first server 100, and the process proceeds to the next iteration.
[0243] S12: The new agent transmits the new recommended configuration file to the Shell generation and execution module 140 of the first server 100 again. The Shell generation and execution module applies the new recommended configuration file, allowing the training task to be trained once more under the new recommended configuration file.
[0244] Specifically, the Shell generation and execution module 140 receives a recommended configuration file. Based on a preset parameter mapping template, the Shell generation and execution module 140 converts the recommended configuration file into a .sh script with a valid Bash format (see [link to relevant documentation]). Figure 6 (The arrows between the recommended configuration file and the .sh script), and execute it on virtual machine 110 (see...). Figure 6 (System configuration dynamic injection process). The conversion process is completed through a pre-written Python module or Shell template program, ensuring that JSONL key-value pairs are accurately reflected in the operating system runtime configuration of virtual machine 110.
[0245] S13: After the training task is completed, the virtual machine 110 sends the result log and system configuration result log parameter file to the tuning instruction generation module 130.
[0246] In other words, the result logs and system configuration result log parameter files obtained by training the deep learning model in the virtual machine 110 are sent again to the tuning instruction generation module 130 to generate a new round of tuning instructions until the conditions are met.
[0247] Example 3
[0248] This embodiment is a further example of Embodiments 1 and 2, and repeated content will not be repeated.
[0249] For example, fine-tuning the AlexNet model during testing.
[0250] The benchmark tests were performed on virtual machine 110 "ub20-00" on the first server 100.
[0251] Virtual machine 110 is configured as follows: operating system version Ubuntu 20.04, vcpus count 4, memory size 16GB; the deep learning model to be optimized is AlexNet, the dataset size is 6GB, the task type is image recognition, and the list of parameters to be adjusted is:
[0252] vm.dirty_background_ratio, vm.dirty_ratio, vm.swappiness, kernel.randomize_va_space, kernel.threads-max and hugepage-enabled.
[0253] The optimization goal is to improve performance by at least 5%. The preset minimum perceptible performance difference is 1% of the baseline training time. The preset condition is that |ΔT| is satisfied for 5 consecutive epochs. i |≤ε terminates the tuning, that is:
[0254] ε = 1% × T baseline α = 5% × T baseline N = 5.
[0255] First, a benchmark test was conducted, which measured the training time of the AlexNet model under default configuration on a virtual machine 110, and the result was obtained as T. baseline =6800seconds, so ε=68seconds, α=340seconds.
[0256] The first round of configuration recommendations from the fine-tuned DeepSeek Large Language Model 220 are as follows:
[0257] "vm.dirty_background_ratio=30
[0258] vm.dirty_ratio=50
[0259] vm.swappiness=20
[0260] kernel.randomize_va_space = 0
[0261] kernel.threads-max = 1390531
[0262] hugepage-enabled=madvise".
[0263] The explanation of the above first round of configuration recommendations is as follows.
[0264] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 30."
[0265] The maximum percentage of dirty pages allowed by the system is 50%.
[0266] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 20.
[0267] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0268] The maximum number of threads that the system allows to create is capped at 1390531.
[0269] This parameter controls the strategy for using large page memory. The value is `madvise` (meaning enabled on demand). `Never` means never enabled, and `always` means always enabled.
[0270] The training time under this configuration is T1 = 7519.7367 seconds.
[0271] ΔT = ΔT1 = -719.7376 seconds. ΔT1 < -ε, indicating a performance degradation. This configuration not only failed to optimize training time but actually slowed down training by approximately 10.58%.
[0272] The second round of configuration recommendations is as follows:
[0273] "vm.dirty_background_ratio=15
[0274] vm.dirty_ratio=30
[0275] vm.swappiness=10
[0276] kernel.randomize_va_space = 2
[0277] kernel.threads-max=127321
[0278] hugepage-enabled=madvise".
[0279] The explanation of the above second round of configuration recommendations is as follows.
[0280] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 15."
[0281] The maximum percentage of dirty pages allowed by the system is 30%.
[0282] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 10.
[0283] The parameter that controls address space randomization, with a value of 2 (meaning it is off).
[0284] The maximum number of threads that the system allows to create is capped at 127321.
[0285] The parameter controls the strategy for using large page memory; the value is "madvise" (meaning enable on demand).
[0286] The training time under this configuration is T2 = 7527.7623 seconds.
[0287] ΔT = -727.7623s, a performance decrease of approximately 10.67%, indicating that the current configuration is still ineffective. ΔT2 = -8.0256s, and |ΔT2| ≤ ε, the performance of this configuration is comparable to the previous configuration (7519 seconds).
[0288] The third round of configuration recommendations is as follows:
[0289] "vm.dirty_background_ratio=20
[0290] vm.dirty_ratio=45
[0291] vm.swappiness=30
[0292] kernel.randomize_va_space = 0
[0293] kernel.threads-max = 1390531
[0294] hugepage-enabled=madvise".
[0295] The explanation of the above third round of configuration recommendations is as follows.
[0296] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 20."
[0297] The maximum percentage of dirty pages allowed by the system is 45%.
[0298] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 30.
[0299] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0300] The maximum number of threads that the system allows to create is capped at 1390531.
[0301] The parameter controls the strategy for using large page memory; the value is "madvise" (meaning enable on demand).
[0302] The training time under this configuration is T3 = 7301.2818 seconds.
[0303] ΔT = -501.2818 seconds, which is slightly better than the previous two rounds (7527s and 7519s), but the performance still declined by 7.37%, clearly failing to meet the optimization target. ΔT3 = +226.4805 seconds, ΔT3 > ε, indicating that the configuration in this round is better than the previous one.
[0304] The fourth round of configuration recommendations is as follows:
[0305] "vm.dirty_background_ratio=10
[0306] vm.dirty_ratio=40
[0307] vm.swappiness=20
[0308] kernel.randomize_va_space = 0
[0309] kernel.threads-max=127321
[0310] hugepage-enabled=madvise".
[0311] The explanation of the above fourth round of configuration recommendations is as follows.
[0312] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 10."
[0313] The maximum percentage of dirty pages allowed by the system is 40%.
[0314] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 20.
[0315] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0316] The maximum number of threads that the system allows to create is capped at 127321.
[0317] The parameter controls the strategy for using large page memory; the value is "madvise" (meaning enable on demand).
[0318] The training time under this configuration is T4 = 7552.7229 seconds.
[0319] ΔT = -752.7279 seconds, which is longer than the first three rounds, resulting in a performance degradation of 11.07%. ΔT4 = -251.4411 seconds, ΔT4 < -ε, indicating that this round configuration caused the performance decline.
[0320] The fifth round of configuration recommendations is as follows:
[0321] "vm.dirty_background_ratio=15
[0322] vm.dirty_ratio=30
[0323] vm.swappiness=60
[0324] kernel.randomize_va_space = 1
[0325] kernel.threads-max = 2624641
[0326] hugepage-enabled=never".
[0327] The explanation of the fifth round of configuration recommendations is as follows.
[0328] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 15."
[0329] The maximum percentage of dirty pages allowed by the system is 30%.
[0330] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 60.
[0331] The parameter that controls address space randomization, with a value of 1 (meaning it is off).
[0332] The maximum number of threads that the system allows to be created is capped at 2,624,641.
[0333] This parameter controls the strategy for using large page memory; its value is "never" (meaning it is never enabled).
[0334] The training time under this configuration is T5 = 7526.3175 seconds.
[0335] ΔT = -726.3175 seconds, resulting in a performance degradation of 10.68%.
[0336] ΔT5 = +26.4054 seconds, |ΔT5| ≤ ε, the configuration of this round is the same as the configuration of the previous round.
[0337] The sixth round of configuration recommendations is as follows:
[0338] "vm.dirty_background_ratio=5
[0339] vm.dirty_ratio=20
[0340] vm.swappiness=10
[0341] kernel.randomize_va_space = 0
[0342] kernel.threads-max=127321
[0343] hugepage-enabled=always".
[0344] The explanation of the sixth round of configuration recommendations is as follows.
[0345] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 5."
[0346] The maximum percentage of dirty pages allowed by the system is 20.
[0347] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 10.
[0348] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0349] The maximum number of threads that the system allows to create is capped at 127321.
[0350] hugepage-enabled: This parameter controls the huge page memory usage strategy. Its value is always (meaning it is always enabled).
[0351] The training time under this configuration is T6 = 6472.5450 seconds.
[0352] ΔT = +327.4550 seconds, a performance improvement of 4.82%.
[0353] This configuration, by compressing the dynamic space of dirty pages, maximizing the use of physical memory, and compressing the page table management burden with large pages, brought the system down from >7000 seconds back below the baseline and closer to the optimization target of 5% (currently 4.82%). ΔT6 = +1053.7725 seconds, ΔT6 > ε, making this configuration better than the previous one.
[0354] The seventh round of configuration recommendations is as follows:
[0355] "vm.dirty_background_ratio=5
[0356] vm.dirty_ratio=20
[0357] vm.swappiness=10
[0358] kernel.randomize_va_space = 0
[0359] kernel.threads-max = 1390531
[0360] hugepage-enabled=madvise".
[0361] The explanation of the above seventh round of configuration recommendations is as follows.
[0362] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 5."
[0363] The maximum percentage of dirty pages allowed by the system is 20.
[0364] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 10.
[0365] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0366] The maximum number of threads that the system allows to create is capped at 1390531.
[0367] The parameter controls the strategy for using large page memory; the value is "madvise" (meaning enable on demand).
[0368] The training time under this configuration is T7 = 7315.9511 seconds.
[0369] ΔT = -515.9511 seconds, which is 515 seconds worse than the previous round's 6472.55 seconds, representing a performance decrease of 9.06%. ΔT7 = -843.4061 seconds, and ΔT7 < -ε, indicating that this round's configuration caused the performance degradation.
[0370] The recommended configuration for the eighth round is as follows:
[0371] "vm.dirty_background_ratio=5
[0372] vm.dirty_ratio = 15
[0373] vm.swappiness=10
[0374] kernel.randomize_va_space = 0
[0375] kernel.threads-max=127321
[0376] hugepage-enabled=always".
[0377] The explanation of the above eighth round of configuration recommendations is as follows.
[0378] "The threshold for the proportion of dirty pages that triggers the background write-back thread is set to 5."
[0379] The maximum percentage of dirty pages allowed by the system is 15.
[0380] The control system uses a parameter that indicates a preference for swap partitioning, with a value of 10.
[0381] The parameter that controls address space randomization, with a value of 0 (meaning it is off).
[0382] The maximum number of threads that the system allows to create is capped at 127321.
[0383] This parameter controls the strategy for using large page memory; its value is always (meaning it is always enabled).
[0384] The training time under this configuration is T8 = 6401.4598 seconds.
[0385] ΔT = +398.5402 seconds. In this round, the model configuration finally reached the optimization target of 5% (actually 5.86%). ΔT8 = +914.4913 seconds. ΔT8 > ε, this round's configuration is better than the previous configuration. Stop tuning and output the results.
[0386] Throughout the tuning process of the large language model 220, the first five rounds sought the non-linear relationship between parameters and performance within local optima. The sixth round, through a relatively aggressive compression of the value of `vm.dirty_background_ratio`, managed to escape the local optima and nearly reached the tuning target. The seventh round, after increasing the value of `kernel.threads-max`, experienced a significant performance drop. The eighth round reverted to a lower value for `kernel.threads-max` and enabled `hugepage-enabled` to `always`, ultimately achieving the tuning goal.
[0387] Example 4
[0388] This embodiment provides an operating system kernel parameter tuning system or device for deep learning tasks.
[0389] In the first server 100, virtual machine 110 runs on a first multi-core processor, parameter filtering module 150 is a second multi-core processor, dataset processing module 120 is a third multi-core processor, tuning instruction generation module 130 is a fourth multi-core processor, and shell generation and execution module 140 is a fifth multi-core processor. The first to fifth multi-core processors all share the memory, storage, and network interface in the first server 100. The first multi-core processor communicates with the second and fifth multi-core processors respectively. The second, third, and fourth multi-core processors communicate sequentially. If necessary, the first multi-core processor can also communicate with the third multi-core processor.
[0390] In the second server 200, the LoRA fine-tuning module 210 is the sixth multi-core processor, and the large language model 220 is located on the seventh multi-core processor. The sixth and seventh multi-core processors share the memory, storage, and network interface in the second server 200. The sixth and seventh multi-core processors are interconnected.
[0391] In the initial phase, the first multi-core processor configures the application and trains the model based on different deep learning models and configuration execution manifests, while updating the result logs. The first multi-core processor then sends the updated result logs to the second multi-core processor.
[0392] After receiving the result logs from the first multi-core processor, the second multi-core processor filters out the system parameters that have a significant impact on performance based on the performance change magnitude of each parameter adjustment process and obtains the filtered result logs, and then sends the filtered result logs to the third multi-core processor.
[0393] After receiving the filtered result logs, the third multi-core processor preprocesses the logs to construct the kernel parameter search space and the structured training dataset. The third multi-core processor aligns the structured training dataset with a low-rank trainable matrix format. After the structured training dataset is uniformly formatted, the third multi-core processor sends the structured training dataset to the sixth multi-core processor on the second server 200 via the interface of the first server 100. The third multi-core processor then sends the data from the kernel parameter search space to the fourth multi-core processor.
[0394] After receiving the data from the kernel parameter search space, the fourth multi-core processor generates the first round of tuning instructions based on the data from the kernel parameter search space, and sends the tuning instructions to the seventh multi-core processor through the network interface.
[0395] After receiving the first round of tuning instructions, the seventh multi-core processor determines whether the training time reduction has met the target. If yes, it obtains the best-performing recommended matching value and its corresponding training time, and the process ends; otherwise, it obtains the recommended configuration file. The seventh multi-core processor then sends the recommended configuration file to the fifth multi-core processor to begin the next iteration.
[0396] After receiving the recommended configuration file from the seventh multi-core processor, the fifth multi-core processor applies the new recommended configuration file and trains the training task once under the new configuration file. After the training task is completed, the fifth multi-core processor transmits the configuration execution list to the first multi-core processor.
[0397] After receiving the configuration execution list, the first multi-core processor trains a deep learning model based on the configuration execution list, sends the updated result log and system configuration result log parameter file to the fourth multi-core processor, generates a new round of tuning instructions, and continues until the conditions are met.
[0398] Meanwhile, after receiving the structured training dataset from the third multi-core processor via the network interface, the sixth multi-core processor aligns the structured training dataset with the instruction tuning format required by the large language model 220 on the seventh multi-core processor to form fine-tuned sample pairs.
[0399] The sixth multi-core processor preprocesses the fine-tuning sample pairs. To ensure the data can be recognized and processed by the seventh multi-core processor, the sixth multi-core processor performs normalization encoding on the structured training dataset before fine-tuning. The sixth multi-core processor uses a tokenizer corresponding to the pre-trained model to convert the text in the structured training dataset into fixed-length vector representations. During the training phase, the encoded text vectors are sent to the seventh multi-core processor.
[0400] The sixth multi-core processor loads the existing large language model 220 (DeepSeek) from the seventh multi-core processor and loads the LoRA configuration parameters to generate fine-tuned LoRA parameters. The sixth multi-core processor then sends the fine-tuned LoRA parameters to the seventh multi-core processor.
[0401] After receiving the finely tuned LoRA parameters from the sixth multi-core processor, the seventh multi-core processor mounts and deploys the LoRA parameters onto its own large language model 220 to form an intelligent agent.
[0402] It should be noted that the specific embodiments described above are exemplary. Those skilled in the art can devise various solutions inspired by the disclosure of this invention, and these solutions all fall within the scope of this invention and its protection. Those skilled in the art should understand that this specification and its accompanying drawings are illustrative and not intended to limit the scope of the claims. The scope of protection of this invention is defined by the claims and their equivalents. This specification contains multiple inventive concepts; phrases such as "preferredly" or "according to a preferred embodiment" indicate that the corresponding paragraph discloses an independent concept. The applicant reserves the right to file divisional applications based on each inventive concept.
Claims
1. An operating system kernel parameter tuning system for deep learning tasks, the system comprising a first server (100) and a second server (200), characterized in that, The first server (100) includes: Virtual machine (110) performs application configuration and model training based on different deep learning models and configuration execution lists, while updating the result logs; The parameter filtering module (150) filters system parameters that have a significant impact on performance based on the performance change range of each parameter adjustment process and obtains the filtered result logs, and sends the filtered result logs to the dataset processing module (120). The dataset organization module (120) summarizes the result logs and forms a kernel parameter search space and a structured training dataset for fine-tuning the large language model (220); The tuning instruction generation module (130) generates tuning instructions based on the kernel parameter search space and sends them to the second server (200). The shell generation and execution module (140) receives a recommended configuration file from the second server (200), organizes the recommended configuration file into an executable configuration execution list, and sends it to the virtual machine (110). The LoRA fine-tuning module (210) in the second server (200) adjusts the large language model (220) based on the structured training dataset. The adjusted large language model (220) acts as an agent to form a new round of recommended configuration files based on the tuning instructions. The second server (200) sends the recommended configuration files to the shell generation and execution module (140).
2. The system according to claim 1, characterized in that, In the initial stage, the virtual machine (110) calculates the degree of influence of key parameters in the operating system kernel parameters on the performance of deep learning tasks, and adjusts the key parameters and their value ranges based on the degree of influence.
3. The system according to claim 1 or 2, characterized in that, The processing steps of the LoRA fine-tuning module (210) include: The text in the structured training dataset is normalized and encoded to convert the text in the structured training dataset into a fixed-length vector representation of the text; A low-rank trainable matrix is inserted into the attention layer of the large language model (220) to reduce the number of parameter updates; Fine-tune the training parameters of the large language model (220) and train a low-rank trainable matrix; The low-rank trainable matrix is mounted, and the fine-tuned large language model (220) is run as an agent.
4. The system according to claim 3, characterized in that, The steps of generating tuning instructions by the tuning instruction generation module (130) include: Based on the preset parameter description template, the kernel parameter fields in the built-in kernel parameter search space are traversed and formatted into text; Simultaneously, the CPU, memory, operating system, model, task, dataset fields, and default training duration are extracted from the input command-line parameters, and this data is integrated into a semantically clear task context.
5. The system according to claim 3, characterized in that, The large language model (220) generates a recommended configuration file based on the received tuning instructions and sends it to the shell generation and execution module (140) in the first server (100) so that the shell generation and execution module (140) generates the configuration execution list.
6. The system according to claim 3, characterized in that, The large language model (220) calculates the adaptation index of the configuration execution list in each round of configuration; ; ; in, This indicates the training duration of the deep learning task under the default configuration; i represents the training epoch. This represents the training duration corresponding to the recommended configuration file in the i-th round; This indicates the training duration corresponding to the previous round of recommended configuration files; This indicates the training time difference between each two rounds; Indicates each round compared to Training time difference.
7. The system according to claim 3, characterized in that, After the training task is completed, the virtual machine (110) sends the result log and system configuration result log parameter file to the tuning instruction generation module (130). The tuning instruction generation module (130) generates a new round of tuning instructions until the conditions are met.
8. A method for optimizing operating system kernel parameters for deep learning tasks, characterized in that, The method includes: The application is configured and the model is trained based on different deep learning models and configuration execution lists, while the result logs are updated. Based on the performance change magnitude of each parameter adjustment process, the system parameters that have a significant impact on performance are screened, and the filtered result logs are obtained. The results logs are summarized to form a kernel parameter search space and a structured training dataset for fine-tuning the large language model (220); Based on the kernel parameter search space, tuning instructions are generated; Organize the recommended configuration files into an executable configuration execution list; The large language model (220) is adjusted based on the structured training dataset. The adjusted large language model (220) is used as an agent to form a new round of recommendation configuration files based on the tuning instructions.
9. The method according to claim 8, characterized in that, The method further includes: calculating the degree of influence of key parameters in the operating system kernel parameters on the performance of deep learning tasks, and adjusting the key parameters and their value ranges based on the degree of influence.
10. The method according to claim 8 or 9, characterized in that, The method further includes: Fine-tuning of the large language model (220) based on the structured training dataset. The text in the structured training dataset is normalized and encoded to convert the text in the structured training dataset into a fixed-length vector representation of the text; A low-rank trainable matrix is inserted into the attention layer of the large language model (220) to reduce the number of parameter updates; Fine-tune the training parameters of the large language model (220) and train a low-rank trainable matrix; The low-rank trainable matrix is mounted, and the fine-tuned large language model (220) is run as an agent.
Citation Information
Patent Citations
Method, system and equipment for adjusting kernel parameters of operating system and medium
CN117032955A
Database configuration parameter tuning method and system based on large language model and deep reinforcement learning
CN117762897A
Federal knowledge retrieval and big language model enhancement system and method
CN120386853A