Automatic scheduling optimization method and automatic scheduling optimization system of deep learning compiler based on adaptive feature weighting

By using an adaptive feature weighting and confidence verification deep learning compiler, feature weights are dynamically adjusted and high-quality virtual label samples are generated. This solves the problems of inaccurate data quality and rigid feature importance in existing technologies, and improves the performance prediction and code generation efficiency of deep learning models deployed on heterogeneous hardware.

CN122132046APending Publication Date: 2026-06-02SHANGHAI XINLIJI SEMICON CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI XINLIJI SEMICON CO LTD
Filing Date
2026-04-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing deep learning compilers suffer from inaccurate data quality, rigid feature importance assessment, and lack of virtual label confidence verification during automatic scheduling. This results in low prediction accuracy of cost models and an inability to achieve optimal convergence speed in a variable search space.

Method used

A deep learning compiler based on adaptive feature weighting and confidence verification is adopted. By dynamically adjusting feature weights and using Spearman rank correlation coefficient feedback to adjust feature importance, and combining Softmax nonlinear label redistribution and multimodal confidence verification, high-quality virtual label samples are generated to construct a hybrid training dataset for closed-loop iterative optimization.

Benefits of technology

It improves the prediction accuracy of the cost model, eliminates the noise labeling problem, achieves adaptive optimization for different hardware architectures and neural network models, and improves the efficiency and accuracy of automatic scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132046A_ABST
    Figure CN122132046A_ABST
Patent Text Reader

Abstract

This invention discloses an automatic scheduling optimization method and system for a deep learning compiler based on adaptive feature weighting. The automatic scheduling optimization method includes the following steps: In the t-th iteration of the cost model, the comprehensive dynamic feature weights are calculated. S i ( t The cost model predicts the Top-K scheduling scheme in the (t-1)th iteration and its actual hardware test ranking; the Spearman rank correlation coefficient between the predicted ranking and the actual test ranking is calculated. R The weighting coefficients are then adjusted, and the overall score of the scheduling scheme is calculated. Score j ; Calculate the time contribution ratio of each scheduling scheme and generate virtual label samples; Validate the virtual label samples, and merge the valid virtual label samples with the historically accumulated real hardware measurement samples to construct a hybrid training dataset, and update and iterate the cost model in a closed loop.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and computer system software technology, specifically to an automatic scheduling optimization method and system for deep learning compilers. More specifically, this invention relates to an automatic scheduling cost model optimization method based on adaptive feature weighting and confidence verification mechanisms, and an automatic scheduling optimization system for executing this method, to address the performance prediction and code generation efficiency issues of deep learning models deployed on heterogeneous hardware. Background Technology

[0002] With the rapid development of deep learning and hardware architecture, the diversity of models and hardware poses a significant challenge to the high-performance deployment of manually optimized deep learning models. To address this issue, existing deep learning compilers (such as TVM) typically employ an auto-scheduling approach for code generation and optimization.

[0003] Mainstream deep learning compilers employ end-to-end high-performance automatic optimization architectures (such as the Ansor module). Their core processes typically include: 1) Subgraph partitioning and search space generation: The computation graph is divided into subgraphs, and a large number of candidate scheduling scheme samples are generated according to the scheduling rules.

[0004] 2) Cost Model Prediction: To avoid evaluating each candidate solution through actual measurement on hardware, the system uses a machine learning model as the cost model to predict and filter the performance of a large number of samples.

[0005] 3) Hardware testing and feedback: Select the top-K samples with the best prediction performance for actual compilation and hardware testing, and feed the test results (actual throughput or latency) back to the cost model for retraining, and repeat this process iteratively.

[0006] While the aforementioned automatic scheduling framework has solved the deployment problem to some extent, the following technical bottlenecks still exist in practical applications, mainly in terms of data quality and model generalization ability: 1. The label assignment in the training dataset for the cost model is inaccurate. During automatic scheduling, the true performance value (Label) measured by the hardware represents the overall throughput of the entire scheduling scheme (containing multiple inner computation loops). However, in the feature extraction phase, the system extracts features for each fine-grained inner computation within the scheduling scheme. Existing techniques typically assign the overall label value to each inner sample, resulting in a large number of "noisy labels" or imbalanced data in the dataset. This crude label assignment method fails to accurately reflect the true contribution of each feature to the overall performance, severely impacting the prediction accuracy of the cost model.

[0007] 2. Rigid feature importance assessment mechanism To address the aforementioned data imbalance problem, some studies have attempted to redistribute labels using gradient boosting trees to assess feature importance. These methods typically calculate feature weights, gains, and coverage, and then fuse these metrics using a fixed arithmetic mean (e.g., 1 / 3 weighted average) or simple linear normalization to calculate a comprehensive importance score. However, this static fusion strategy ignores the differences in characteristics between different hardware architectures and neural network models (such as ResNet and MobileNet). In some scenarios, feature "split gain" may be more decisive for performance than "coverage," while in others the opposite is true. The fixed weight approach leads to a lack of model adaptability, preventing optimal convergence speed in a variable search space.

[0008] 3. Lack of closed-loop confidence verification for virtual labels Existing technologies, after generating "reassigned labels (virtual labels)" based on feature importance, often directly use these as "ground values" in the next round of cost model training. This is an open-loop, unidirectional process. If there is a deviation in the feature importance calculation, the generated virtual labels will deviate from the actual physical performance, and the system lacks a low-cost verification mechanism to validate the validity of these virtual labels. This leads to the accumulation of erroneous guiding information during iterations, and may even cause the search direction to deviate, thereby reducing the efficiency of automatic scheduling.

[0009] In summary, existing technologies lack a closed-loop optimization scheme that can dynamically adjust feature weights based on the search status and has the ability to self-verify data quality when dealing with automatic scheduling cost models.

[0010] The above background information is provided only to aid in understanding the inventive concept and technical solution of this invention. It does not necessarily belong to the prior art of this invention. In the absence of clear evidence that the above information was disclosed before the filing date of this invention, the above background information should not be used to evaluate the novelty and inventiveness of this invention. Summary of the Invention

[0011] In view of this, in order to overcome the shortcomings of the prior art, the purpose of this invention is to provide an automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting, which can dynamically adjust feature weights.

[0012] To achieve the above objectives, the present invention adopts the following technical solution: An automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting and confidence verification, executed by an automatic scheduling optimization system, wherein the deep learning compiler has a built-in cost model, includes the following steps: In the t-th iteration of the cost model, the comprehensive dynamic feature weights are calculated according to the following formula. : ; In the formula, This is the comprehensive dynamic feature weight of the i-th feature calculated in the t-th iteration of the cost model; i is the dimension index of the feature (representing a specific feature, such as floating-point operation volume, memory access volume, etc.). For feature i, the importance index value is based on the weight. The importance index value of feature i based on gain; The value of feature i is based on the importance index of coverage; For the corresponding Weighting coefficients; For the corresponding Weighting coefficients; For the corresponding Weighting coefficients; The cost model predicts the Top-K scheduling scheme in the (t-1)th iteration and its actual hardware test ranking. The Spearman rank correlation coefficient between the predicted ranking and the actual test ranking is calculated and denoted as... R and based on R With low threshold and high threshold The weighting coefficients are corrected based on the comparison relationship; like R < Then reduce the gain weighting coefficient. Increase coverage weight coefficient ;like R > Then increase the gain weighting coefficient. Reduce coverage weight coefficient ;like ≤ R ≤ If so, then the current weighting coefficients will be maintained; Based on the corrected comprehensive dynamic feature weights The comprehensive score of the j-th scheduling scheme is calculated using the following formula. : ; In the formula, j is the index of the currently processed scheduling scheme; i is the dimension index of the feature; N is the total number of all features; Val j,i Let j be the value of the j-th scheduling scheme on the i-th feature; Based on the overall score Calculate the time contribution ratio of each scheduling scheme and obtain virtual label samples; The virtual label samples are verified, and the verified virtual label samples are merged with the historically accumulated real hardware measurement samples to construct a hybrid training dataset. The cost model is then updated and closed-loop iterated.

[0013] According to some preferred embodiments of the present invention, , Obtained through the following steps: The automatic scheduling optimization system checks whether there is historical data for the current hardware architecture; if so, it extracts representative scheduling schemes and corresponding performance tag data from the historical data; if there is no historical data, it uses a randomly generated scheduling scheme and obtains the corresponding performance tag data using a hardware simulator. For each scheduling scheme, the automatic scheduling optimization system traverses its syntax tree to extract feature vectors, standardizes all feature vectors, and maps all feature values ​​to the same interval. The cost model was pre-trained using the processed sample set, and the normalized values ​​of the three basic feature importance indices were calculated. , , ; the i-th feature , , That is , .

[0014] According to some preferred embodiments of the present invention, the dynamic feature weights are integrated. In the calculation formula, .

[0015] According to some preferred embodiments of the present invention, after each correction of the weighting coefficients, α, β, and γ need to be normalized again so that their sum is 1.

[0016] According to some preferred embodiments of the present invention, the Spearman rank correlation coefficient between the predicted ranking and the actual test ranking is calculated according to the following formula: R= ; In the formula, d i Let d be the difference between the predicted ranking and the actual test ranking of the j-th scheduling scheme; j = Predicted ranking - Actual test ranking; K is the total number of samples for the Top-K scheduling scheme; This means summing up the squares of the ranking differences of all K scheduling schemes.

[0017] According to some preferred embodiments of the invention, based on a comprehensive score Calculating the time contribution ratio of each scheduling scheme and obtaining virtual label samples involves the following steps: The time contribution ratio of each scheduling scheme is calculated using the following formula. : ; In the formula, j is the index of the currently assigned scheduling scheme, u is the local index used to traverse all scheduling schemes within the subgraph, and M is the total number of scheduling schemes divided within the current subgraph. Virtual labels are generated according to the following formula and assigned to each scheduling scheme sample to obtain virtual label samples: ; In the formula, This represents the actual time taken for the entire subgraph.

[0018] According to some preferred embodiments of the present invention, verifying the virtual tag sample includes the following steps: selecting a first mode for verification of the virtual tag sample: Retrieve candidate historical samples whose cosine similarity to the virtual label sample to be verified is higher than a set threshold θ; If multiple candidate historical samples meet the criteria, the cosine similarity score is used as the weight to calculate a weighted average of the actual time consumption of the candidate historical samples, resulting in the set of actual time consumption for the retrieved candidate historical samples. The corresponding cosine similarity is Then the historical true value = In the formula, h is the index of the retrieved candidate historical samples; H is the total number of candidate historical samples with a cosine similarity higher than the set threshold. Let be the cosine similarity between the h-th candidate historical sample and the virtual label sample to be verified; The actual time taken for the h-th candidate historical sample; If only one candidate historical sample meets the criteria, then the actual time consumption of that candidate historical sample is directly used as the historical true value. ; Compare the virtual label sample to be verified with historical real values. ;like , If the relative deviation tolerance threshold is used, the virtual label sample to be verified is determined to be abnormal.

[0019] According to some preferred embodiments of the present invention, verifying the virtual tag sample includes the step of selecting a second mode for verification of the virtual tag sample: The theoretical limit of time required to calculate the virtual label sample to be verified The automatic scheduling optimization system presets a physical feasibility verification interval. , ],in To account for the lower limit tolerance factor of measurement noise, The upper limit of the discrete coefficients to prevent feature collapse; Substitute the virtual label sample to be verified into this interval for comparison. < If so, it is determined that the virtual label sample to be verified has overflowed the lower boundary; if > If the upper boundary overflow occurs, the virtual tag sample to be verified is determined to have overflowed. When any overflow condition is met, the automatic scheduling and optimization system explicitly determines that the virtual tag sample to be verified is physically infeasible and discards or filters it as abnormal data.

[0020] According to some preferred embodiments of the present invention, verifying the virtual tag includes the step of selecting a first mode or a second mode: For virtual label samples to be verified, the automatic scheduling and optimization system will trigger the first mode by default. If and only if the automatic scheduling and optimization system is in a cold start state, or if no historical samples with a cosine similarity higher than the set threshold θ can be retrieved in the historical data, the automatic scheduling and optimization system will determine that the first mode has failed and automatically downgrade to trigger the second mode.

[0021] According to some preferred embodiments of the present invention, the updating and closed-loop iteration of the cost model includes the following steps: The cost model is incrementally trained using a mixed training dataset to update the structure of the decision tree and the weights of the leaf nodes, resulting in the updated cost model. Using the updated cost model as the fitness evaluation function, we run an evolutionary search algorithm or a simulated annealing algorithm in the scheduling search space; we select the top-K scheduling schemes with the best prediction performance, and mix in randomly generated effective scheduling schemes outside the top-K; The selected Top-K schemes and randomly generated effective scheduling schemes are code-generated and compiled, and actual performance tests are conducted on the target hardware to obtain the real test rankings; Determine if the termination condition is met; if not, feed the actual test ranking of this round into the calculation of the Spearman rank correlation coefficient, and start the (t+1)th iteration of the cost model.

[0022] The present invention also provides an automatic scheduling optimization system for performing the above-described automatic scheduling optimization method, comprising: The compiler front-end module receives deep learning models, converts them into intermediate representations, performs operator fusion and subgraph partitioning, and performs hierarchical sampling based on operator structural features to generate representative candidate scheduling schemes. Feature extraction module: Used to standardize the extracted features, mapping all feature values ​​to the same interval to eliminate the influence of units; Adaptive weighted controller: Real-time acquisition of the Spearman rank correlation coefficient R between the actual test results of the previous round of hardware and the prediction results of the cost model, and dynamic adjustment of the gain weight coefficient and coverage weight coefficient based on the comparison relationship between R and the preset threshold. Label reassignment module: Based on the real-time weight coefficients output by the adaptive weighted controller, the overall performance index of the subgraph is reassigned to each scheduling scheme sample within the subgraph, generating virtual label samples; Confidence validator: Used to verify the validity of generated virtual label samples; Cost model training module: Trains the cost model using the validated dataset.

[0023] Due to the adoption of the above technical solutions, the advantages of this invention compared to existing technologies are as follows: The automatic scheduling optimization method of the deep learning compiler based on adaptive feature weighting of this invention introduces a software and hardware combined adaptive feature weighting mechanism, and uses the real test feedback (Spearman rank correlation coefficient) of actual hardware to dynamically adjust the feature importance weights, overcoming the defects of rigidity and lack of physical semantics in traditional static feature evaluation; at the same time, in conjunction with the nonlinear label redistribution strategy based on Softmax, the real time consumption of the entire subgraph is accurately and reasonably divided into various fine-grained scheduling samples, fundamentally eliminating the "noise label" problem caused by the crude copying of the total time consumption in the training of the cost model. Attached Figure Description

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

[0025] Figure 1This is a schematic diagram of the logic flow of the automatic scheduling optimization method in an embodiment of the present invention; Figure 2 This is a schematic diagram of the automatic scheduling optimization system in an embodiment of the present invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] The automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting and confidence verification of the present invention includes a closed-loop iterative process targeting the built-in cost model of the deep learning compiler. The specific steps are as follows: Step S1: Initial Feature Extraction and Pre-training 1.1) Stratified sampling historical data In the initial search phase, the automatic scheduling optimization system checks for historical data specific to the current hardware architecture. If historical data exists, a hierarchical sampling method based on operator structure characteristics (memory access ratio, loop depth, etc.) is used to extract representative scheduling scheme samples and corresponding performance label data from the historical data. If no historical data exists (cold start), a scheduling scheme randomly generated by the compiler front-end module is used, and the corresponding initial performance label data is quickly obtained using a hardware simulator.

[0028] Performance labels are primarily used in the "pre-training and baseline importance calculation" stage. The automatic scheduling optimization system packages the features of the scheduling scheme and the corresponding performance label data into a training set for training the initial XGBoost model. Its fundamental purpose is to extract the basic importance index values ​​of the features through this pre-training. , , This provides a computational benchmark for the subsequent "adaptive feature weighting (step S2)".

[0029] 1.2) Feature Extraction and Standardization For each scheduling scheme, the automatic scheduling optimization system processes it, traversing its syntax tree to extract feature vectors. (Including loop iteration count, memory access step size, pipeline dependency, etc.). To eliminate the influence of different feature dimensions on subsequent weighted allocation, all feature vectors are standardized (e.g., Z-Score standardization or Min-Max normalization) to map all feature values ​​to the same interval (e.g., [0,1]).

[0030] 1.3) Pre-training and Benchmark Importance Calculation The processed sample set (features of the scheduling scheme and corresponding performance label data) is used to pre-train the cost model - XGBoost model inside the deep learning compiler, and the normalized values ​​of three basic feature importance indicators are obtained through the feature extraction module of the automatic scheduling optimization system: Weighted importance index values ​​( ): Features are the relative frequencies of split nodes.

[0031] Based on the importance index value of gain ( ): The average gain resulting from feature splitting.

[0032] Based on the importance index value of coverage ( ): The proportion of samples covered by the feature splitting node.

[0033] Step S2: Calculation of adaptive feature weighting coefficients Unlike existing technologies, this embodiment introduces a feedback adjustment mechanism, corresponding to the real test data (real test ranking) in step 2.2.

[0034] 2.1) Define weight constraints In the t-th iteration, the combined dynamic feature weights are... The calculation formula is as follows: ; In the formula, This is the comprehensive dynamic feature weight of the i-th feature calculated in the t-th iteration of the cost model; i is the dimension index of the feature (representing a specific feature, such as floating-point operation volume, memory access volume, etc.). For feature i, the importance index value is based on the weight. The importance index value of feature i based on gain; The value of feature i is based on the importance index of coverage; For the corresponding Weighting coefficients; For the corresponding Weighting coefficients; For the corresponding The weighting coefficients α, β, and γ must satisfy the normalization constraint: In the initial state, it can be set to... .

[0035] 2.2) Calculate the ranking loss Obtain the Top-K scheduling scheme predicted by the cost model in round t-1 and its actual hardware test data, including the actual test rankings. Calculate the Spearman rank correlation coefficient between the predicted rankings and the actual test rankings. R= .

[0036] In the formula, d j The difference in ranking represents the difference in ranking between the two rankings of the j-th data point (i.e., the j-th scheduling scheme); specifically, it is calculated as: d j = Predicted ranking - Actual test ranking. K is the total number of samples, representing the total number of samples participating in the ranking, which is also the total number of Top-K scheduling schemes. This means summing up the squares of the ranking differences of all K scheduling schemes.

[0037] 2.3) Dynamic adjustment rules based on R With low threshold and high threshold The weighting coefficients are corrected based on the comparison relationship.

[0038] 2.3.1) Case 1 (Model underfit, poor generalization): If R < (Low threshold) indicates that the model is misled by individual high-gain features, and the generalization ability needs to be improved.

[0039] Operation: Reduce the gain weighting coefficient Increase coverage weight coefficient .

[0040] formula: In the formula, The learning rate is typically set between 0 and 1.

[0041] 2.3.2) Scenario Two (Model Overly Conservative): If R > A high threshold indicates that the model has grasped general patterns, and we can try to explore the ultimate performance using high-gain features. The current result is still locally optimal, but it may not be globally optimal. We should increase the diversity of exploration and further explore to see if there are better solutions.

[0042] Operation: Appropriately increase the gain weighting coefficient. Reduce coverage weight coefficient .

[0043] formula: In the formula, The learning rate is typically set between 0 and 1.

[0044] 2.3.3) Scenario 3: If R If it is in the middle range, maintain the current weight coefficient.

[0045] 2.4) Weight Rebalancing After each adjustment, α, β, and γ are re-normalized to ensure their sum is 1, thus preventing numerical drift.

[0046] Low threshold ( ): This is typically set between 0.3 and 0.5. When R < This indicates that the predicted ranking and the actual test ranking are only weakly correlated or even uncorrelated, and the cost model is basically in a state of "guessing" and is seriously misled by noise features.

[0047] High threshold ( ): Typically set between 0.8 and 0.9. When R > This indicates that the predicted ranking is highly consistent with the actual test ranking (strong correlation), and the cost model is already very accurate, qualifying it to explore the high-risk, high-return "high-gain feature".

[0048] low threshold and high threshold The specific value can be set by the automatic scheduling and optimization system based on factors such as the complexity of the target hardware architecture.

[0049] The ultimate goal of step S2 is not to pursue a specific range of R values, but to enable the feature weight coefficients (α, β, γ) to be adaptively adjusted in real time based on the feedback (i.e., R values) from the previous round of hardware testing.

[0050] Existing dynamic weight adjustments typically rely solely on the cost model's loss on the training set (the mathematical error between the cost model's predicted execution time and the known actual execution time in the training data). This is an open-loop, purely software metric that ignores the physical differences between different hardware architectures and neural network models. For example, the model might predict that solution A is the fastest and solution B is the second fastest. However, in practice, solution B might actually be the fastest, and solution A the second fastest. Furthermore, existing dynamic adjustments often rely solely on backpropagation of the cost model's loss on the training set. This adjustment is a purely mathematically driven "black box"—the system doesn't know why the weight of a certain feature should be increased, lacking semantic understanding of the underlying physical characteristics (such as memory access and computation).

[0051] This invention does not adjust weights based on pure software losses. Instead, it extracts the Top-K scheduling scheme predicted by the cost model, compares its actual test ranking on real hardware with the predicted ranking, calculates the Spearman rank correlation coefficient R, and adjusts the weights based on the Spearman rank correlation coefficient R. This anchors the weight adjustment to real physical performance. In other words, existing dynamic adjustments are all based on the software layer; this invention is a combined software and hardware dynamic adjustment.

[0052] Step S3: Label redistribution based on dynamic weights and nonlinear mapping 3.1) Feature orientation alignment In calculating the overall score Before calculation, the automatic scheduling optimization system predefines the "cost polarity" of features. For "performance gain" features (such as cache size and vector width), their values ​​are converted into "cost" values ​​by taking their reciprocal or inverse, ensuring that all feature values ​​are logically positively correlated with latency. In specific embodiments and formula derivations, this invention uses latency as the indicator, but it is also applicable to other indicators, such as power consumption or memory usage.

[0053] 3.2) Calculate the weighted score Using the comprehensive dynamic feature weights corrected in step S2 Calculate the overall score of the scheduling scheme. : ; In the formula, j is the index of the current scheduling scheme (i.e., sample) being processed; i is the dimension index of the feature; N is the total number of all features; Val j,i Let be the value of the j-th scheduling scheme on the i-th feature.

[0054] 3.3) Nonlinear Allocation Based on Softmax To address the negative value issue arising from feature standardization and to simulate nonlinear performance distribution, the Softmax function is used to calculate the time contribution ratio for each sample. ; In the formula, j is the index of the currently assigned scheduling scheme, u is the local index used to traverse all scheduling schemes in the subgraph, and M is the total number of scheduling schemes divided in the current subgraph.

[0055] 3.4) Generate virtual label samples Based on the contribution ratio, the total actual time consumption of the subgraph is calculated. Samples are assigned to each scheduling scheme to obtain virtual label samples: Step S4: Multimodal confidence verification and active correction To prevent serious deviations (i.e., "illusion labels") in the "virtual labels" generated in step S3, a verification step is added.

[0056] The verification includes two working modes: historical similarity verification (Mode A - data-based verification) and structure-preserving surrogate verification (Mode B - mechanism-based verification).

[0057] 4.1) Select either the first mode or the second mode. During the verification process, the system incorporates a cost-priority cascading selection logic. For virtual label samples to be verified, the system defaults to triggering the first mode A (historical similarity verification) to minimize verification latency. Only when the system is in a cold start state, or when no reference sample with a cosine similarity higher than a set threshold θ can be found in the historical samples, does the system determine that the first mode A has failed and automatically downgrades to triggering the second mode B (structure-preserving proxy verification). This introduces a small amount of physical computational overhead to ensure the accuracy of the verification using the less frequently accessed scheduling scheme. This adaptive switching mechanism ensures an optimal balance between verification cost and verification reliability. The specific verification process is as follows: 4.2) First Mode A: Historical Similarity Verification Feature fingerprint retrieval: The system maintains a high-confidence historical sample database. It uses locality-sensitive hashing or vector indexing to retrieve candidate historical sample sets whose cosine similarity to the virtual label sample to be verified is higher than a set threshold θ.

[0058] The automatic scheduling optimization system quantifies the underlying actions of each scheduling scheme (such as the number of loops and the memory span) into a string of numbers (feature vectors), flattens them onto a uniform scale, and then calculates the angle difference (cosine similarity) between two strings of numbers in multidimensional space. The smaller the angle, the more similar they are in their underlying physical execution characteristics. The threshold θ is preferably 0.80-0.95.

[0059] If multiple candidate historical samples meet the criteria, the automatic scheduling optimization system uses the cosine similarity score as the weight to perform a weighted average of the actual time consumption of the candidate historical samples, resulting in a set of actual time consumption for the retrieved candidate historical samples. The corresponding cosine similarity is Then the historical true value = In the formula, h is the index of the retrieved candidate historical samples; H is the total number of candidate historical samples with a cosine similarity higher than the set threshold. Let be the cosine similarity between the h-th candidate historical sample and the virtual label sample to be verified; The actual time taken for the h-th candidate historical sample.

[0060] If only one candidate historical sample meets the criteria, then the actual time consumption of that candidate historical sample is directly used as the historical true value. .

[0061] Relative deviation verification: compare the current virtual labels Compared with historical true value ;like In the formula, The relative deviation tolerance threshold, i.e., the maximum permissible error rate, is preferably 0.05-0.2. Then, the virtual label sample to be verified is determined to be a potential anomaly.

[0062] 4.3) Mode B: Proxy Verification for Structure Preservation Constructing arithmetic strength-preserving micro-benchmarks: For the samples to be validated, micro-benchmarks are constructed, reducing the data size while maintaining the computation-to-memory ratio. During construction, the compiler front-end module modifies the tensor intermediate representation (IR) to proportionally reduce the number of iterations of the outermost independent loop (e.g., reducing the outer loop count from 1024 to 64) to decrease the overall data size, while strictly preserving the nested structure of the inner loops and the span logic of the underlying tensor allocation. This mechanism ensures that, by maintaining the original data read step size and spatial locality, the computation-to-memory ratio of the micro-benchmarks remains highly consistent with the cache miss pattern of the original samples with low computational overhead.

[0063] Calibration and Decision: Obtained by running micro-benchmark tests By using linear regression or the Roofline model of the target hardware, combined with computational cost and memory bandwidth limits, the theoretical maximum time consumption (physical lower limit) for this sample can be calculated. The automatic scheduling optimization system has a preset physical feasibility verification interval. , ],in To account for the lower limit tolerance factor of measurement noise (e.g., a value range of 0.8 to 1.0), To prevent feature collapse, an upper limit for the discrete coefficient (e.g., a value range of 10~50).

[0064] Cost proxy This is for testing a smaller sample after reducing the size of the original large sample, which is then used as input to the subsequent Roofline model. In other words, the testing time of this smaller sample is used to estimate the testing time of the original large sample.

[0065] This is mainly achieved by combining measured data and hardware baseline. (Based on the above...) Cost proxyFirst, run a "micro-benchmark" on the target hardware with reduced workload but unchanged core structure to measure a true reference latency. Cost proxy Next, using linear regression or applying the Roofline model of the target hardware (i.e., directly examining the maximum computational load and memory bandwidth limits of this machine), the reference latency measured earlier is analyzed and scaled up proportionally (P*). Cost proxy This allows us to calculate the theoretical time required for the task on full data. This calculated time is the theoretical maximum time for the large sample (scheduling scheme). P is the scaling factor for the data size, which is equal to the ratio of the theoretical data size of the large sample (full scheduling scheme) to the data size of the small sample in the micro-benchmark.

[0066] The automatic scheduling and optimization system will use the virtual tag samples to be verified generated in step S3. Substitute this interval for comparison: If < If so, it is determined that the virtual tag sample to be verified violates the physical laws of hardware computing power or bandwidth (i.e., a lower boundary overflow occurs); if > If the time contribution ratio of the virtual tag sample to be verified is severely distorted (i.e., an upper boundary overflow occurs), the automatic scheduling optimization system will determine that the virtual tag to be verified is physically infeasible and discard or filter it as abnormal data when any of the above overflow conditions are met.

[0067] Step S5: Hybrid Dataset Update and Closed-Loop Iteration 5.1) Constructing a hybrid training set The high-quality virtual label samples that "passed verification" in step S4 are merged with historically accumulated real hardware measurement samples to construct a hybrid training dataset.

[0068] 5.2) Model Update The cost model (XGBoost) is incrementally trained using a mixed dataset to update the structure of the decision tree and the weights of the leaf nodes, resulting in the updated cost model.

[0069] 5.3) Guiding Evolutionary Search Using the updated cost model as the fitness evaluation function, an evolutionary search algorithm or a simulated annealing algorithm is run in the scheduling search space.

[0070] From the generated candidate scheduling population, the Top-K scheduling schemes with the best prediction performance are selected. Meanwhile, to maintain the diversity of the search, a... The strategy is to forcibly mix in a small number of randomly generated effective scheduling schemes outside of the Top-K.

[0071] 5.4) Hardware Testing and Feedback The selected Top-K schemes and randomly generated effective scheduling schemes are processed for code generation and compilation, and actual performance tests are conducted on the target hardware architecture to obtain real latency / throughput data. The target hardware architecture here is the same as the physical hardware platform of the current hardware architecture in step S1 1.1, but the cost model has been updated: before conducting real hardware testing, the system has already executed the cost model update logic, that is, firstly, the high-quality virtual labels that have passed the verification are mixed with historical real data (step 5.1), and then the XGBoost cost model is incrementally trained using this mixed dataset to obtain the updated cost model (step 5.2).

[0072] 5.5) Convergence Criterion: Determine if the termination condition is met (e.g., no significant performance improvement for multiple consecutive rounds, reaching the maximum time budget). If not met, feed the actual test data of this round into step 2.2 of S2, and start the (t+1)th iteration. The actual test data includes actual test ranking information.

[0073] Based on the above-mentioned automatic scheduling optimization method for deep learning compilers based on adaptive feature weighting and confidence verification, this invention also provides an automatic scheduling optimization system for deep learning compilers based on adaptive feature weighting and confidence verification. This automatic scheduling optimization system runs on computer hardware (such as servers, workstations, etc.), and its core architecture includes the following modules: 1. Compiler front-end module This module receives the deep learning model and converts it into an intermediate representation. In the initial stage of the cost model iteration (corresponding to step S1), this module is responsible for operator fusion and computational subgraph partitioning, and performs hierarchical sampling based on operator structural features to generate representative initial candidate scheduling schemes. In the closed-loop iteration stage (step S5), this module, in conjunction with the search algorithm, generates Top-K candidate schemes in the scheduling search space, and uses a cross-compilation mechanism to convert the selected schemes into code executable by the target hardware.

[0074] 2. Feature Extraction Module This module extracts multidimensional physical feature vectors from the low-level intermediate representation of the computational subgraph. In the feature processing flow (corresponding to step S1.2), this module is responsible for standardizing the extracted features, mapping all feature values ​​to the same interval to eliminate the influence of dimensions. In the label reassignment preparation stage (corresponding to step S3.1), this module, based on predefined feature cost polarity, transforms performance-gain features into cost values ​​positively correlated with time consumption, achieving logical alignment of feature directions.

[0075] 3. Adaptive Weighted Controller This module is used to execute step S2, dynamically calculating the importance weight coefficients (α, β, γ) of the features based on hardware feedback. This module obtains the Spearman rank correlation coefficient R between the actual hardware test results and the cost model prediction results from the previous round (round t-1) in real time, and dynamically increases or decreases the gain weight coefficient and coverage weight coefficient based on the comparison between R and a preset threshold, ensuring that the feature weights can adaptively adjust with the search state.

[0076] 4. Tag Reassignment Module This module executes step S3, which, based on the real-time weight coefficients output by the adaptive weighted controller, redistributes the overall performance index of the subgraph to each scheduling scheme sample within the subgraph. This module calculates the weighted score of each sample using the corrected integrated dynamic feature weights and calculates the non-linear time consumption contribution ratio using the Softmax function. Finally, it generates virtual label samples that reflect the true time consumption contribution of fine-grained samples, thus solving the label noise problem in the dataset.

[0077] 5. Confidence checker This module is used to execute step S4, which verifies the validity of the generated virtual label samples and removes noisy data with excessive bias. This module integrates dual-modal verification logic: the first mode uses locality-sensitive hashing to retrieve similar samples from the historical sample library for empirical consistency verification; the second mode is triggered when similar samples are missing, and verifies whether the virtual labels conform to physical boundary constraints by constructing a structure-preserving micro-benchmark and combining it with a hardware Roofline model.

[0078] 6. Cost Model Training Module This module executes step S5, incrementally training the cost model built into the deep learning compiler using the high-quality dataset output by the confidence checker. This module constructs a hybrid training dataset by merging the verified virtual label samples with historically accumulated real hardware measurement samples. By updating the decision tree structure and leaf node weights, it achieves closed-loop iteration of the cost model and continuous evolution of performance prediction accuracy.

[0079] Example: Automatic scheduling optimization for ResNet-50 convolutional layer subgraphs I. Scene Background and Problem Setting Task to be optimized: A computationally intensive subgraph in the ResNet-50 model, containing convolution (Conv2d) and ReLU activation functions.

[0080] Hardware environment: NVIDIA GPU.

[0081] Initial state: The compiler front end divides the subgraph into two main internal scheduling samples (Sample A and Sample B).

[0082] Sample A: Responsible for core convolution calculations (computationally intensive).

[0083] Sample B: Responsible for data movement and padding processing (memory-intensive).

[0084] Ground Truth: The total time taken to run the entire subgraph on the hardware is 100. .

[0085] Problems with existing technical solutions: Traditional TVM simply and crudely converts 100... Assigning labels to Sample A and Sample B, i.e., Label(A) = 100 and Label(B) = 100. This will generate a lot of noise because the computationally intensive Sample A obviously contributes more time.

[0086] The automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting and confidence verification in this embodiment includes the following steps: Step S1: Feature Extraction For the target subgraph of ResNet-50, the automatic scheduling optimization system initially lacks sufficient historical compilation records (historical data) under the current NVIDIA GPU architecture. Therefore, the automatic scheduling optimization system triggers a cold start mechanism, using a scheduling scheme randomly generated by the compiler front-end module (including different variations of Sample A and Sample B), and quickly obtains the corresponding initial performance labels on the hardware simulator to build a small initial pre-training sample set.

[0087] The automatic scheduling optimization system first extracts the feature vectors of Sample A and Sample B. To simplify the calculation, this embodiment selects three core features. : (Float Operations): Floating-point operation time (positively correlated with time consumption).

[0088] (Memory Access): Memory access volume (positively correlated with time taken).

[0089] (Vectorization Len): Vectorization length (negatively correlated with time consumption; the larger the value, the faster).

[0090] To eliminate the influence of dimensions, all feature vectors are subjected to Min-Max normalization, mapping them to the [0,1] interval. This yields the standardized original feature values ​​(at this stage, cost polarity conversion is not performed, as they accurately reflect the physical characteristics): Sample A (Computational): =[0.9,0.4,0.8]; High computational cost, moderate memory access, and high degree of vectorization; Sample B (memory access type): =[0.2,0.8,0.4]; low computational cost, high memory access cost, and low vectorization degree.

[0091] The XGBoost cost model is pre-trained using the initial sample set described above. After training, the basic importance metrics (normalized values) of these three features are extracted from the XGBoost model as the benchmark for subsequent adaptive weighting. Assume the feature importance matrix output by the pre-trained model is as follows: (Floating-point computational complexity): =0.3, =0.6, =0.1; the initial model found that the splitting gain caused by floating-point operations was extremely high, which was the core feature that determined the performance. (Memory access volume): =0.4, =0.3, =0.3; Memory access features are frequently used as splitting nodes in decision trees, and weight is relatively high; (Vectorized length): =0.3, =0.1, =0.6; The vectorization length affects the initial screening of a large number of samples, resulting in a high coverage.

[0092] Step S2: Adaptive Feature Weight Calculation The automatic scheduling optimization system extracts the predicted ranking of the Top-K scheduling scheme in the previous round (round t-1) and the actual hardware test ranking, and calculates the Spearman rank correlation coefficient R=0.45.

[0093] Threshold determination: Set a low threshold =0.5.

[0094] Strategy Triggered: Due to R < The automatic scheduling and optimization system determines that the current cost model is misled by individual high-gain features, falling into a local optimum and exhibiting insufficient generalization ability (corresponding to "Case 1: Model underfitting / poor generalization" in the previous steps). The automatic scheduling and optimization system triggers a dynamic adjustment instruction: reducing the gain weights. Increase coverage weight .

[0095] In the initial state (or the previous round), the overall importance coefficient is evenly distributed: =0.33, =0.33, =0.33. Based on the triggered "Case 1" rule and the set learning rate (assuming...) =0.4), the automatic scheduling optimization system dynamically updates the weight coefficients: The system adjusts the feature weights based on the feedback from the previous round (t-1).

[0096] ; ; It remains unchanged at approximately 0.33.

[0097] Weight rebalancing: After normalization, the feature importance weight coefficients are obtained after this round (round t).

[0098] At this point, the automatic scheduling optimization system tends to trust the "high coverage" feature in order to improve the generalization exploration capability.

[0099] The automatic scheduling optimization system will use the dynamic weight coefficients calculated above. Substitute the values ​​of the baseline importance metrics output by the XGBoost pre-training in step S1 into the values ​​of the baseline importance metrics. , , Using the formula: Calculate the comprehensive weight excluding specific physical characteristics: (Floating-point computational complexity): Assume its baseline performance is... ,but for:

[0100] (Memory access volume): Assuming its baseline metric is ,but for:

[0101] (Vectorized length): Assuming its benchmark index is ,but for:

[0102] The final feature weight vector W is calculated as follows: (Calculation weight) = 0.26; (Memory access weight) = 0.33; (Vectorized weights) = 0.41.

[0103] Step S3: Label Reassignment Based on Softmax Feature orientation alignment (polarity alignment) yields standardized physical features during S1 feature extraction. To ensure that all feature values ​​are positively correlated with time consumption, the automatic scheduling optimization system first predefines the "cost polarity" of the features: (Floating-point arithmetic) and (Accessing existing data) is inherently "cost-based," meaning the larger the value, the longer it takes, and it remains constant. (Vectorized length) is a "performance-gain" factor; the larger the value, the shorter the execution time. Therefore, automatic scheduling optimization systems utilize the formula... =1- (Or take the reciprocal and normalize) to transform it into a "cost-type" feature.

[0104] The aligned feature vectors are: Sample A (Computational): =[0.9,0.4,0.2]; The change from 0.8 to 0.2 indicates a high degree of vectorization with extremely low cost. Sample B (memory access type): =[0.2,0.8,0.6]; The change from 0.4 to 0.6 indicates a lower degree of vectorization, resulting in a higher cost.

[0105] Calculate the "virtual time score" for each sample using dynamic weights and assign real time to it.

[0106] 1) Calculate the overall score: Sample A score:

[0107] Sample B score:

[0108] 2) Softmax nonlinear mapping: To simulate the nonlinearity of performance distribution, Softmax is introduced to calculate the contribution ratio of time consumption:

[0109]

[0110]

[0111] 3) Calculate the allocation ratio:

[0112]

[0113] 4) Generate virtual label samples: The real 100 Total time is allocated proportionally:

[0114]

[0115] The system measures 100μs to complete the entire subgraph on the hardware. However, when extracting features, the system extracts them for each specific inner layer computation (Sample A and Sample B). Because traditional TVM does not know which of Sample A and Sample B takes longer, it directly labels Sample A as "100μs" and Sample B as "100μs", i.e., Label(A)=100, Label(B)=100.

[0116] In reality, the computationally intensive Sample A and the memory-intensive Sample B contribute completely different amounts to those 100μs. If we force the machine learning model to believe that Sample A takes 100μs and Sample B also takes 100μs, we are essentially feeding the model incorrect "noise labels."

[0117] Therefore, step S3 (non-linear allocation based on Softmax) in this embodiment is specifically designed to break this brute-force replication. It calculates the combined score of the two samples and proportionally "divides" the total time of 100μs, resulting in Sample A receiving 47.15μs and Sample B receiving 52.85μs, totaling exactly 100μs.

[0118] Step S4: Confidence Verification In the generated virtual label sample ( , )and( , Before training the cost model, the automatic scheduling optimization system must prevent contamination by "illusion labels" through a confidence checker. Since there are no historical samples, this embodiment triggers Mode B (mechanism-based structure-preserving surrogate check).

[0119] 1) Physical boundary verification for Sample A (computation-intensive) Building a micro-benchmark and extrapolating: The system extracts the arithmetic strength of Sample A. Using the Roofline model of the target NVIDIA GPU, combined with the total number of floating-point instructions of Sample A and the GPU's peak computing power (Peak FLOPS), its physical limit time is extrapolated. Assume the calculated theoretical minimum execution time is 15 seconds. .

[0120] Verdict: The automatic scheduling optimization system compares the generated virtual labels with the theoretical lower limit. Because... >15 Furthermore, since the difference in magnitude is within a reasonable range, the automatic scheduling and optimization system determines that the label does not violate the laws of physics, and the verification passes.

[0121] 2) Physical boundary verification for Sample B (memory-intensive) Building a micro-benchmark and extrapolation: Sample B primarily involves data movement and padding. The automatic scheduling optimization system utilizes the memory bandwidth-constrained region of the Roofline model, combined with the total memory access volume of Sample B and the peak memory bandwidth of the GPU, to extrapolate its physical limit latency. Assuming the calculated theoretical minimum latency due to bandwidth limitations is 25 seconds... .

[0122] Verdict: Comparing virtual tags, >25 The allocation result reasonably reflects the latency caused by the memory access bottleneck, and the verification passed.

[0123] 3) Counterexample: If the Softmax calculation is incorrect, resulting in New Label A=5 If 5 < 10, the system will determine it as "physically infeasible" and discard the data to prevent contamination of the model.

[0124] Step S5: Closed-loop iteration and model update Mixed data: data that has passed validation ( , )and( , Add it to the training set.

[0125] Model training: Train a new cost model using XGBoost.

[0126] Result: The model dynamically captured the severe memory access penalty of Sample B (which was allocated...). In the next round of search, the genetic algorithm no longer blindly allocates all computing resources to Sample A for cyclic block division, but begins to automatically explore memory access optimization strategies for Sample B, such as memory layout transformation and vectorized filling optimization.

[0127] This invention presents an automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting and confidence verification. By introducing a hardware-software combined adaptive feature weighting mechanism, it dynamically adjusts the feature importance weights using real-world hardware test feedback (Spearman rank correlation coefficient), overcoming the rigidity and lack of physical semantics inherent in traditional static feature evaluation. Simultaneously, in conjunction with a Softmax-based nonlinear label redistribution strategy, it accurately and reasonably distributes the overall real time consumption of the subgraph to various fine-grained scheduling samples, fundamentally eliminating the "noise label" problem caused by the crude replication of total time consumption during cost model training. Furthermore, by combining the Roofline model to calculate physical limits, it rigorously filters out abnormal "virtual labels" that violate computing power or bandwidth laws, achieving closed-loop verification of virtual labels.

[0128] The above embodiments prepared by the method of the present invention are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.

[0129] The endpoints and any values ​​of the ranges disclosed herein are not limited to the precise ranges or values, and these ranges or values ​​should be understood to include values ​​close to these ranges or values. For numerical ranges, the endpoint values ​​of the various ranges, the endpoint values ​​of the various ranges and individual point values, and individual point values ​​can be combined with each other to obtain one or more new numerical ranges, which should be considered as specifically disclosed herein.

Claims

1. An automatic scheduling optimization method for a deep learning compiler based on adaptive feature weighting, wherein the automatic scheduling optimization method is executed based on an automatic scheduling optimization system, and the deep learning compiler has a built-in cost model, characterized in that, Includes the following steps: In the t-th iteration of the cost model, the comprehensive dynamic feature weights are calculated according to the following formula. : ; In the formula, This is the comprehensive dynamic feature weight calculated for the i-th feature in the t-th iteration of the cost model; i is the dimension index of the feature. For feature i, the importance index value is based on the weight. The importance index value of feature i based on gain; The value of feature i is based on the importance index of coverage; For the corresponding Weighting coefficients; For the corresponding Weighting coefficients; For the corresponding Weighting coefficients; The cost model predicts the Top-K scheduling scheme in the (t-1)th iteration and its actual hardware test ranking. The Spearman rank correlation coefficient between the predicted ranking and the actual test ranking is calculated and denoted as... R and based on R With low threshold and high threshold The weighting coefficients are corrected based on the comparison relationship; like R < Then reduce the gain weighting coefficient. Increase coverage weight coefficient ;like R > Then increase the gain weighting coefficient. Reduce coverage weight coefficient ;like ≤ R ≤ If so, then the current weighting coefficients will be maintained; Based on the corrected comprehensive dynamic feature weights The overall score of the scheduling scheme is calculated using the following formula. : ; In the formula, j is the index of the current scheduling scheme being processed; i is the dimension index of the feature; N is the total number of all features; Val j,i Let j be the value of the j-th scheduling scheme on the i-th feature; Based on the overall score Calculate the time contribution ratio of each scheduling scheme and obtain virtual label samples; The virtual label samples are verified, and the verified virtual label samples are merged with the historically accumulated real hardware measurement samples to construct a hybrid training dataset. The cost model is then updated and closed-loop iterated.

2. The automatic scheduling optimization method according to claim 1, characterized in that, , , Obtained through the following steps: The automatic scheduling optimization system checks whether there is historical data for the current hardware architecture; if so, it extracts representative scheduling schemes and corresponding performance tag data from the historical data. If no historical data is available, a randomly generated scheduling scheme will be used and the corresponding performance tag data will be obtained using a hardware simulator. For each scheduling scheme, the automatic scheduling optimization system traverses its syntax tree to extract feature vectors, standardizes all feature vectors, and maps all feature values ​​to the same interval. The cost model was pre-trained using the processed sample set, and the normalized values ​​of the three basic feature importance indices were calculated. , , ; the i-th feature , , That is , .

3. The automatic scheduling optimization method according to claim 1, characterized in that, Comprehensive dynamic feature weights In the calculation formula, .

4. The automatic scheduling optimization method according to claim 1 or 3, characterized in that, Each time the weight coefficients are corrected, α, β, and γ need to be normalized again so that their sum is 1.

5. The automatic scheduling optimization method according to claim 1, characterized in that, The Spearman rank correlation coefficient between predicted rankings and actual test rankings is calculated using the following formula: R= ; In the formula, d j d represents the difference in ranking between the two rankings of the j-th scheduling scheme; j = Predicted ranking - Actual test ranking; K is the total number of samples for the Top-K scheduling scheme.

6. The automatic scheduling optimization method according to claim 1, characterized in that, Based on the overall score Calculating the time contribution ratio of each scheduling scheme and obtaining virtual label samples involves the following steps: The time contribution ratio of each scheduling scheme is calculated using the following formula. : ; In the formula, j is the index of the currently assigned scheduling scheme, u is the local index used to traverse all scheduling schemes within the subgraph, and M is the total number of scheduling schemes divided within the current subgraph. The virtual labels corresponding to the time consumption are generated according to the following formula and assigned to each scheduling scheme sample to obtain virtual label samples: ; In the formula, This represents the actual time taken for the entire subgraph.

7. The automatic scheduling optimization method according to claim 1, characterized in that, The verification of the virtual label sample includes the following steps: selecting a first mode for verification of the virtual label sample: Retrieve candidate historical samples whose cosine similarity to the virtual label sample to be verified is higher than a set threshold; If multiple candidate historical samples meet the criteria, the cosine similarity score is used as the weight to calculate a weighted average of the actual time consumption of the candidate historical samples, resulting in the set of actual time consumption for the retrieved candidate historical samples. The corresponding cosine similarity is Then the historical true value = In the formula, h is the index of the retrieved candidate historical samples; H is the total number of candidate historical samples with a cosine similarity higher than the set threshold. Let be the cosine similarity between the h-th candidate historical sample and the virtual label sample to be verified; The actual time taken for the h-th candidate historical sample; If only one candidate historical sample meets the criteria, then the actual time consumption of that candidate historical sample is directly used as the historical true value. ; Compare the virtual label sample to be verified with historical real values. ;like , If the relative deviation tolerance threshold is used, the virtual label sample to be verified is determined to be abnormal.

8. The automatic scheduling optimization method according to claim 1, characterized in that, Validating the virtual label sample includes the step of selecting a second mode for validation of the virtual label sample: The theoretical limit of time required to calculate the virtual label sample to be verified The automatic scheduling optimization system presets a physical feasibility verification interval. , ],in To account for the lower limit tolerance factor of measurement noise, The upper limit of the discrete coefficients to prevent feature collapse; Substitute the virtual label sample to be verified into this interval for comparison. < If so, it is determined that the virtual label sample to be verified has overflowed the lower boundary; if > If the upper boundary overflow occurs, the virtual tag sample to be verified is determined to have overflowed. When any overflow condition is met, the automatic scheduling and optimization system explicitly determines that the virtual tag sample to be verified is physically infeasible and discards or filters it as abnormal data.

9. The automatic scheduling optimization method according to claim 1, characterized in that, Verifying the virtual tag includes the step of selecting a first mode or a second mode: For virtual label samples to be verified, the automatic scheduling and optimization system will trigger the first mode by default. If and only if the automatic scheduling and optimization system is in a cold start state, or if no historical samples with a cosine similarity higher than the set threshold can be found in the historical data, the automatic scheduling and optimization system will determine that the first mode has failed and automatically downgrade to trigger the second mode.

10. The automatic scheduling optimization method according to claim 1, characterized in that, The updating and closed-loop iteration of the cost model includes the following steps: The cost model is incrementally trained using a mixed training dataset to update the structure of the decision tree and the weights of the leaf nodes, resulting in the updated cost model. Using the updated cost model as the fitness evaluation function, we run an evolutionary search algorithm or a simulated annealing algorithm in the scheduling search space; we select the top-K scheduling schemes with the best prediction performance, and mix in randomly generated effective scheduling schemes outside the top-K; The selected Top-K schemes and randomly generated effective scheduling schemes are code-generated and compiled, and actual performance tests are conducted on the target hardware to obtain the real test rankings; Determine whether the termination condition is met; If the conditions are not met, the actual test ranking of this round will be fed back into the calculation of the Spearman rank correlation coefficient, and the t+1th iteration of the cost model will begin.

11. An automatic scheduling optimization system for performing the automatic scheduling optimization method according to any one of claims 1-10.

12. The automatic scheduling optimization system according to claim 11, characterized in that, include: The compiler front-end module receives deep learning models, converts them into intermediate representations, performs operator fusion and subgraph partitioning, and performs hierarchical sampling based on operator structural features to generate representative candidate scheduling schemes. Feature extraction module: This module is used to standardize the features extracted from candidate scheduling schemes, mapping all feature values ​​to the same interval to eliminate the influence of units. Adaptive weighted controller: Real-time acquisition of the Spearman rank correlation coefficient R between the actual test ranking of the hardware in the previous round and the predicted ranking of the cost model, and dynamically increase or decrease the gain weight coefficient and coverage weight coefficient based on the comparison relationship between R and the preset threshold. Label reassignment module: Based on the real-time weight coefficients output by the adaptive weighted controller, the overall performance index of the subgraph is reassigned to each scheduling scheme sample within the subgraph, generating virtual label samples; Confidence validator: Used to verify the validity of generated virtual label samples; Cost model training module: Trains the cost model using the validated dataset.