Method for generating an ai task resource requirement profile based on feature analysis
Patent Information
- Application Number
- CN202611122683.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-07-28
AI Technical Summary
[0004]为了解决上述技术问题,提供基于特征分析的AI任务资源需求画像生成方法,以解决现有的问题
本申请通过聚类分析将时刻级资源消耗数据划分为不同消耗强度的资源标签,实现了对任务运行时资源使用模式的细粒度识别,进而利用关联规则挖掘资源消耗指标与资源标签之间的内在规律,精准量化了AI任务在整个执行期内不同时刻下行为特征的连贯性与可靠性,为资源需求预测引入了关键的稳定性先验特征;构建资源需求预测模型,其有益效果在于利用AI任务的执行时长和资源行为度映射出高维度的任务运行特征,建立从任务执行周期到真实资源消耗总量的映射关系,能够更准确地反映不同任务类型的资源消耗规律;计算当前AI任务的特征偏离度,其有益效果在于通过融合资源使用量的预测误差与基于历史特征的异常得分,能够全面评估当前AI任务相较于模型已知历史AI任务的新颖程度,为模型更新策略提供了量化依据,使其能够识别需要重点关注的任务,避免对常规任务过度更新或对新型任务更新不足;调整模型的学习参数,其有益效果在于动态干预学习率的大小,彻底打破了传统固定学习参数在增量训练时的局限,从而当新颖任务的特征偏离度高时放大学习步长以加速吸收新知识,特征偏离度低时缩小步长以稳定保留历史知识,实现了模型收敛速度与模型稳定性的完美平衡,有效解决了传统固定学习率难以平衡快速适应新任务与稳定保留旧知识的技术难题;对模型进行增量训练及更新,其有益效果在于采用随机梯度下降算法对模型进行增量更新,使模型能够从每个新任务的执行结果中即时学习,实现了模型的持续进化,与传统离线训练、定期更新的模式相比,增量更新机制无需等待数据积累即可实时优化模型参数,显著提升了模型对新型任务的响应速度,同时,增量更新与动态学习率相结合,使模型在面对不同类型任务时能够自适应调整更新强度,既保证了知识更新的及时性,又维护了已有旧知识;利用更新后的模型对下一个AI任务的资源使用量进行预测,生成刻画资源特性的需求画像数据,以指导资源进行预分配,其有益效果在于通过预测资源使用量、预估特征偏离度和预估的资源使用模式,构建用户刻画其资源占用规模、运行稳定性及计算偏好的资源需求画像,能够在任务执行前获得对任务资源特性的多维认知,从而根据资源占用规模确定分配配额,根据运行稳定性调整分配策略,根据计算偏好选择调度方式,实现从单一维度资源预测到多维度综合决策的跨越,显著提升资源预分配的精准性和任务执行的可靠。
Smart Images

Figure CN122633419B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource allocation technology, specifically to a method for generating AI task resource requirement profiles based on feature analysis. Background Technology
[0002] With the rapid development of artificial intelligence technology, AI applications are extending from cloud data centers to edge computing nodes. In scenarios such as smart manufacturing, smart cities, and autonomous driving, a large number of AI tasks need to be deployed and run on resource-constrained edge nodes. When pre-allocating task resources, static rules are typically used to generate resource profiles for the tasks. However, with the continuous emergence of AI tasks, these tasks have dynamic and varied demand patterns for resources such as computing, memory, and storage. This makes it difficult for static rules to cover the constantly changing resource usage patterns, resulting in a serious lack of accuracy and timeliness in resource profiles.
[0003] When using machine learning models to predict resource requirements for AI tasks, the performance of these models is limited by the coverage of training data because they rely on offline training on historical AI tasks. Therefore, they cannot effectively cover the constantly emerging new AI tasks. To learn the resource consumption characteristics of new AI tasks and improve the model's generalization ability, incremental training is usually used to update the model. However, during the update process, it is difficult to strike a balance between quickly adapting to new tasks and stably retaining old knowledge with fixed learning parameters. This leads to a situation where, when the learning rate is too high, the model parameters are prone to violent fluctuations, causing existing knowledge to be quickly forgotten. On the other hand, if the learning rate is too low, the model will converge to new tasks extremely slowly, making it difficult to capture the dynamic changes in resource consumption patterns in a timely manner, and thus failing to accurately generate a demand profile that describes the dynamic resource characteristics. Summary of the Invention
[0004] To address the aforementioned technical issues, a method for generating AI task resource requirement profiles based on feature analysis is provided to resolve existing problems.
[0005] The solution to the technical problem in this application is to provide a method for generating AI task resource requirement profiles based on feature analysis, including the following steps: After the current AI task is completed, obtain various resource consumption indicators of the task and previous AI tasks at various times during the entire execution period, and extract the resource usage of the AI task from the resource consumption indicators. Based on multiple resource consumption indicators at different times, the resource consumption distribution characteristics of AI tasks in the time series dimension are evaluated for cluster analysis, and a resource label representing the consumption intensity is defined for each cluster. Discover the correlation between resource consumption indicators and their associated resource tags at different times throughout the execution period of each AI task, and calculate the resource behavior degree that characterizes the stability of resource usage patterns for each AI task. For the current AI task, a resource demand prediction model is constructed by leveraging the mapping relationship between resource usage of all previous AI tasks and execution duration and resource behavior. This model predicts resource usage, assesses the degree to which the prediction results for the current AI task deviate from the true value, and evaluates the anomalies of task characteristics represented by execution duration and resource behavior. The feature deviation degree of the current AI task is calculated, and the model's learning parameters are adjusted accordingly. The model is then incrementally trained and updated. The updated model is used to predict resource usage for the next AI task, generating demand profile data that characterizes resource features to guide resource pre-allocation.
[0006] Preferably, the calculation process for the resource usage is as follows: calculate the average value of the data for each resource consumption index under each AI task at all times during the entire execution period, as the average consumption; and positively fuse the average consumption of all resource consumption indices for each AI task to obtain the resource usage for each AI task.
[0007] Preferably, the evaluation of the resource consumption distribution characteristics of the AI task in the time-series dimension for cluster analysis, and the definition of a resource label representing the consumption intensity for each cluster, includes: For each AI task, the data of all resource consumption indicators at each time point are combined into a three-dimensional vector; the three-dimensional vectors of the current AI task and all previous AI tasks are clustered to obtain multiple clusters; For each cluster, calculate the average value of all elements in the three-dimensional vector corresponding to its cluster center, sort all clusters in descending order according to their average value, and define the resource tags of the clusters in turn.
[0008] Preferably, the calculation process of the resource behavior degree is as follows: for each AI task, its corresponding three-dimensional vector at each time point and the resource label of its cluster are used to form a transaction itemset. Data mining is performed on all transaction itemsets of each AI task throughout the entire execution period to obtain the support and confidence of all strongly associated rules; the resource behavior degree is positively correlated with both support and confidence.
[0009] Preferably, the process of constructing the resource demand prediction model is as follows: the execution time of each AI task during the entire execution period is statistically analyzed, and the execution time and resource behavior degree of each AI task are combined to form an input feature vector; for the current AI task, the input feature vectors of all previous AI tasks are used as input, and the resource usage is used as the output label. The regression model with the introduction of stochastic gradient descent algorithm is used for initial training to construct the resource demand prediction model.
[0010] Preferably, the calculation of the feature deviation of the current AI task includes: The input feature vector of the current AI task is input into the resource demand prediction model to predict resource usage and calculate the prediction error between the predicted value and the actual value of the current AI task. Anomaly detection is performed on the input feature vectors of the current AI task and all previous AI tasks to obtain the anomaly score of the current AI task. The feature deviation is positively correlated with the prediction error and anomaly score of the current AI task.
[0011] Preferably, the adjusted learning rate corresponding to the current AI task. The calculation process is as follows: in, The preset initial learning rate, The preset adjustment coefficient, This represents the feature deviation of the current AI task.
[0012] Preferably, the incremental training and updating of the model includes: based on the adjusted learning rate, using the input feature vector and its output label of the current AI task as training samples, and using the stochastic gradient descent algorithm to incrementally train the resource demand prediction model in order to update the model parameters.
[0013] Preferably, the prediction of resource usage for the next AI task includes: for each AI task, counting the number of its three-dimensional vectors distributed in each cluster, selecting the resource label of the cluster with the largest number as the resource usage mode of each AI task; using the resource usage mode of the current AI task as the estimated resource usage mode of the next AI task, and calculating the mean of resource behavior degree and the mean of execution time of all AI tasks belonging to this mode, respectively, as the estimated resource behavior degree and the estimated execution time, and inputting them into the updated resource demand prediction model to predict the resource usage of the next AI task.
[0014] Preferably, the generation of demand profile data characterizing resource features includes: for the estimated resource usage pattern, calculating the average resource usage of all AI tasks under that pattern, calculating the prediction error between the average and the predicted resource usage, and using this as the prediction error for the next AI task; combining the estimated resource behavior degree and the estimated execution time to form an estimated input feature vector, performing anomaly detection on this vector with the input feature vectors of the current AI task and all previous AI tasks to obtain the anomaly score for the next AI task, combining the estimated prediction error to obtain the estimated feature deviation degree, and combining the predicted resource usage and the estimated resource usage pattern to form a three-dimensional representation vector as the resource demand profile data.
[0015] This application has at least the following beneficial effects: This application uses cluster analysis to divide time-level resource consumption data into resource labels with different consumption intensities, achieving fine-grained identification of resource usage patterns during task execution. Then, it utilizes association rules to mine the inherent patterns between resource consumption indicators and resource labels, accurately quantifying the consistency and reliability of AI task behavior characteristics at different times throughout the execution period, introducing key stability prior features for resource demand prediction. The application constructs a resource demand prediction model, the beneficial effect of which lies in using the execution duration and resource behavior of AI tasks to map high-dimensional task operation characteristics, establishing a mapping relationship from the task execution cycle to the actual total resource consumption, which can more accurately reflect the resource consumption patterns of different task types; calculating the current A... The feature deviation of task I has the advantage of comprehensively assessing the novelty of the current AI task compared to the model's known historical AI tasks by fusing prediction errors of resource usage with outlier scores based on historical features. This provides a quantitative basis for model update strategies, enabling the model to identify tasks that require priority attention and avoid over-updating routine tasks or under-updating novel tasks. Adjusting the model's learning parameters has the advantage of dynamically intervening in the learning rate, completely breaking the limitations of traditional fixed learning parameters in incremental training. This allows for increasing the learning step size to accelerate the absorption of new knowledge when the feature deviation of novel tasks is high, and decreasing the step size to stably retain historical knowledge when the feature deviation is low, thus achieving a balance between model convergence speed and... The perfect balance achieved in model stability effectively solves the technical challenge of balancing rapid adaptation to new tasks with stable retention of old knowledge using traditional fixed learning rates. Incremental training and updating of the model offers the advantage of employing stochastic gradient descent, allowing the model to learn instantly from the results of each new task, thus achieving continuous model evolution. Compared to traditional offline training and periodic updates, the incremental update mechanism optimizes model parameters in real time without waiting for data accumulation, significantly improving the model's response speed to new tasks. Furthermore, the combination of incremental updates and dynamic learning rates enables the model to adaptively adjust the update intensity when facing different types of tasks, ensuring both timely knowledge updates and maintaining stability. It builds upon existing knowledge; by using an updated model to predict resource usage for the next AI task, it generates demand profile data that characterizes resource characteristics, guiding resource pre-allocation. Its beneficial effect lies in constructing a resource demand profile that describes a user's resource usage scale, operational stability, and computational preferences by predicting resource usage, estimating feature deviation, and estimating resource usage patterns. This allows for a multi-dimensional understanding of task resource characteristics before task execution, enabling the determination of allocation quotas based on resource usage scale, adjustment of allocation strategies based on operational stability, and selection of scheduling methods based on computational preferences. This represents a leap from single-dimensional resource prediction to multi-dimensional comprehensive decision-making, significantly improving the accuracy of resource pre-allocation and the reliability of task execution. Attached Figure Description
[0016] The following section provides a more detailed explanation of the AI task resource requirement profile generation method based on feature analysis, in conjunction with the accompanying drawings.
[0017] Figure 1 A flowchart illustrating the steps of the AI task resource requirement profile generation method based on feature analysis provided in this application embodiment; Figure 2 A flowchart illustrating the steps of the method for obtaining resource behavior degree provided in this application embodiment. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of the AI task resource requirement profile generation method based on feature analysis proposed in this application, in conjunction with the accompanying drawings and implementation examples, provides a more comprehensive understanding. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0020] Please see Figure 1 The diagram illustrates a flowchart of a method for generating AI task resource requirement profiles based on feature analysis, according to an embodiment of this application. The method includes the following steps: Step 1: After the current AI task is completed, obtain various resource consumption indicators for the task and previous AI tasks at various times during the entire execution period, and extract the resource usage of the AI task from the resource consumption indicators.
[0021] With the rapid development of artificial intelligence technology, AI applications are extending from cloud data centers to edge computing nodes. In scenarios such as smart manufacturing, smart cities, and autonomous driving, a large number of AI tasks need to be deployed and run on resource-constrained edge nodes. In order to more accurately understand the resource consumption characteristics of AI tasks in the edge computing environment, optimize resource scheduling strategies, and improve the overall operating efficiency of the system, it is necessary to generate a profile of the resource requirements of AI tasks to comprehensively depict the resource usage pattern of each AI task during operation, thereby achieving precise guidance for resource allocation.
[0022] Deploy operating system-level monitoring tools, such as cAdvisor, PrometheusNodeExporter, or nvidia-smi, on edge computing nodes to capture various resource consumption metrics for each AI task at different times throughout the entire execution period. These resource consumption metrics include CPU utilization, memory usage, and I / O utilization. In this embodiment, the data acquisition frequency is 1Hz. For other implementations, the implementer can set the frequency according to the actual situation. Secondly, the process of obtaining I / O utilization is as follows: I / O throughput is captured using monitoring tools, and the I / O throughput is normalized to obtain the I / O utilization rate. The specific normalization process is as follows: the ratio between the I / O throughput and the preset maximum throughput is used as the I / O utilization rate. The maximum throughput is set based on the storage device type and interface specifications of the edge computing node. In this embodiment, the maximum throughput of the edge computing node's solid-state drive, such as an NVMe SSD, is 3000MB / s. For other implementations, the implementer can set the maximum throughput according to the actual situation.
[0023] Furthermore, the average resource usage of each AI task during execution is evaluated, specifically as follows: Calculate the average value of each resource consumption index for each AI task at all times throughout the entire execution period, and use it as the average consumption amount; The average consumption of all resource consumption metrics for each AI task is positively integrated to represent the resource usage of each AI task. It should be noted that the specific relationship of forward fusion can be additive, multiplicative, etc., and the specific relationship is determined according to the actual scenario. This embodiment does not impose any special restrictions on this. In this embodiment, the specific process of forward fusion is as follows: the average of the average consumption of all resource consumption indicators of each AI task is taken as the resource usage of each AI task.
[0024] Therefore, after the current AI task is completed, various resource consumption indicators of the task and all previous AI tasks are obtained at various times during the entire execution period, as well as the resource usage of each AI task.
[0025] Step 2: Based on multiple resource consumption indicators at different times, evaluate the resource consumption distribution characteristics of AI tasks in the time-series dimension for cluster analysis, and define a resource label representing the consumption intensity for each cluster; mine the correlation between the resource consumption indicators and their corresponding resource labels at different times throughout the execution period of each AI task, and calculate the resource behavior degree representing the stability of the resource usage pattern of each AI task.
[0026] Furthermore, in existing edge computing resource scheduling systems, AI task resource requirement prediction models are typically trained offline based on historical task datasets. However, due to the limited coverage of historical datasets, it is difficult to encompass the resource usage patterns of continuously emerging new AI tasks, resulting in insufficient generalization ability of the trained models for new tasks. When new AI tasks are deployed and run, the original models struggle to accurately predict their resource requirements, exhibiting poor adaptability. This leads to insufficient or excessive resource allocation for new AI tasks, resulting in low task efficiency or wasted computing resources.
[0027] Secondly, during the execution of AI tasks, resource metrics such as GPU utilization, memory usage, and I / O utilization are not isolated but have complex intrinsic relationships with the computational characteristics and data features of the task. Furthermore, since different AI tasks exhibit differentiated resource consumption characteristics during operation, a single resource metric is insufficient to comprehensively characterize task behavior. This paper analyzes multi-dimensional, fine-grained resource usage time-series data generated by each AI task throughout its execution period to uncover implicit correlation patterns between task characteristics and resource requirements, and calculates resource behavior degree. The flowchart of the method for obtaining resource behavior degree provided in this embodiment is shown below. Figure 2 As shown, it specifically includes: For each AI task, the data of all resource consumption indicators at each time point are combined into a three-dimensional vector; Cluster all 3D vectors of the current AI task and all previous AI tasks to obtain multiple clusters; In this embodiment, the K-Means clustering algorithm is used for clustering, and the number of clusters is set to 3. The K-Means clustering algorithm is a well-known technology and will not be described in detail here. As other implementation methods, implementers can use other methods of existing technology, such as the DBSCAN clustering algorithm. This embodiment does not impose any special restrictions on this.
[0028] For each cluster, calculate the average value of all elements in the three-dimensional vector corresponding to its cluster center, sort all clusters in descending order according to their average value, and define resource tags for the clusters in sequence, wherein the resource tags are respectively computationally intensive, computationally normal, and computationally idle. It should be noted that the cluster with the largest average value is labeled as computationally intensive, the cluster with the smallest average value is labeled as computationally idle, and the cluster with an average value between the largest and smallest average values is labeled as computationally normal.
[0029] For each AI task, a transaction itemset is formed by the three-dimensional vector corresponding to each time step and the resource labels of the cluster to which it belongs. Data mining is performed on the transaction itemsets corresponding to each AI task at all times during the entire execution period to obtain the support and confidence of all strong association rules. In this embodiment, the Apriori algorithm is used for data mining, with the minimum support set to 0.1 and the minimum confidence set to 0.7. As other implementation methods, implementers can set these values according to their actual situations. The Apriori algorithm is a well-known technology and will not be described in detail here.
[0030] It should be noted that the Apriori algorithm is used to discover strong correlation rules between the type characteristics of AI tasks and resource requirements. The greater the support, the more prevalent the resource usage pattern of the strong correlation rule is throughout the entire execution period of the task; the higher the confidence, the greater the probability that the strong correlation rule is true.
[0031] The resource behavior degree, support degree, and confidence degree of each AI task are all positively correlated; It should be noted that a positive correlation means that the dependent variable increases as the independent variable increases and decreases as the independent variable decreases.
[0032] In this embodiment, for each AI task, the mean of the product of the support and confidence of all its corresponding strong association rules is used as the resource behavior degree.
[0033] It should be noted that the resource behavior degree reflects the strength and stability of the correlation between the type characteristics of the task and the resource requirements. The larger the value, the clearer the identification of the resource pattern of each AI task and the higher the predictability.
[0034] At this point, the resource behavior score for each AI task is obtained.
[0035] Step 3: For the current AI task, use the mapping relationship between the resource usage of all previous AI tasks and the execution duration and resource behavior degree to build a resource demand prediction model and predict the resource usage. Evaluate the degree to which the prediction result of the current AI task deviates from the true value, as well as the task feature anomalies represented by the execution duration and resource behavior degree, and calculate the feature deviation degree of the current AI task.
[0036] Furthermore, due to the differences in resource usage patterns across various AI tasks, static resource demand prediction models struggle to accurately fit all task types. Moreover, these models can only learn from historical task patterns and are ill-suited to accurately predict novel tasks with deviated feature distributions. To quantify the challenge posed by AI tasks to existing prediction models, we analyze the prediction error of resource usage after actual AI task execution, as well as the degree of anomaly in execution time and resource behavior relative to historical AI task distributions, calculating the feature deviation. Specifically: The execution time of each AI task throughout the entire execution period is calculated. The execution time and resource behavior of each AI task are used to form an input feature vector. For the current AI task, the input feature vectors of all previous AI tasks are used as input, and the resource usage is used as the output label. The initial training is carried out using a regression model with stochastic gradient descent algorithm to build a resource demand prediction model. The input feature vector of the current AI task is input into the resource demand prediction model to predict resource usage and calculate the prediction error between the predicted value and the actual value of the current AI task. It should be noted that the regression model uses a support vector machine model, where the stochastic gradient descent algorithm and the support vector machine model are well-known techniques and will not be elaborated here; secondly, the prediction error is measured by calculating the absolute value of the difference between the predicted value and the actual value.
[0037] It should be noted that the larger the prediction error, the worse the model fits the AI task, meaning the weaker the explanatory power of execution time and resource behavior on resource usage, and the lower the reliability of the model's prediction.
[0038] Perform anomaly detection on the input feature vectors of the current AI task and all previous AI tasks, and obtain the anomaly score of the current AI task; In this embodiment, the isolated forest algorithm is used for anomaly detection. The subsampling size of the isolated forest algorithm is set to 256, and the number of trees is 100. As for other implementation methods, the implementer can set them according to the actual situation. The isolated forest algorithm is a well-known technology and will not be described in detail here.
[0039] It should be noted that the larger the anomaly score, the more significantly the characteristics of the AI task deviate from the historical task distribution, reflecting that the AI task is more likely to be a novel task.
[0040] Currently, the feature deviation of AI tasks is positively correlated with prediction error and anomaly score; In this embodiment, the maximum-minimum normalization method is used to normalize the prediction errors of all AI tasks. The maximum-minimum normalization method is a well-known technique and will not be described in detail here. Based on a preset first weight and a preset second weight, the normalized prediction error and the abnormal score are weighted and summed to obtain the feature deviation. The preset first weight is less than the preset second weight. In this embodiment, the preset first weight is 0.4 and the preset second weight is 0.6. As for other implementation methods, the implementer can set them according to the actual situation.
[0041] It should be noted that the greater the deviation of the features, the larger the prediction deviation of the resource demand prediction model for the AI task and the more novel the task itself is, and the greater the challenge that the AI task poses to the original model.
[0042] Thus, the feature deviation of the current AI task is obtained.
[0043] Step 4: Based on the feature deviation of the current AI task, adjust the model's learning parameters, perform incremental training and update the model, and use the updated model to predict the resource usage of the next AI task, generating demand profile data that characterizes resource features to guide the pre-allocation of resources.
[0044] Furthermore, due to the highly dynamic and heterogeneous resource requirements of different AI tasks, resource requirement prediction models are prone to slow adaptation when facing unknown new tasks with abrupt changes in resource usage patterns, due to fixed parameter update strategies. To enable the model to continuously learn the feature patterns of new tasks, the learning rate of the stochastic gradient descent algorithm is dynamically adjusted based on feature deviation, specifically as follows: in, The adjusted learning rate for the current AI task. The preset initial learning rate, The preset adjustment coefficient, The feature deviation of the current AI task; In this embodiment, the preset initial learning rate determines the basic step size for parameter updates when the model faces historical routine tasks. The value range is set between 0.001 and 0.1. If the basic step size is greater than 0.1, it can easily cause the model parameters to oscillate or even diverge on the error surface, i.e., gradient explosion, making smooth convergence impossible. Conversely, if it is less than 0.001, parameter updates will be too slow, multiplying the number of iterations required for model convergence and wasting system computing power. Therefore, this embodiment sets the preset initial learning rate to 0.01 while balancing stable convergence and a moderate update speed. The preset adjustment coefficient is used to control the model's sensitivity to new task features, with a value range of 0.2 to 0.8. Even when faced with extremely novel tasks with large prediction errors, the amplification effect of the learning rate is negligible, causing the model to crawl slowly at a nearly fixed rate, unable to quickly adapt to new tasks; if If the model is overly sensitive to the novelty of the current AI task, the learning rate will increase exponentially with the impact of a new task, which can easily lead to catastrophic forgetting. That is, in order to adapt to the current new task, the model's parameter memory accumulated from a large number of historical routine tasks is completely destroyed. Therefore, while ensuring rapid adaptation to new tasks, the preset adjustment coefficient is set to 0.5 to prevent the destruction of the historical memory of old knowledge to the greatest extent. As another implementation method, the implementer can set it according to the actual situation.
[0045] It should be noted that when the feature deviation is large, it indicates that the model is facing a new task challenge that deviates significantly from the historical distribution. In this case, the learning rate is positively amplified by the feature deviation, so that the model can quickly absorb the resource consumption pattern of the new task with a larger step size, avoiding continuous resource misallocation due to slow learning. Conversely, when the feature deviation is small, it indicates that the current AI task conforms to the historical regular pattern. In this case, a small learning rate is maintained to preserve the stability of the learned historical features and prevent the model parameters from fluctuating drastically.
[0046] Furthermore, based on the adjusted learning rate, the resource demand prediction model is updated as follows: Based on the adjusted learning rate, the input feature vector and output label of the current AI task are used as training samples, and the stochastic gradient descent algorithm is used to incrementally train the resource demand prediction model in order to update the model parameters. For each AI task, the number of its three-dimensional vectors distributed in each cluster is counted, and the resource label of the cluster with the largest number is selected as the resource usage mode of each AI task. The resource usage pattern of the current AI task is used as the estimated resource usage pattern for the next AI task. The average resource behavior degree of all AI tasks under this pattern is calculated as the estimated resource behavior degree. The average execution time of all AI tasks under this pattern is used as the estimated execution time. Based on the estimated resource behavior degree and the estimated execution time, the updated resource demand prediction model is used to predict the resource usage of the next AI task. Calculate the average resource usage of all AI tasks in this mode, and calculate the prediction error between it and the predicted resource usage, which is used as the prediction error for the next AI task. In this embodiment, the estimated prediction error is the absolute value of the difference between the mean resource usage of all AI tasks in this mode and the predicted resource usage.
[0047] The estimated resource behavior degree and the estimated execution time are combined to form the estimated input feature vector. This vector is then compared with the input feature vectors of the current AI task and all previous AI tasks to perform anomaly detection, thereby obtaining the anomaly score of the next AI task. Combined with the estimated prediction error, the estimated feature deviation is obtained. In this embodiment, the calculation process for the estimated feature deviation is as follows: The prediction error is normalized using the maximum-minimum normalization method, which is a well-known technique and will not be elaborated here. Based on a preset first weight and a preset second weight, the normalized prediction error and the predicted anomaly score are weighted and summed to obtain the predicted feature deviation. The preset first weight is less than the preset second weight. In this embodiment, the preset first weight is 0.4 and the preset second weight is 0.6. In other implementations, the implementer can set the weight according to the actual situation. Next, the isolated forest algorithm is used for anomaly detection.
[0048] The predicted resource usage, estimated feature deviation, and estimated resource usage pattern are combined to form a three-dimensional representation vector, which serves as resource demand profile data to characterize its resource consumption scale, operational stability, and computational preferences, and to guide its subsequent initial resource scheduling. It should be noted that the predicted resource usage is used to pre-allocate appropriate CPU, memory, and I / O resources for tasks, avoiding waste due to resource excess or impact on task execution efficiency due to resource insufficiency; the resource usage pattern is used to guide the scheduling strategy, prioritizing the allocation of computationally intensive tasks to high-performance nodes and merging computationally idle tasks to low-load nodes to improve the overall resource utilization of the cluster; the feature deviation is used to identify novel tasks and trigger a more conservative resource reservation or a more aggressive online model update mechanism.
[0049] When the system receives the execution request for the next AI task, it parses the corresponding resource requirement profile data and, based on the resource consumption scale and life cycle characteristics depicted in the profile, performs initial computing resource allocation and elastic scheduling reservation for the next AI task.
[0050] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0051] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0052] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application. Therefore, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application, without departing from the content of the technical solution of this application, shall fall within the protection scope of the technical solution of this application.
Claims
1. A method for generating AI task resource requirement profiles based on feature analysis, characterized in that, The method includes the following steps: After the current AI task is completed, obtain various resource consumption indicators of the task and previous AI tasks at various times during the entire execution period, and extract the resource usage of the AI task from the resource consumption indicators. Based on multiple resource consumption indicators at different times, the resource consumption distribution characteristics of AI tasks in the time series dimension are evaluated for cluster analysis, and a resource label representing the consumption intensity is defined for each cluster. Discover the correlation between resource consumption indicators and their associated resource tags at different times throughout the execution period of each AI task, and calculate the resource behavior degree that characterizes the stability of resource usage patterns for each AI task. For the current AI task, a resource demand prediction model is constructed and the resource usage is predicted by utilizing the mapping relationship between the resource usage of all previous AI tasks and the execution duration and resource behavior degree. The prediction results of the current AI task deviate from the true value, as well as the anomalies of task characteristics represented by the execution duration and resource behavior degree. The feature deviation degree of the current AI task is calculated, and the learning parameters of the model are adjusted accordingly. The model is then incrementally trained and updated. The updated model is used to predict the resource usage of the next AI task, generating demand profile data that characterizes resource features to guide the pre-allocation of resources. For each AI task, the data of all resource consumption indicators at each time point are combined into a three-dimensional vector; the three-dimensional vectors of the current AI task and all previous AI tasks are clustered to obtain multiple clusters; The calculation process of the resource behavior degree is as follows: For each AI task, its corresponding three-dimensional vector at each time point and the resource label of its cluster are used to form a transaction itemset. Data mining is performed on all transaction itemsets of each AI task throughout the entire execution period to obtain the support and confidence of all strong association rules. The resource behavior degree is positively correlated with both support and confidence. The adjusted learning rate for the current AI task The calculation process is as follows: in, The preset initial learning rate, The preset adjustment coefficient, The feature deviation of the current AI task; The incremental training and updating of the model includes: based on the adjusted learning rate, using the input feature vector and output label of the current AI task as training samples, and using the stochastic gradient descent algorithm to incrementally train the resource demand prediction model in order to update the model parameters.
2. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 1, characterized in that, The calculation process for resource usage is as follows: calculate the average value of the data for each resource consumption index under each AI task at all times during the entire execution period, and use it as the average consumption; take the average of the average consumption of all resource consumption indices for each AI task as the resource usage for each AI task.
3. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 1, characterized in that, The definition of a resource label representing the consumption intensity for a cluster includes: For each cluster, calculate the average value of all elements in the three-dimensional vector corresponding to its cluster center, sort all clusters in descending order according to their average value, and define the resource tags of the clusters in turn.
4. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 3, characterized in that, The process of constructing the resource demand prediction model is as follows: Calculate the execution time of each AI task throughout the entire execution period, and combine the execution time and resource behavior degree of each AI task into an input feature vector; for the current AI task, use the input feature vectors of all previous AI tasks as input, and the resource usage as the output label, and use a regression model with stochastic gradient descent algorithm for initial training to construct the resource demand prediction model.
5. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 4, characterized in that, The calculation of the feature deviation of the current AI task includes: The input feature vector of the current AI task is input into the resource demand prediction model to predict resource usage and calculate the prediction error between the predicted value and the actual value of the current AI task. Anomaly detection is performed on the input feature vectors of the current AI task and all previous AI tasks to obtain the anomaly score of the current AI task. The feature deviation is positively correlated with the prediction error and anomaly score of the current AI task.
6. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 5, characterized in that, The prediction of resource usage for the next AI task includes: for each AI task, counting the number of its three-dimensional vectors distributed in each cluster, selecting the resource label of the cluster with the largest number as the resource usage mode of each AI task; using the resource usage mode of the current AI task as the estimated resource usage mode of the next AI task, and calculating the mean of resource behavior degree and the mean of execution time of all AI tasks belonging to this mode, respectively, as the estimated resource behavior degree and the estimated execution time, and inputting them into the updated resource demand prediction model to predict the resource usage of the next AI task.
7. The method for generating AI task resource requirement profiles based on feature analysis as described in claim 6, characterized in that, The process of generating demand profile data that characterizes resource features includes: calculating the average resource usage of all AI tasks under the estimated resource usage pattern, calculating the prediction error between the average and the predicted resource usage, and using this as the prediction error for the next AI task; combining the estimated resource behavior degree and the estimated execution time to form an estimated input feature vector, performing anomaly detection on this vector with the input feature vectors of the current AI task and all previous AI tasks to obtain the anomaly score for the next AI task, combining the estimated prediction error to obtain the estimated feature deviation, and combining the predicted resource usage and the estimated resource usage pattern to form a three-dimensional representation vector as the resource demand profile data.
Citation Information
Patent Citations
Graphics card task resource scheduling method and system based on machine learning
CN121722574A