A General Configuration Method and System for Sketch Based on a Data Processing Unit
By monitoring and configuring the DPU's hardware resources, dynamically switching process models, optimizing PCIe and network card bandwidth, and using Bayesian optimization algorithm to adjust resource usage, the bottleneck problem in the DPU network measurement architecture is solved and efficient network measurement is achieved.
Patent Information
- Application Number
- CN202411477518.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-10-22
AI Technical Summary
The existing DPU-based network measurement architecture has many problems in system location, hardware resource management, process model selection, state operation and optimization goal balance, making it difficult to achieve efficient network measurement under high concurrent data traffic.
By monitoring the DPU's hardware resources, identifying available resources and configuring parameters, dynamically switching process models, using Bayesian optimization algorithm to adjust resource usage, optimize PCIe and network card bandwidth, and achieving high throughput and high accuracy network measurements.
It improves the data exchange efficiency between the DPU and the host, rationally allocates hardware resources, improves the real-time and computing efficiency of network measurement, optimizes state operation and resource utilization, and achieves high accuracy and high throughput under limited resources.
Smart Images

Figure CN119512889B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a general configuration method and system for sketch based on a data processing unit, belonging to the technical field of data processing. Background Art
[0002] Network measurement is an indispensable part of modern network management tasks and is widely used in fields such as intrusion detection, load balancing, and traffic engineering. To meet the requirements of large-scale and real-time, network measurement requires an efficient data processing architecture. Traditional network measurement methods are limited by hardware and communication bottlenecks and are difficult to cope with modern high-concurrency data traffic.
[0003] With the introduction of the Data Processing Unit (DPU), the performance of network measurement has been improved to a certain extent. As an independent processing module, the DPU is located between the host and the external network, communicates with the host through PCIe, and communicates with the external through the network card. Its design can effectively share the processing burden of the host and improve data processing efficiency. However, the existing network measurement architecture based on DPU still faces multiple challenges:
[0004] 1. Limitation of system location: The DPU depends on the network card on the host for communication and exchanges data with the host through PCIe. The DPU faces a bandwidth bottleneck in high-bandwidth traffic transmission scenarios. Especially in the case of simultaneously processing multiple network flows, communication efficiency becomes a key factor affecting system performance.
[0005] 2. Hardware resource constraints: The hardware resources of the DPU include the SoC core, DRAM, L2, L3 caches, PCIe bandwidth, and network card bandwidth. These resources are limited and cannot fully meet the large-scale concurrent processing requirements of modern network traffic. When the resource configuration is unreasonable, the system performance often cannot reach the best state, and even performance bottlenecks may occur.
[0006] 3. Complexity of the process model: The DPU supports two different process models, PL (Processing Logic) and RTC (Real-Time Computing). How to flexibly configure the process model according to different application scenarios and choose single-core operation or multi-core binding has become a major difficulty in system design.
[0007] 4. Challenges of state operations: In network measurement tasks, stateful operations and stateless operations are two common modes. Stateful operations usually involve memory access, such as data storage and processing, while stateless operations mainly focus on data parsing and calculation. How to reasonably allocate hardware resources in different operation modes to improve computing efficiency is one of the main technical challenges faced during the deployment of sketch.
[0008] 5. Balance of Optimization Goals. The core goal in network measurement tasks is the balance between accuracy and throughput. Under limited resource conditions, how to achieve the best trade-off between the two through optimization means has become a major challenge for sketch in DPU deployment.
[0009] Based on the above background, existing DPU deployment sketch methods have many problems in terms of system location, hardware resource management, process model selection, state operations, and balance of optimization goals. There is an urgent need for an efficient general configuration method for sketch. Summary of the Invention
[0010] Aiming at the deficiencies of the prior art, the present invention provides a general configuration method and system for sketch based on a data processing unit, aiming to optimize the communication efficiency between the DPU and the host, reasonably allocate hardware resources, achieve flexible process model selection, and efficient state operation configuration, so as to achieve high accuracy and high throughput goals of network measurement under limited resources.
[0011] Term Explanation:
[0012] Sketch: In data processing and network measurement, Sketch is an algorithm for real-time traffic data estimation. By performing compression calculations on the information in the data stream, Sketch can efficiently estimate the statistical characteristics of the data stream in a resource-constrained environment and is widely used in intrusion detection and traffic optimization tasks.
[0013] The technical solution of the present invention is as follows:
[0014] A general configuration method for sketch based on a data processing unit, the steps are as follows:
[0015] (1) Resource Parameter Identification: Monitor the hardware resources of the data processing unit, identify the available resources, and identify all primitives related to the available resources in the sketch program code of the data processing unit to determine the configurable resource parameters;
[0016] (2) Process Model Selection: Configure the pipeline model (PL) and real-time computing model (RTC) on the data processing unit and perform dynamic switching between the two models;
[0017] (3) Resource Constraint Input: Use the configurable resource parameters as input and constraint conditions for real-time adjustment of resource usage;
[0018] (4) Optimization Goal Configuration: Set optimization goals, including maximizing accuracy and throughput and minimizing resource usage;
[0019] (5) Parameter configuration recommendation: Use the Bayesian optimization algorithm to recommend multiple parameter values, fill these parameter values into the sketch program for running, and measure the accuracy, throughput, and resource usage of the sketch through testing to generate an optimal parameter configuration plan.
[0020] Preferably according to the present invention, in step (1), the available resources include the SoC core, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth, and the configurable resource parameters are the number of available SoC cores, the allocated capacity of DRAM, the usage ratio of L2 cache, the usage ratio of L3 cache, the occupancy ratio of PCIe bandwidth, and the transmission rate of network card bandwidth.
[0021] Further preferably according to the present invention, the specific steps for resource parameter identification are as follows:
[0022] (1-1) Monitoring: During the process of running the sketch program in the data processing unit, monitor the hardware resources in the DPU through the profiler tool, and record in real time the usage of the number of SoC cores, DRAM allocation capacity, L2 cache size, L3 cache size, PCIe bandwidth, and network card bandwidth, helping users clearly understand the resources occupied by the current task;
[0023] (1-2) Classification and extraction of resources: Use the monitoring data to identify the current usage status and available capacity of the hardware resources;
[0024] (1-3) Primitive identification: In the sketch program code of the data processing unit, find all code segments related to resource usage through static analysis methods. These code segments are called primitives, and the primitives contain calls to hardware resources, such as memory allocation, computing operations, data transmission, etc. Identify these primitives and determine the resource types involved in each primitive;
[0025] (1-4) Configurable resource parameters: Among the identified primitives, find the configurable resource parameters. Through this step, a flexible resource configuration basis is provided for the sketch program.
[0026] Preferably according to the present invention, in step (2), specifically:
[0027] (2-1) Pipeline (PL) model: This model is suitable for high-throughput tasks. Through pipeline technology, multiple tasks can be processed in parallel at different stages. Configure a task allocation and scheduling mechanism for the pipeline model to ensure that different tasks can be evenly distributed on the SoC core and achieve efficient use of resources;
[0028] (2-2) Real-Time Computing (RTC) Model: The RTC model is suitable for real-time tasks with strict latency requirements. Under this model, tasks will be preferentially bound to specific SoC cores for execution to ensure real-time execution of tasks. For real-time tasks, users are allowed to customize the priority of tasks and dynamically allocate computing resources according to the real-time requirements of tasks; the RTC model remains unchanged;
[0029] (2-3) Model Switching Mechanism: Design a dynamic model switching mechanism to switch between the pipeline model and the real-time computing model according to the different characteristics of tasks. For example, when some tasks have high throughput requirements, the system automatically switches to the PL model; when encountering tasks that require real-time response, the system switches to the RTC model, thus ensuring the optimal state of system performance.
[0030] According to the preferred embodiment of the present invention, in step (2-1), the key mechanism for achieving uniform distribution of different tasks is dynamic load balancing. The task allocation and scheduling mechanism is to continuously monitor the real-time load and task queue status of each SoC core, and use a feedback control system to dynamically adjust task allocation. When the task load of a group of cores exceeds a certain threshold (such as 80% CPU usage), the scheduling system will automatically identify the cores with lighter load and migrate newly arrived tasks or some existing tasks to these cores to relieve the overload state. This process uses a lightweight task migration protocol to dynamically adjust the task location without significantly affecting task processing, ensuring that each core maintains a reasonable load level and achieving balanced utilization of resources. This mechanism can quickly respond to changes in task requirements through periodic load evaluation and automatic adaptation adjustment, always maintaining the balanced load of each SoC core and achieving the goal of efficient resource utilization.
[0031] According to the preferred embodiment of the present invention, in step (2-3), the specific process of the dynamic model switching mechanism includes: First, judge whether model switching is required by real-time monitoring of indicators such as CPU usage, data packet frequency, and response time of tasks; if switching is required, suspend new task allocation and save the current task status and data; then, reallocate resources to adapt to the target model and perform model switching to move tasks into the new computing model; finally, resume task processing and continue monitoring to ensure that the performance indicators meet expectations and ensure the smoothness and efficiency of the switching.
[0032] According to the preferred embodiment of the present invention, step (3) is specifically:
[0033] (3-1) Resource Input: Take the available resources of SoC cores, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth as constraint conditions and input them into the Bayesian optimization algorithm. Each resource has its usage limit. The present invention ensures that resources will not be overused through constraint input, thus avoiding performance degradation caused by resource contention;
[0034] (3-2) Resource constraint management: According to the task requirements, allow users to set the maximum usage of each type of resource. For example, users can specify that at most 4 SoC cores are allowed to be used, and the maximum allowable allocation of DRAM is 2GB, etc. These resource constraint conditions will be passed to the subsequent optimization algorithm as the boundary conditions for resource usage;
[0035] (3-3) Dynamic resource adjustment: During the actual operation process, the resource requirements of the data processing unit may change. Design a dynamic resource adjustment mechanism to adjust the resource allocation in real time according to the actual load situation of the task. For example, when the computing requirements of a certain task increase, the SoC cores or DRAM allocation can be dynamically increased without stopping the task execution.
[0036] Preferably according to the present invention, in step (3-3), the dynamic resource adjustment mechanism monitors the CPU load, memory usage rate and processing speed of the task in real time, timely identifies the change in resource requirements. When it detects that the computing requirements of the task increase and cause the CPU or memory to approach saturation, it determines the number of SoC cores or the DRAM capacity that needs to be increased according to the preset policy rules, and immediately executes. The execution process does not require interrupting the task. By mobilizing idle SoC cores or reallocating memory resources, the resources take effect immediately, improving the processing performance of the task. After completion, continue to monitor and analyze the task performance indicators to quickly iterate resource optimization when the requirements change again, ensuring the continuous optimization of the global resource utilization rate and performance of the DPU.
[0037] Preferably according to the present invention, in step (5), the parameter values include: the number of available SoC cores (such as 1 to 8 cores), the allocated capacity of DRAM (such as 512MB to 4GB), the usage ratio of L2 cache (such as 10% to 90%), the usage ratio of L3 cache (such as 10% to 80%), the occupied ratio of PCIe bandwidth (such as 10% to 100%), and the transmission rate of network card bandwidth (such as 1Gbps to 40Gbps).
[0038] A sketch general configuration system based on a data processing unit, comprising:
[0039] A resource parameter identification module: used to monitor the hardware resources of the data processing unit, identify the available resources, and identify all primitives related to the available resources in the sketch program code of the data processing unit to determine the configurable resource parameters;
[0040] A process model selection module: used to configure the pipeline model and real-time computing model on the data processing unit and perform dynamic switching between the two models;
[0041] Resource Constraint Input Module: used to take configurable resource parameters as input and constraint conditions for real-time adjustment of resource usage;
[0042] Optimization Objective Configuration Module: used to set optimization objectives, including maximizing accuracy and throughput and minimizing resource usage;
[0043] Parameter Configuration Recommendation Module: used to recommend multiple parameter values using the Bayesian optimization algorithm, fill these parameter values into the sketch program for running, and measure the accuracy, throughput, and resource usage of the sketch through testing to generate an optimal parameter configuration plan.
[0044] The beneficial effects of the present invention are as follows:
[0045] 1. System Location: The present invention proposes an optimization method considering the DPU system location. By monitoring and intelligently allocating the PCIe bandwidth and network card bandwidth in real time, the bottleneck problems occurring in the data transmission process are reduced. Through the optimization algorithm for PCIe communication, the data exchange efficiency between the DPU and the host is improved. At the same time, by using the multi-channel parallel processing technology of the network card, the communication ability between the DPU and the external network is enhanced, the utilization efficiency of the PCIe bandwidth and network card bandwidth is improved, the bottleneck in the data transmission process is effectively reduced, and the real-time performance of the network measurement task is improved.
[0046] 2. Hardware Resource Optimization: The present invention identifies and optimizes the hardware resources of the DPU, including the SoC core, DRAM, L2, L3 caches, PCIe bandwidth, network card bandwidth, etc. According to the actual requirements of the sketch task, resources such as the SoC core, DRAM, L2, and L3 caches are dynamically allocated. For compute-intensive tasks, multi-core resources are preferentially allocated to improve the computing speed; for memory-sensitive tasks, large-capacity caches and DRAM resources are preferentially allocated to ensure low latency in data access, improve the performance of the sketch when deployed on the DPU, and avoid resource competition and bottleneck problems.
[0047] 3. Process Model Configuration: The present invention supports flexible selection of the PL and RTC process models on the DPU and can configure the single-core running mode or bind to specific cores according to task requirements. For tasks with high real-time requirements, the RTC model will be preferentially selected and can be configured with single-core or multi-core binding according to the task complexity to improve the real-time processing ability. For non-real-time tasks, the PL model ensures the efficient utilization of resources through a reasonable scheduling algorithm. This method improves the task processing efficiency, especially in resource-intensive tasks, and can effectively reduce the system latency.
[0048] 4. State Operation Optimization: Through intelligent scheduling of the execution order and resource allocation for stateful and stateless operations, for tasks with stateful operations, the present invention reduces the memory access bottleneck by allocating more memory resources and caches; for tasks with stateless operations, the data parsing and calculation speed are optimized through parallel processing. According to the task requirements, the present invention can intelligently switch between stateful and stateless operations, ensuring the overall system performance, optimizing the coordination between memory access and calculation, reducing the memory bottleneck in stateful operations, and improving the calculation efficiency of stateless operations.
[0049] 5. Performance Optimization Objectives: The present invention provides a multi-objective optimization strategy based on accuracy and throughput. Users can dynamically adjust the configuration scheme of the sketch according to the network environment and task requirements. During the performance optimization process, the present invention adopts the Bayesian optimization algorithm and pruning algorithm to generate multiple candidate schemes under different resource and performance trade-off relationships. By testing the performance of each candidate scheme under different traffic distributions, the configuration scheme with the highest accuracy and best throughput is finally selected, improving the system throughput while ensuring high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic structural diagram of the data processing unit of the present invention;
[0051] Figure 2 It is a schematic diagram of the process model of the present invention, where, Figure 2 (a) is the sketch execution model based on the pipeline model, Figure 2 (b) is the sketch execution model based on the real-time computing model;
[0052] Figure 3 It is a schematic flow diagram of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0053] The present invention will be further described below through embodiments in conjunction with the drawings, but not limited thereto.
[0054] Embodiment 1:
[0055] As Figure 3 shown, this embodiment provides a general configuration method for sketch based on a data processing unit, and the steps are as follows:
[0056] (1) Resource parameter identification: Monitor the hardware resources of the monitoring data processing unit to identify available resources, which include the SoC core, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth. Then identify all the primitives related to the available resources in the sketch program code of the data processing unit, and determine the configurable resource parameters. The configurable resource parameters are the number of available SoC cores, the allocated capacity of DRAM, the usage ratio of the L2 cache, the usage ratio of the L3 cache, the occupancy ratio of the PCIe bandwidth, and the transmission rate of the network card bandwidth;
[0057] The specific steps of resource parameter identification are as follows:
[0058] (1-1) Monitoring: During the running of the sketch program on the data processing unit, monitor the hardware resources within the DPU through the profiler tool, and record in real time the usage of the number of SoC cores, the allocated capacity of DRAM, the size of the L2 cache, the size of the L3 cache, the PCIe bandwidth, and the network card bandwidth, helping users clearly understand the resources occupied by the current task;
[0059] (1-2) Classification and extraction of resources: Use the monitoring data to identify the current usage status and available capacity of the hardware resources;
[0060] (1-3) Primitive identification: In the sketch program code of the data processing unit, find all the code segments related to resource usage through static analysis methods. These code segments are called primitives, and the primitives include calls to hardware resources, such as memory allocation, computing operations, data transmission, etc. Identify these primitives and determine the resource types involved in each primitive;
[0061] (1-4) Configurable resource parameters: Among the identified primitives, find the configurable resource parameters. Through this step, a flexible resource configuration basis is provided for the sketch program.
[0062] (2) Process model selection: Configure the pipeline model (PL) and the real-time computing model (RTC) on the data processing unit, and perform dynamic switching between the two models. Specifically:
[0063] (2-1) Pipeline (PL) model: This model is suitable for high-throughput tasks. Through pipeline technology, multiple tasks can be processed in parallel at different stages. Configure a task allocation and scheduling mechanism for the pipeline model to ensure that different tasks can be evenly distributed on the SoC core, achieving efficient utilization of resources;
[0064] The key mechanism to achieve uniform distribution of different tasks is dynamic load balancing. The task allocation and scheduling mechanism is to continuously monitor the real-time load and task queue status of each SoC core, and use a feedback control system to dynamically adjust task allocation. When the task load of a group of cores exceeds a certain threshold (such as 80% CPU utilization), the scheduling system will automatically identify the cores with lighter load and migrate newly arrived tasks or some existing tasks to these cores to relieve the overloaded state. This process dynamically adjusts the task location through a lightweight task migration protocol without significantly affecting task processing, ensuring that each core maintains a reasonable load level and achieving balanced utilization of resources. Through periodic load evaluation and automatic adaptive adjustment, this mechanism can quickly respond to changes in task requirements, always maintain the balanced load of each SoC core, and achieve the goal of efficient resource utilization;
[0065] (2-2) Real-Time Computing (RTC) Model: The RTC model is suitable for real-time tasks with strict latency requirements. Under this model, tasks will be preferentially bound to specific SoC cores to ensure real-time execution of tasks. For real-time tasks, users are allowed to customize the priority of tasks and dynamically allocate computing resources according to the real-time requirements of tasks; The RTC model remains unchanged;
[0066] (2-3) Model Switching Mechanism: Design a dynamic model switching mechanism to switch between the pipeline model and the real-time computing model according to different characteristics of tasks. For example, when some tasks have high throughput requirements, the system automatically switches to the PL model; when encountering tasks that require real-time response, the system switches to the RTC model, thus ensuring the optimal state of system performance;
[0067] The specific process of the dynamic model switching mechanism includes: First, judge whether the model needs to be switched by real-time monitoring indicators such as CPU utilization, data packet frequency, and response time of tasks; if switching is required, suspend new task allocation and save the current task state and data; Then, reallocate resources to adapt to the target model and perform model switching to move tasks into the new computing model; Finally, resume task processing and continue monitoring to ensure that the performance indicators meet the expectations and ensure the smoothness and efficiency of the switching;
[0068] (3) Resource Constraint Input: Use configurable resource parameters as input and constraint conditions for real-time adjustment of resource usage. Specifically:
[0069] (3-1) Resource Input: Use the available resources of SoC cores, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth as constraint conditions and input them into the Bayesian optimization algorithm. Each resource has its upper limit of use. The present invention ensures that resources are not overused through constraint input, thus avoiding performance degradation caused by resource contention;
[0070] (3-2) Resource Constraint Management: According to task requirements, users are allowed to set the maximum usage of each type of resource. For example, users can specify that up to 4 SoC cores are allowed to be used, and a maximum of 2GB of DRAM can be allocated, etc. These resource constraint conditions will be passed to the subsequent optimization algorithm as boundary conditions for resource usage;
[0071] (3-3) Dynamic Resource Adjustment: During the actual operation, the resource requirements of the data processing unit may change. Design a dynamic resource adjustment mechanism to adjust resource allocation in real time according to the actual load of the task. For example, when the computing requirements of a certain task increase, the SoC cores or DRAM allocation can be dynamically increased without stopping the task execution;
[0072] The dynamic resource adjustment mechanism monitors the CPU load, memory usage rate, and processing speed of the task in real time, and promptly identifies changes in resource requirements. When it detects that the computing requirements of the task increase and cause the CPU or memory to approach saturation, it determines the number of SoC cores or the DRAM capacity that needs to be increased according to the preset policy rules and immediately executes. The execution process does not require interrupting the task. By mobilizing idle SoC cores or reallocating memory resources, the resources take effect immediately, improving the processing performance of the task. After completion, it continues to monitor and analyze the task performance metrics to quickly iterate resource optimization when the requirements change again, ensuring the continuous optimization of the overall resource utilization rate and performance of the DPU;
[0073] (4) Optimization Target Configuration: Set optimization targets, including maximizing accuracy and throughput, and minimizing resource usage;
[0074] (4-1) Accuracy Optimization: In network measurement tasks, accuracy is a key measurement criterion. The present invention improves the measurement accuracy of the sketch through an optimization algorithm. First, users can set the required minimum measurement accuracy as the target value, and the optimization algorithm will give priority to configuration schemes that can reach this target value;
[0075] (4-2) Throughput Optimization: Throughput is another core metric, especially in high-traffic networks. The present invention improves the overall throughput of the system by adjusting the allocation of SoC cores and network card bandwidth. During the optimization process, the system will automatically balance the relationship between throughput and resource usage to ensure maximizing throughput under limited resources;
[0076] (4-3) Minimization of Resource Usage: To improve the resource utilization efficiency of the system, the present invention proposes an optimization strategy for resource minimization. The optimization algorithm reduces the usage of SoC cores, DRAM, and caches as much as possible on the premise of ensuring accuracy and throughput, so as to reserve more resources for other tasks.
[0077] (5) Parameter configuration recommendation: Use the Bayesian optimization algorithm to recommend multiple parameter values (including the available number of SoC cores (e.g., 1 to 8 cores), the allocated capacity of DRAM (e.g., 512MB to 4GB), the usage ratio of L2 cache (e.g., 10% to 90%), the usage ratio of L3 cache (e.g., 10% to 80%), the occupancy ratio of PCIe bandwidth (e.g., 10% to 100%), and the transmission rate of network card bandwidth (e.g., 1Gbps to 40Gbps)). Fill these parameter values into the sketch program and run it, and measure the accuracy, throughput, and resource usage of the sketch through testing to generate an optimal parameter configuration scheme.
[0078] Through the above steps, the present invention provides a complete set of general configuration methods for sketch, which can intelligently generate an optimal parameter configuration scheme according to the hardware resources and task requirements of the DPU, greatly improving the performance and resource utilization efficiency of the system.
[0079] Embodiment 2:
[0080] This embodiment provides a general configuration system for sketch based on a data processing unit, including:
[0081] Resource parameter identification module: Used to monitor the hardware resources of the data processing unit, identify the available resources, and identify all primitives related to the available resources in the sketch program code of the data processing unit to determine the configurable resource parameters;
[0082] Process model selection module: Used to configure the pipeline model and real-time computing model on the data processing unit and perform dynamic switching between the two models;
[0083] Resource constraint input module: Used to use the configurable resource parameters as input and constraint conditions for real-time adjustment of resource usage;
[0084] Optimization target configuration module: Used to set optimization targets, including maximizing accuracy and throughput and minimizing resource usage;
[0085] Parameter configuration recommendation module: Used to use the Bayesian optimization algorithm to recommend multiple parameter values, fill these parameter values into the sketch program and run it, and measure the accuracy, throughput, and resource usage of the sketch through testing to generate an optimal parameter configuration scheme.
[0086] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A general configuration method for sketch based on a data processing unit, characterized in that, The steps are as follows: (1)Resource parameter identification: Monitor the hardware resources of the data processing unit, identify the available resources, and identify all the primitives related to the available resources in the sketch program code of the data processing unit to determine the configurable resource parameters; (2)Process model selection: Configure the pipeline model and real-time computing model on the data processing unit and perform dynamic switching between the two models. The specific process of the dynamic model switching mechanism includes: First, judge whether to switch the model by monitoring the CPU usage rate, data packet frequency, and response time metrics of the task in real time; if switching is required, suspend the allocation of new tasks and save the current task status and data; then, re-allocate resources to adapt to the target model, perform model switching, and move the task into the new operation model; finally, resume task processing and continue to monitor to ensure that the performance metrics meet the expectations; (3)Resource constraint input: Use the configurable resource parameters as input and constraint conditions to perform real-time adjustment of resource usage. Specifically: (3-1)Resource input: Use the available resources of the SoC core, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth as constraint conditions and input them into the Bayesian optimization algorithm; (3-2)Resource constraint management: According to the task requirements, allow users to set the maximum usage amount of each type of resource; (3-3)Dynamic resource adjustment: During the actual operation process, the resource requirements of the data processing unit may change. Design a dynamic resource adjustment mechanism to adjust the resource allocation in real time according to the actual load situation of the task; (4)Optimization goal configuration: Set optimization goals, including maximizing accuracy and throughput and minimizing resource usage; (5)Parameter configuration recommendation: Use the Bayesian optimization algorithm to recommend multiple parameter values, including: the number of available SoC cores, the allocated capacity of DRAM, the usage ratio of L2 cache, the usage ratio of L3 cache, the occupied ratio of PCIe bandwidth, and the transmission rate of network card bandwidth. Fill these parameter values into the sketch program to run, and measure the accuracy, throughput, and resource usage of the sketch through testing to generate the optimal parameter configuration plan.
2. The sketch general configuration method based on a data processing unit according to claim 1, wherein In step (1), the available resources include the SoC core, DRAM, L2 cache, L3 cache, PCIe bandwidth, and network card bandwidth, and the configurable resource parameters are the number of available SoC cores, the allocated capacity of DRAM, the usage ratio of L2 cache, the usage ratio of L3 cache, the occupied ratio of PCIe bandwidth, and the transmission rate of network card bandwidth.
3. The sketch general configuration method based on a data processing unit according to claim 2, wherein In step (1), the specific steps of resource parameter identification are: (1-1)Monitoring: During the process of running the sketch program on the data processing unit, monitor the hardware resources in the DPU and record the usage of the number of SoC cores, the allocated capacity of DRAM, the size of L2 cache, the size of L3 cache, PCIe bandwidth, and network card bandwidth in real time; (1-2)Classification and extraction of resources: Use the monitoring data to identify the current usage status and available capacity of the hardware resources; (1-3)Primitive identification: In the sketch program code of the data processing unit, all code segments related to resource usage are found through static analysis methods. These code segments are called primitives; (1-4)Configurable resource parameters: In the identified primitives, the configurable resource parameters are found.
4. The sketch general configuration method based on a data processing unit according to claim 3, wherein In step (2), specifically: (2-1)Pipeline model: Through pipeline technology, multiple tasks are processed in parallel at different stages. A task allocation and scheduling mechanism is configured for the pipeline model to ensure that different tasks can be evenly distributed on the SoC core; (2-2)Real-time computing model: Suitable for real-time tasks with strict latency requirements. Under this model, tasks will be preferentially bound to specific SoC cores for execution to ensure the real-time execution of tasks. For real-time tasks, users are allowed to customize the priority of tasks and dynamically allocate computing resources according to the real-time requirements of tasks; (2-3)Model switching mechanism: Design a dynamic model switching mechanism to switch between the pipeline model and the real-time computing model according to different characteristics of tasks.
5. The sketch general configuration method based on a data processing unit according to claim 4, characterized in that, In step (2-1), the task allocation and scheduling mechanism is as follows: Continuously monitor the real-time load and task queue status of each SoC core, dynamically adjust task allocation. When the task load of a group of cores exceeds a certain threshold, automatically identify the cores with lighter load and migrate newly arrived tasks or some existing tasks to these cores to relieve the overloaded state.
6. The sketch general configuration method based on a data processing unit according to claim 5, wherein In step (3-3), the dynamic resource adjustment mechanism continuously monitors the CPU load, memory usage rate and processing speed of tasks, timely identifies changes in resource requirements. When it is detected that the increase in the computing requirements of tasks causes the CPU or memory to approach saturation, determine the number of SoC cores or the DRAM capacity that needs to be increased according to the preset policy rules and execute immediately. The execution process does not require interrupting tasks. By mobilizing idle SoC cores or reallocating memory resources, the resources take effect immediately. After completion, continue to monitor and analyze the task performance indicators.
7. A sketch general configuration system based on a data processing unit, which is applied to the sketch general configuration method based on the data processing unit according to claim 1, and is characterized in that, Including: Resource parameter identification module: Used to monitor the hardware resources of the data processing unit, identify available resources, and identify all primitives related to the available resources in the sketch program code of the data processing unit to determine the configurable resource parameters; Process model selection module: Used to configure the pipeline model and the real-time computing model on the data processing unit and perform dynamic switching between the two models; Resource constraint input module: Used to take the configurable resource parameters as input and constraint conditions for real-time adjustment of resource usage; Optimization goal configuration module: Used to set optimization goals, including maximizing accuracy and throughput and minimizing resource usage; Parameter configuration recommendation module: Used to recommend multiple parameter values using the Bayesian optimization algorithm, fill these parameter values into the sketch program for running, and measure the accuracy, throughput and resource usage of the sketch through testing to generate an optimal parameter configuration plan.
Citation Information
Patent Citations
Universal sketch configuration method based on programmable switch
CN115484157A
Sketch real-time network measurement method based on programmable hardware DPU, electronic equipment and medium
CN118467151A