Duration prediction methods, devices, equipment, storage media, and program products
By identifying the operator and environment features of the target computation operator in the deep learning model and combining the performance feature relationship to obtain performance data, the problem of insufficient accuracy in duration prediction in the deep learning model is solved, and more accurate duration prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, computation time prediction methods based on deep learning models assume that operators with the same computational load have similar computational efficiency, resulting in low accuracy in time prediction and an inability to adapt to performance differences between different operators.
By determining the operator characteristics and environmental characteristics of the target computation operator, and combining the performance characteristic relationships, target performance data is obtained, and prediction time information is determined based on the computational complexity parameter, thereby improving the accuracy of duration prediction.
By combining operator features and environmental features, a relationship between performance features is constructed to ensure the rationality and accuracy of performance data, thereby improving the accuracy of duration prediction.
Smart Images

Figure CN121958052B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a duration prediction method, apparatus, device, storage medium, and program product. Background Technology
[0002] With the continuous development of deep learning technology in the field of artificial intelligence, in order to better supervise the deep learning process, methods have emerged to predict the computation time required for artificial intelligence models to process computational tasks.
[0003] In related technologies, it is generally assumed that operators with similar computational loads within a deep learning model have similar computational efficiencies. Therefore, the computational efficiency of a given operator can be determined directly based on its computational load when the deep learning model processes a computational task. Then, by combining the computational efficiency of each operator, the time required to process the computational task can be predicted.
[0004] However, when deep learning models process computational tasks, different computational operators with the same computational cost may correspond to completely different performance characteristics (such as thin matrices and square matrices). Therefore, using related techniques to directly link computational cost with computational efficiency will reduce the accuracy of duration prediction. Summary of the Invention
[0005] Therefore, it is necessary to provide a duration prediction method, apparatus, device, storage medium, and program product that can improve the accuracy of duration prediction in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a duration prediction method, including:
[0007] Determine the target operator features of the target computation operator and obtain the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator;
[0008] Based on the performance characteristic relationship, as well as the target operator feature and target environment feature of the target computation operator, the target performance data corresponding to the target computation operator is determined; wherein, the performance characteristic relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature;
[0009] Based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computation task is determined.
[0010] In one embodiment, determining the target performance data corresponding to the target computation operator based on the performance feature relationship, as well as the target operator features and target environment features of the target computation operator, includes: querying the performance feature relationship using the target feature of the target computation operator as an index; wherein the target features include target operator features and target environment features; if a target correspondence relationship is found, the candidate performance data in the target correspondence relationship is used as the target performance data corresponding to the target computation operator; wherein the candidate features in the target correspondence relationship are the same as the target features; if no target correspondence relationship is found, the target performance data corresponding to the target computation operator is determined based on the similarity between the target features and each candidate feature.
[0011] In one embodiment, determining the target performance data corresponding to the target computation operator based on the similarity between the target feature and each candidate feature includes: determining the similarity between the target feature and each candidate feature; if similar features exist, determining the target performance data corresponding to the target computation operator based on the candidate performance data corresponding to the similar features; wherein, the similar features are candidate features whose similarity to the target feature is greater than a similarity threshold; if no similar features exist, using the standard performance data as the target performance data corresponding to the target computation operator.
[0012] In one embodiment, when there are at least two similar features, the target performance data corresponding to the target computation operator is determined based on the candidate performance data corresponding to the similar features, including: sorting each similar feature in descending order according to the similarity corresponding to each similar feature; and determining the target performance data corresponding to the target computation operator based on the average of the candidate performance data corresponding to the first preset number of similar features.
[0013] In one embodiment, determining the target performance data corresponding to the target computation operator based on the candidate performance data corresponding to similar features includes: performing linear regression processing on the similar features and the candidate performance data corresponding to the similar features to obtain a target fitting curve; wherein the target fitting curve is used to describe the relationship between the features and the performance data; and determining the target performance data corresponding to the target computation operator based on the target fitting curve and the target features.
[0014] In one embodiment, determining the prediction time information of the computing task based on the computational complexity parameters and target performance data of the target computing operator includes: determining the runtime of the target computing operator based on the computational complexity parameters and target performance data of the target computing operator; and determining the prediction time information of the computing task based on the runtime of the target computing operator.
[0015] In one embodiment, the target performance data includes throughput, and the computational complexity parameter includes the amount of data to be read and written during the operation of the target computational operator; the runtime of the target computational operator is determined based on the computational complexity parameter and the target performance data, including: determining the runtime of the target computational operator based on the ratio between the amount of data and the throughput.
[0016] In one embodiment, the target performance data includes computational efficiency, and the computational complexity parameter includes the amount of computation during the operation of the target computational operator; the runtime of the target computational operator is determined based on the computational complexity parameter and the target performance data, including: determining the product between the computational efficiency and the nominal computing power of the hardware on which the target computational operator is running; and determining the runtime of the target computational operator based on the ratio between the amount of computation and the product.
[0017] In one embodiment, the target operator features include the operator type, input-output features, and data processing features of the target computation operator.
[0018] In one embodiment, the performance feature relationship is constructed as follows: obtaining candidate operator features of different candidate computation operators; for each candidate computation operator, determining candidate performance data based on the runtime log data of the candidate computation operator running on candidate hardware; and constructing the performance feature relationship based on the candidate operator features, candidate performance data, and runtime candidate environment features of different candidate computation operators.
[0019] In one embodiment, obtaining candidate operator features for different candidate computation operators includes: displaying a parameter configuration page to the operation and maintenance party and obtaining the range of operator features input by the operation and maintenance party based on the parameter configuration page; and generating candidate operator features for different candidate computation operators based on the range of operator features.
[0020] In one embodiment, the method further includes: obtaining the actual time information of the computation task; and updating the performance feature relationship based on the actual performance data of the target computation operator running under the target environment features when the time difference between the predicted time information and the actual time information is greater than a time threshold.
[0021] Secondly, this application also provides a duration prediction device, comprising:
[0022] The data acquisition module is used to determine the target operator features of the target computation operator and acquire the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator;
[0023] The performance determination module is used to determine the target performance data corresponding to the target computation operator based on the performance feature relationship, as well as the target operator feature and the target environment feature of the target computation operator. The performance feature relationship includes the correspondence between different candidate features and different candidate performance data. Each candidate feature includes a candidate operator feature and a candidate environment feature. Each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature.
[0024] The time prediction module is used to determine the prediction time information of the computing task based on the computational complexity parameters of the target computing operator and the target performance data.
[0025] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0026] Determine the target operator features of the target computation operator and obtain the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator;
[0027] Based on the performance characteristic relationship, as well as the target operator feature and target environment feature of the target computation operator, the target performance data corresponding to the target computation operator is determined; wherein, the performance characteristic relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature;
[0028] Based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computation task is determined.
[0029] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0030] Determine the target operator features of the target computation operator and obtain the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator;
[0031] Based on the performance characteristic relationship, as well as the target operator feature and target environment feature of the target computation operator, the target performance data corresponding to the target computation operator is determined; wherein, the performance characteristic relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature;
[0032] Based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computation task is determined.
[0033] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0034] Determine the target operator features of the target computation operator and obtain the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator;
[0035] Based on the performance characteristic relationship, as well as the target operator feature and target environment feature of the target computation operator, the target performance data corresponding to the target computation operator is determined; wherein, the performance characteristic relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature;
[0036] Based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computation task is determined.
[0037] The aforementioned duration prediction methods, apparatus, devices, storage media, and program products introduce performance feature relationships, including the correspondence between different candidate features and different candidate performance data. By determining the target operator features of the target computational operator and acquiring the target environment features of the target computational operator, and based on the performance feature relationships, as well as the target operator features and target environment features, the target performance data corresponding to the target computational operator is determined. Then, based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computation task is determined. Compared to related technologies that determine the performance data of the computational operator solely based on the mapping relationship between computational load and performance features, the above method, by determining the target performance data corresponding to the target computational operator based on performance feature relationships, combined with the target operator features and target environment features of the target computational operator, ensures the rationality and accuracy of the target performance data determination, laying the foundation for the accuracy of subsequent duration prediction processing; that is, it effectively improves the accuracy of duration prediction processing. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is an internal structural diagram of a computer device in one embodiment;
[0040] Figure 2 This is a flowchart illustrating a duration prediction method in one embodiment;
[0041] Figure 3 This is a flowchart illustrating the process of determining target performance data in one embodiment;
[0042] Figure 4 This is a flowchart illustrating the process of determining target performance data in another embodiment;
[0043] Figure 5 This is a flowchart illustrating the process of determining prediction time information in one embodiment;
[0044] Figure 6 This is a flowchart illustrating the process of constructing performance characteristic relationships in one embodiment;
[0045] Figure 7 This is a flowchart illustrating the process of obtaining candidate operator features in one embodiment;
[0046] Figure 8This is a flowchart illustrating the duration prediction method in another embodiment;
[0047] Figure 9 This is a structural block diagram of a duration prediction device in one embodiment. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] With the continuous development of deep learning technology in the field of artificial intelligence, in order to better supervise the deep learning process, methods have emerged to predict the computation time required for artificial intelligence models to process computational tasks.
[0050] In related technologies, it is generally assumed that operators with similar computational loads within a deep learning model have similar computational efficiency. Therefore, the computational efficiency of a given operator can be determined directly based on its computational load when the deep learning model processes a computational task. For example, multiple computational load threshold ranges can be predefined, and a fixed computational efficiency value can be assigned to each range. For instance, when the computational load is >128 TFLOPs, the computational efficiency is 0.95; when the computational load is <16 TFLOPs and ≤128 TFLOPs, the efficiency is 0.90; and when the computational load is ≤16 TFLOPs, the efficiency is 0.85. Then, by combining the computational efficiency of each operator, the time required to process the computational task can be predicted.
[0051] However, when deep learning models process computational tasks, different computational operators with the same computational cost may correspond to completely different performance characteristics (such as thin matrices and square matrices). Therefore, using related techniques to directly link computational cost with computational efficiency will reduce the accuracy of duration prediction.
[0052] Based on this, this application provides a duration prediction method that combines the operator characteristics of the computation operator with the environmental characteristics of the operating environment to determine the performance data of the computation operator, thereby ensuring the accuracy of the performance data determination and improving the accuracy of duration prediction.
[0053] The duration prediction method provided in this application can be applied to computer devices. The computer device can be a server, and its internal structure diagram can be as follows: Figure 1As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores performance data of various computational operators under different operating environments. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a duration prediction method.
[0054] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0055] In one exemplary embodiment, such as Figure 2 As shown, a duration prediction method is provided, which includes:
[0056] S201, determine the target operator characteristics of the target computation operator, and obtain the target environment characteristics of the target computation operator.
[0057] The target computation operator refers to the computation operator involved in the target model that processes the computation task. There can be one or more. The target model can be any model with deep learning capabilities, such as a Large Language Model (LLM), a Convolutional Neural Network (CNN), or a Transformer model with self-attention mechanism.
[0058] The so-called target operator features are the characteristics that characterize the computational capabilities of the target computational operator at runtime. For example, target operator features may include, but are not limited to, the operator type, input-output features, and data processing features of the target computational operator. Specifically, the operator type is used to distinguish the computational functions of each computational operator, such as convolution operators, matrix multiplication operators, etc. Input-output features are used to define the format of the input data received by the computational operator, the form of the output data, and the mapping relationship between input and output, and may include, but are not limited to, data dimension (tensor shape) features and data types. Data processing features describe the transformation rules, computational process, optimization strategies, etc., of the computational operator on the input data, and may include, but are not limited to, data processing methods and data computation rules.
[0059] The so-called target environment characteristics refer to the environmental characteristics of the runtime environment in which the target computation operator runs. Furthermore, the target environment characteristics include at least the hardware environment characteristics of the hardware running the target computation operator. For example, these may include, but are not limited to, the hardware environment characteristics of the hardware on which the target computation operator resides (e.g., hardware model), the software environment characteristics supporting the operation of the target computation operator (e.g., driver version, computation library version), and the combined hardware and software environment characteristics (e.g., power consumption limits, graphics processing unit (GPU) frequency status).
[0060] Optionally, when the target model processes computational tasks, the target operator features of each target computational operator involved in the computational task within the target model can be determined separately. Specifically, for each target computational operator, a simulation tool with feature extraction capabilities can be used to obtain the single feature data of that target computational operator in each data dimension in real time.
[0061] For example, when the target computation operator is a General Matrix Multiplication (GEMM) operator, simulation tools can be used to obtain single feature data of the GEMM operator, such as the shape triples (M, N, K), data type, transpose flag, and batch size. Here, M, N, and K represent the number of rows and columns of the input and output matrices, respectively. Assuming the input matrices are A and B, and the output matrix is C, M represents the number of rows in input matrix A and output matrix C; K represents the number of columns in input matrix A, which is also the number of rows in input matrix B, and is the common dimension of the multiplication of the two matrices; N represents the number of columns in input matrix B, which is also the number of columns in output matrix C. Alternatively, when the target computation operator is a convolution operator, simulation tools can be used to obtain single feature data of the convolution operator, such as the number of input and output channels, kernel size, stride, and padding.
[0062] Furthermore, based on a preset concatenation logic, single feature data from each data dimension can be concatenated to obtain the multidimensional feature data of the target computation operator. Then, feature extraction processing can be performed on the multidimensional feature data of the target computation operator to obtain the target operator features. For example, a preset encoding method can be used to encode the multidimensional feature data to obtain the target operator features.
[0063] For example, for the GEMM operator processing BF16 type data, if the operator shape of the computation operator is [8,2048,12288,4096] and the transpose processing flag is "false", the target operator feature can be "gemm_bf16_8_2048_12288_4096_F_F". Here, "F_F" represents the transpose processing flag "false".
[0064] Optionally, when the target model is processing computational tasks, the target environment characteristics of the runtime environment of each target computational operator can be obtained in real time through the Application Programming Interface (API) / code interface. For example, the hardware model, driver version, computation library version, power consumption limits, GPU frequency status, etc. of the runtime environment of the computational operator can be obtained in real time.
[0065] S202, based on the performance characteristic relationship, as well as the target operator characteristics and target environment characteristics of the target computation operator, determine the target performance data corresponding to the target computation operator.
[0066] The performance characteristic relationships include the correspondence between different candidate features and different candidate performance data. Each candidate feature includes a candidate operator feature and a candidate environment feature. A candidate operator feature is the operator feature corresponding to different computational operators; further, a candidate computational operator is the computational operator represented by different candidate operator features. A candidate environment feature is the environment feature of the computational operator in different operating environments. Each candidate performance data point represents the actual performance data when running the candidate computational operator corresponding to the candidate operator feature under the candidate environment feature.
[0067] Performance data is used to characterize the computational performance of a computational operator, and may include, but is not limited to, the operator's throughput and computational efficiency. The throughput of a computational operator is the amount of data successfully processed by the operator per unit time. The computational efficiency of a computational operator is the ratio of the operator's actual computing power to the theoretical peak computing power of the hardware. Target performance data refers to the performance data of the target computational operator during runtime.
[0068] Understandably, in order to ensure the rationality of the performance data of each computational operator, the performance characteristic relationship can be constructed by combining the actual performance data of different candidate computational operators running in different candidate operating environments.
[0069] Optionally, the target performance data corresponding to the target operator features and target environment features of the target computation operator can be analyzed by combining the performance characteristic relationship.
[0070] For example, performance feature relationships can be presented in the form of a database, that is, the correspondence between each candidate feature and candidate performance data is treated as a key-value pair. Then, the target features of the target computational operator (i.e., target operator features and target environment features) can be used to query each key-value pair, and the candidate performance data that matches the key-value pair can be used as the target performance data.
[0071] Alternatively, by combining the correspondences within the performance feature relationships, the linear correspondence between candidate features and candidate performance data can be analyzed; then, by combining the linear correspondences and the target features, the target performance data corresponding to the target computation operator can be calculated.
[0072] S203, Based on the computational complexity parameters of the target computational operator and the target performance data, determine the prediction time information of the computation task.
[0073] The computational complexity parameter quantifies the hardware resource requirements of the target computational operator during its operation. This may include, but is not limited to, the amount of computation required during the operation of the target computational operator, and the amount of data read and written during the operation. The predicted time information refers to the predicted information related to the execution time of the computation task. For example, this may include, but is not limited to, the task completion time of the target computational operator, and the runtime required to process the computation task.
[0074] Optionally, the corresponding time prediction logic can be determined based on the data type of the target performance data; then, the computational complexity parameters of the target performance data and the target computational operator can be processed according to the time prediction logic to obtain the prediction time information of the computation task.
[0075] Alternatively, different sample performance data, sample complexity parameters, and corresponding sample time information can be used to train the neural network model, resulting in a time prediction model with time information prediction capabilities. Then, the computational complexity parameters and target performance data of the target computation operators are input into the time prediction model, which then outputs the predicted time information for each target computation operator in the computation task based on the computational complexity parameters and target performance data.
[0076] Understandably, compared to traditional methods that only segment by computational load, this embodiment combines the specific characteristics of computational operators to determine performance data, thus achieving an improvement in the accuracy of performance data from coarse-grained to fine-grained. Furthermore, compared to traditional methods that calculate performance data based on theoretical peak computing power, this embodiment constructs performance characteristic relationships based on actually measured performance data, making the determined performance data closer to the actual performance.
[0077] The aforementioned duration prediction method introduces performance feature relationships, including the correspondence between different candidate features and different candidate performance data. It determines the target operator features of the target computational operator and obtains the target environment features of the target computational operator. Based on the performance feature relationships, the target operator features, and the target environment features, it determines the target performance data corresponding to the target computational operator. Then, based on the computational complexity parameters of the target computational operator and the target performance data, it determines the prediction time information of the computation task. Compared to related technologies that determine the performance data of the computational operator solely based on the mapping relationship between computational quantity and performance features, the above method, by determining the target performance data corresponding to the target computational operator based on performance feature relationships and combining the target operator features and target environment features, ensures the rationality and accuracy of the target performance data determination. This lays the foundation for the accuracy of subsequent duration prediction processing, effectively improving the accuracy of duration prediction processing.
[0078] As can be seen from the foregoing embodiments, determining target performance data requires considering performance characteristic relationships. Based on this, the following embodiment details the specific process of determining target performance data by considering performance characteristic relationships, such as... Figure 3 As shown, the specific steps include:
[0079] S301, using the target features of the target computation operator as an index, performs a query in the performance feature relationship.
[0080] The target features include target operator features and target environment features.
[0081] Optionally, the target operator features and target environment features of the target computation operator can be concatenated according to a preset concatenation logic to obtain target features. Then, the target features are used as index information to perform query processing in the corresponding relationships contained in the performance feature relationships to obtain query results.
[0082] S302. Based on the query results, determine whether the target relationship has been found. If yes, proceed to step S303; otherwise, proceed to step S304.
[0083] The so-called target correspondence is the correspondence within the performance feature relationship, and the candidate features in the target correspondence are the same as the target features.
[0084] Optionally, if the query result shows that the target corresponding relationship is found in the performance feature relationship, it proves that there is a corresponding relationship in the performance feature relationship that completely matches the target feature. In this case, the following step S303 can be executed.
[0085] If the query result shows that no corresponding relationship of the target is found in the performance feature relationship, it proves that there is no corresponding relationship that completely matches the target feature in the performance feature relationship. At this time, the following step S304 can be executed.
[0086] S303, the candidate performance data in the target correspondence is used as the target performance data corresponding to the target calculation operator.
[0087] Optionally, when there is a target correspondence in the performance feature relationship that completely matches the target feature, since the candidate performance data in the target correspondence is the actual performance data of the computational operator that has the same operator features as the target computational operator and runs under the same environmental features, the candidate performance data in the target correspondence has strong reference value for the target computational operator. In this case, the candidate performance data in the target correspondence can be directly used as the target performance data corresponding to the target computational operator.
[0088] S304. Based on the similarity between the target feature and each candidate feature, determine the target performance data corresponding to the target computation operator.
[0089] The similarity refers to the degree of similarity between the target feature and the candidate feature. Specifically, the greater the similarity, the higher the similarity between the target feature and the candidate feature, and the greater the reference value of the candidate performance data corresponding to the candidate feature for the target computation operator; the smaller the similarity, the lower the similarity between the target feature and the candidate feature, and the less reference value of the candidate performance data corresponding to the candidate feature for the target computation operator.
[0090] Based on this, when there is no target correspondence in the performance feature relationship that completely matches the target feature, a preset similarity algorithm can be used to determine the similarity between the candidate feature and the target feature for each candidate feature in the performance feature relationship.
[0091] In one alternative implementation, the candidate feature with the highest similarity can be determined based on the similarity between the target feature and each candidate feature, and the candidate performance data corresponding to the candidate feature with the highest similarity can be used as the target performance data corresponding to the target computation operator.
[0092] In another optional implementation, the candidate features can be sorted in descending order based on the similarity between the target feature and each candidate feature. Then, a predetermined number of candidate features at the top of the sorted list are used as reference features. Further, a weight value corresponding to each reference feature can be determined based on the similarity of each reference feature. This weight value is then used to weight the candidate performance data corresponding to each reference feature, thereby obtaining the target performance data corresponding to the target computation operator. The higher the similarity, the larger the weight value, and the sum of the weight values corresponding to each reference feature is 1.
[0093] In this embodiment of the application, by selecting the method for determining the target performance data based on whether the performance characteristic relationship contains a target correspondence that completely matches the target characteristic, the flexibility and rationality of determining the target performance data can be improved.
[0094] As can be seen from the foregoing embodiments, when the performance feature relationship does not include the target correspondence, it is necessary to combine the similarity between the target feature and each candidate feature to determine the target performance data. Based on this, the following embodiment details the specific process of determining the target performance data by combining similarity, as follows: Figure 4 As shown, the specific steps include:
[0095] S401, determine the similarity between the target feature and each candidate feature.
[0096] Optionally, for each candidate feature, a preset similarity calculation algorithm can be used to calculate the similarity between the target feature and the candidate feature. Alternatively, the neural network can be trained using the features of each sample and the true similarity between the features of each sample to obtain a similarity model. Then, for each candidate feature, the target feature and the candidate feature can be input into the similarity model, and the similarity model can output the similarity between the target feature and the candidate feature based on the target feature and the candidate feature.
[0097] S402, Based on the similarity between the target feature and each candidate feature, determine whether there are similar features among the candidate features. If yes, proceed to step S403; otherwise, proceed to step S404.
[0098] In this context, similar features are candidate features whose similarity to the target feature is greater than a similarity threshold. The similarity threshold is a numerical value that measures the degree of similarity. If the similarity of a candidate feature is greater than the threshold, it indicates a high degree of similarity between the candidate feature and the target feature; in this case, the candidate feature is considered a similar feature. If the similarity of a candidate feature is less than or equal to the threshold, it indicates a low degree of similarity between the candidate feature and the target feature. Furthermore, the similarity threshold can be a value set by those skilled in the art based on experience, or it can be determined based on a large amount of experimental data; this embodiment does not impose any limitations on this.
[0099] Optionally, for each candidate feature, the similarity between the target feature and the candidate feature can be compared with a similarity threshold. If the similarity of the candidate feature is greater than the similarity threshold, the candidate feature is determined to be a similar feature. By comparing the similarity of each candidate feature with the similarity threshold one by one, it can be determined whether there are similar features among the candidate features.
[0100] Furthermore, if it is determined that there are similar features among the candidate features, step S403 can be performed; if it is determined that there are no similar features among the candidate features, step S404 can be performed.
[0101] S403, Based on the candidate performance data corresponding to similar features, determine the target performance data corresponding to the target computation operator.
[0102] Optionally, if only one similar feature exists, the candidate performance data corresponding to that similar feature can be directly used as the target performance data corresponding to the target computation operator.
[0103] When multiple similar features exist, the weight value corresponding to each similar feature can be determined based on the similarity of each feature. Then, the candidate performance data corresponding to each similar feature is weighted using the weight values to obtain the target performance data corresponding to the target computation operator. The higher the similarity, the larger the weight value, and the sum of the weight values corresponding to all similar features is 1.
[0104] S404 uses standard performance data as the target performance data corresponding to the target computation operator.
[0105] The so-called standard performance data refers to pre-configured fixed performance data. Standard performance data can be performance data set by those skilled in the art based on experience, or it can be conventional performance data determined based on a large amount of experimental data. This embodiment does not impose any restrictions on this.
[0106] Optionally, if the performance characteristic relationship does not include similar characteristics, the preset standard performance data can be directly used as the target performance data corresponding to the target calculation operator.
[0107] It is worth noting that if similar features are not included in the performance feature relationship, the target features of the target computation operator and the actual performance data of the target computation operator running under the target environment features can be constructed as a new correspondence and added to the performance feature relationship.
[0108] In this embodiment of the application, by selecting the method for determining the target performance data based on whether the performance feature relationship contains similar features with a high degree of similarity to the target feature, the method for determining the target performance data can be further refined, thereby improving the flexibility and rationality of the determination of the target performance data.
[0109] As can be seen from the foregoing embodiments, when the performance feature relationship includes similar features, it is necessary to combine the candidate performance data corresponding to the similar features to determine the target performance data. Based on this, the following embodiment refines the specific process of determining the target performance data when the number of similar features is at least two. Specifically, the similar features are sorted in descending order according to their similarity; the target performance data corresponding to the target calculation operator is determined based on the average of the candidate performance data corresponding to the first preset number of similar features.
[0110] The preset quantity can be a quantity set by those skilled in the art based on experience, or a quantity determined based on a large amount of experimental data. This embodiment does not impose any restrictions on this.
[0111] Optionally, similar features can be sorted in descending order of similarity, and the top preset number of similar features can be selected as candidate features. Then, the mean of the candidate performance data for each candidate feature can be calculated. For example, with a preset number of k, the top k similar features can be selected, and the mean of the candidate performance data for those k similar features can be calculated.
[0112] Furthermore, the mean of each candidate performance data can be directly used as the target performance data corresponding to the target calculation operator. Alternatively, a preset correction parameter can be used to correct the mean of each candidate performance data to obtain the target performance data corresponding to the target calculation operator. The correction parameter can be a parameter set by those skilled in the art based on experience, or a parameter determined based on a large amount of experimental data; this embodiment does not impose any restrictions on this.
[0113] In this application embodiment, when multiple similar features exist, a method for calculating target performance data is provided, which can improve the convenience of determining target performance data.
[0114] As can be seen from the foregoing embodiments, in order to ensure the accuracy of the target performance data determination, some embodiments provide another optional method for determining the target performance data. Specifically, linear regression processing is performed on similar features and candidate performance data corresponding to similar features to obtain the target fitting curve; based on the target fitting curve and target features, the target performance data corresponding to the target calculation operator is determined.
[0115] The target fitting curve is used to describe the relationship between features and performance data.
[0116] Optionally, based on a preset fitting curve type, linear regression processing can be performed on each similar feature and the corresponding candidate performance data to obtain a target fitting curve that includes the relationship between features and performance data. The fitting curve type can be a curve type selected by those skilled in the art based on experience, or a curve type determined based on a large amount of experimental data; this embodiment does not impose any restrictions on this.
[0117] Alternatively, to increase the amount of data in linear regression processing, linear regression can be performed on all correspondences contained in the performance feature relationships to obtain the target fitted curve.
[0118] Furthermore, after obtaining the target fitting curve, the target features can be substituted into the calculation formula represented by the target fitting curve to calculate the target performance data corresponding to the target calculation operator.
[0119] In this embodiment of the application, the target performance data corresponding to the target computation operator is determined by performing linear regression processing on similar features and candidate performance data corresponding to similar features, which can ensure the accuracy of the target performance data determination.
[0120] As can be seen from the foregoing embodiments, after determining the target performance data, it is also necessary to determine the prediction time information by considering the computational complexity of the target computational operator. Based on this, the following embodiment details the specific process for determining the prediction time information, such as... Figure 5 As shown, the specific steps include:
[0121] S501, determine the runtime of the target computation operator based on the computational complexity parameters and target performance data of the target computation operator.
[0122] The runtime is the total time required for the target computation operator to process the computation task.
[0123] Optionally, based on the data type of the target performance data, the corresponding duration calculation formula can be selected. Then, the computational complexity parameter of the target computation operator and the target performance data can be substituted into the selected duration calculation formula to obtain the runtime of the target computation operator.
[0124] Alternatively, a neural network model can be trained using different sample performance data, sample complexity parameters, and corresponding sample runtimes to obtain a runtime calculation model with runtime calculation capabilities. Then, the computational complexity parameters of the target computation operator and the target performance data are input into the runtime calculation model, which then outputs the runtime of the target computation operator based on the computational complexity parameters and the target performance data.
[0125] S502, determine the prediction time information of the computation task based on the runtime of the target computation operator.
[0126] Optionally, the runtime of the target computation operator can be processed by combining the information types contained in the prediction time information to obtain the prediction time information of the computation task.
[0127] For example, when the predicted time information is the task completion time of the computation task, the task completion time can be determined based on the runtime of the target computation operator and the task start time when the computation task is started.
[0128] In practical applications, the target model typically involves multiple target computation operators. In this case, the total processing time of the target task can be determined based on the runtime of each target computation operator. For example, the sum of the runtimes of each target computation operator can be used as the total processing time of the target task. Based on this, the completion time of the computation task can be determined based on the total processing time of the target task and the task start time. That is, the sum of the task start time and the total processing time is used as the completion time of the computation task.
[0129] In this embodiment of the application, by combining the runtime of the target computation operator to generate the prediction time information of the computation task, the rationality of the determination of the prediction time information can be guaranteed.
[0130] As can be seen from the foregoing embodiments, it is necessary to combine computational complexity parameters and target performance data to calculate the runtime of the target computational operator. Based on this, assuming that the target performance data includes throughput and the computational complexity parameters include the amount of data to be read and written during the operation of the target computational operator, an embodiment is provided to refine the specific process of calculating the runtime of the target computational operator. Specifically, the runtime of the target computational operator is determined based on the ratio between the amount of data and the throughput.
[0131] Optionally, a corresponding data volume calculation formula can be selected based on the operator type of the target computational operator. Then, the feature data of the target computational operator is substituted into the data volume calculation formula to calculate the data volume of the target computational operator. Furthermore, since the throughput of a computational operator is the amount of data successfully processed by the operator per unit time, the ratio between computational load and throughput can be used as the runtime of the target computational operator.
[0132] In this application embodiment, a method for determining runtime based on the data volume and throughput of the target computation operator is provided, which enriches the calculation method of runtime while ensuring the accuracy of runtime calculation.
[0133] Furthermore, given that the target performance data includes computational efficiency and the computational complexity parameter includes the amount of computation during the operation of the target computational operator, an embodiment is used to refine the specific process of calculating the runtime of the target computational operator. Specifically, the product between computational efficiency and the nominal computing power of the hardware on which the target computational operator is running is determined; and the runtime of the target computational operator is determined based on the ratio between the amount of computation and the product.
[0134] The so-called nominal hardware computing power is the theoretical peak computing power of the hardware where the target computing operator is located.
[0135] Optionally, since the computational efficiency of a computational operator is the ratio of the operator's actual computational power to the theoretical peak computational power of the hardware, the computational power of the target computational operator per unit time can be determined by multiplying the computational efficiency by the nominal computational power of the hardware on which the target computational operator resides. Here, computational power refers to the number of floating-point operations performed per unit time.
[0136] Furthermore, since the computational load is the floating-point operation required for the target computational operator to perform a complete operation, the ratio of the computational load of the target computational operator to the computing power per unit time can be used as the runtime of the target computational operator.
[0137] In this application embodiment, a method for determining runtime based on the computational load and computational efficiency of the target computational operator is provided, which enriches the calculation methods of runtime while ensuring the accuracy of runtime calculation.
[0138] As can be seen from the foregoing embodiments, it is necessary to combine the correspondence between multiple candidate features and candidate environment features to construct performance feature relationships. Based on this, the following embodiment details the specific process of constructing performance feature relationships, such as... Figure 6 As shown, the specific steps include:
[0139] S601, obtain the candidate operator features of different candidate computation operators.
[0140] Optionally, the operator features that appear in each model within a historical time period can be used as candidate operator features for different candidate computation operators. Alternatively, different candidate operator features can be automatically exported through the simulation framework.
[0141] S602 determines candidate performance data for each candidate computation operator based on the runtime log data of the candidate computation operator running on the candidate hardware.
[0142] Here, candidate hardware refers to the hardware that runs the candidate computation operators. Runtime log data refers to the log data generated during the runtime of the candidate computation operators, used to record the running status of the operators, and may include, but is not limited to, the actual runtime of the candidate computation operators, as well as the amount of data and computation involved. Candidate performance data may include, but is not limited to, candidate computation efficiency and candidate throughput.
[0143] Optionally, the performance data calculation formula can be determined based on the data type of the required candidate performance data; then, the performance data calculation formula can be used to process the running log data to obtain the candidate performance data.
[0144] For example, for each candidate computation operator, the candidate computation efficiency can be determined based on the actual runtime and computational load of the candidate computation operator on the candidate hardware, as well as the nominal computing power of the candidate hardware. Alternatively, for each candidate computation operator, the candidate throughput can be determined based on the actual runtime and data volume of the candidate computation operator on the candidate hardware.
[0145] In real-world scenarios, multiple candidate computational operators can be submitted at once. Then, the execution order of each candidate operator can be intelligently scheduled based on its characteristics. For example, candidate operators with lower computational complexity can be prioritized.
[0146] Furthermore, to ensure the reliability of candidate performance data, each candidate computation operator can be run multiple times at once. The candidate performance data and the confidence level of the candidate performance parameters are determined by combining the runtime log data from each run. For example, the same candidate computation operator can be run 10 times, and the candidate performance data for the last 5 runs can be calculated based on the runtime log data generated in those last 5 runs. Then, the candidate performance data for that computation operator can be determined based on the mean of the candidate performance data from the last 5 runs, and the confidence level of the candidate performance data can be calculated based on the standard deviation of the candidate performance data from the last 5 runs.
[0147] S603 constructs performance characteristic relationships based on the candidate operator characteristics, candidate performance data, and candidate environment characteristics of different candidate computation operators.
[0148] Optionally, for each candidate computation operator, the candidate operator features, candidate performance data, and candidate runtime environment features of that candidate computation operator can be constructed as a correspondence associated with that candidate computation operator; then, by combining the correspondence associated with each candidate computation operator, the performance feature relationship can be constructed.
[0149] It is worth noting that, to ensure the timeliness of performance feature relationships when constructing them, the runtime timestamps of candidate computation operators can be inserted into the correspondences associated with each candidate computation operator. Then, the correspondences within the performance feature relationships are iteratively updated by combining the runtime timestamps in each correspondence. For example, the correspondences in the performance features can be arranged chronologically based on their runtime timestamps; subsequently, correspondences with earlier runtime timestamps are deleted first.
[0150] Furthermore, by combining performance characteristic relationships, the performance variation patterns of different operator features on specific hardware can be analyzed. Specifically, for each candidate environment feature, based on the different candidate performance data corresponding to different candidate operator features under that candidate environment feature, the candidate operator features that cause performance bottlenecks under that candidate environment feature can be determined. Then, by combining the determined candidate operator features, the computational operators within the target model under that candidate environment feature can be optimized.
[0151] In this embodiment of the application, by constructing the performance characteristic relationship based on the actual running log data of the candidate computation operator on the candidate hardware, the rationality and accuracy of the performance characteristic relationship construction can be guaranteed.
[0152] As can be seen from the foregoing embodiments, different candidate operator features need to be obtained before constructing performance feature relationships. Based on this, the following embodiment details the specific process of obtaining candidate operator features, such as... Figure 7 As shown, the specific steps include:
[0153] S701 displays the parameter configuration page to the operations and maintenance personnel and obtains the operator feature range input by the operations and maintenance personnel based on the parameter configuration page.
[0154] In this context, the "operation and maintenance party" refers to the supervisory party that monitors the candidate operator feature generation process. The "parameter configuration page" is used to configure the range of operator features corresponding to candidate operator features, such as the matrix parameters of the multiplication matrix operator. The "operator feature range" is used to standardize the generation of candidate operator features; that is, the generated candidate operator features must fall within the specified range.
[0155] Optionally, a parameter configuration page can be displayed to the operations and maintenance (O&M) party via their terminal device. In this case, the O&M party can enter the required operator feature range on the parameter configuration page and click submit. The terminal device will then send the operator feature range to the server so that the server can obtain the operator feature range.
[0156] S702, Based on the range of operator features, generate candidate operator features for different candidate computation operators.
[0157] Optionally, operator features that fall within the range of operator features observed in each model over a historical period can be used as candidate operator features for different candidate computation operators. Alternatively, all reasonable candidate operator features within the range of operator features can be automatically exported through the simulation framework.
[0158] It is understandable that, compared to traditional methods that use general performance data, the personalized configuration of operator feature ranges in this embodiment, combined with the configured candidate operator features for actual hardware testing, enables the generated candidate performance data to achieve personalized adaptation.
[0159] In this embodiment of the application, by generating candidate operator features for different candidate computation operators based on the operator feature range defined by the operator, the richness of the generated candidate operator features can be guaranteed.
[0160] After determining the predicted time information for the computational task, it is also necessary to verify the reliability of the predicted time information. Based on this, the following embodiment details the specific process of reliability verification: First, obtain the actual time information of the computational task; second, if the time difference between the predicted time information and the actual time information exceeds a time threshold, update the performance characteristic relationship based on the actual performance data of the target computational operator running under the target environmental characteristics.
[0161] In this context, "real time information" refers to the actual time used to complete the entire computational task. "Time difference" refers to the degree of difference between the real time information and the predicted time information. "Time threshold" is a numerical value used to measure the magnitude of this difference; that is, a time difference greater than the time threshold indicates a larger degree of difference in the time prediction, while a time difference less than or equal to the time threshold indicates a smaller degree of difference in the time prediction. The time threshold can be a parameter set by those skilled in the art based on experience, or it can be a parameter determined based on a large amount of experimental data; this embodiment does not impose any limitations on this.
[0162] Optionally, after the computation task is completed, the actual time information of the computation task can be obtained from the operation log data of the computation task; then, the time difference between the predicted time information and the actual time information of the computation task can be used as the time difference.
[0163] Furthermore, when the time difference exceeds a time threshold, it demonstrates a significant discrepancy between the actual performance data of the target computational operator involved in the computational task and the corresponding candidate performance data in the performance feature relationship. In this case, the actual performance data from the computational task's runtime log can be used to update the corresponding candidate performance data in the performance feature relationship. For example, the actual performance data of the target computational operator involved in the computational task can be directly used to replace the corresponding candidate performance data in the performance feature relationship; alternatively, the target computational operator can be repeatedly run under the target environment characteristics, and new candidate performance data can be determined based on the actual performance data from multiple runs. This new candidate performance data can then replace the original candidate performance data in the performance feature relationship, thereby updating the performance feature relationship.
[0164] If the time difference is less than or equal to the time threshold, the reliability of the information prediction is high, and there is no need to update the performance feature relationship.
[0165] It is understandable that, compared to the fixed efficiency table in traditional methods, the performance characteristic relationship in this embodiment can be continuously updated to adapt to environmental changes.
[0166] In this embodiment of the application, by updating the performance feature relationship based on the time difference between the predicted time information and the actual time information, the reliability of the candidate performance data corresponding to the target feature in the performance feature relationship can be guaranteed, thereby improving the accuracy of subsequent duration prediction processing.
[0167] Figure 8 This is a flowchart illustrating the duration prediction method in another embodiment. Based on the above embodiments, this embodiment provides an optional example of the duration prediction method. (Combined with...) Figure 8 The specific implementation process is as follows:
[0168] S801, determine the target operator characteristics of the target computation operator, and obtain the target environment characteristics of the target computation operator.
[0169] The target computational operator refers to the computational operators involved in the target model for processing the computational task. The target environment characteristics include at least the hardware environment characteristics for running the target computational operator. The target operator characteristics include the operator type, input-output characteristics, and data processing characteristics of the target computational operator.
[0170] S802 uses the target operator features and target environment features of the target computation operator as indexes to perform queries in the performance feature relationships.
[0171] The performance characteristic relationships are constructed as follows: A parameter configuration page is displayed to the operations and maintenance (O&M) team, and the range of operator characteristics input by the O&M team based on the parameter configuration page is obtained. Based on the operator characteristic range, candidate operator characteristics for different candidate computational operators are generated. For each candidate computational operator, candidate performance data is determined based on the runtime log data of the candidate computational operator running on candidate hardware. Performance characteristic relationships are constructed based on the candidate operator characteristics of different candidate computational operators, the candidate performance data, and the runtime candidate environment characteristics.
[0172] S803, determine whether the target relationship has been found. If yes, proceed to S804; otherwise, proceed to S805.
[0173] In this context, the candidate features in the target correspondence are the same as the target features.
[0174] S804: The candidate performance data in the target correspondence is used as the target performance data corresponding to the target calculation operator. Then, S806 is executed.
[0175] S805: Determine the target performance data corresponding to the target computation operator based on the similarity between the target feature and each candidate feature.
[0176] Optionally, the similarity between the target feature and each candidate feature is determined; if similar features exist, the target performance data corresponding to the target computation operator is determined based on the candidate performance data corresponding to the similar features; if no similar features exist, the standard performance data is used as the target performance data corresponding to the target computation operator; wherein, the similar features are candidate features whose similarity to the target feature is greater than the similarity threshold.
[0177] In cases where there are at least two similar features, the similar features can be sorted in descending order based on their similarity. The target performance data corresponding to the target computation operator is determined based on the mean of the candidate performance data corresponding to the first preset number of similar features.
[0178] Alternatively, linear regression can be performed on similar features and the candidate performance data corresponding to similar features to obtain the target fitting curve; based on the target fitting curve and the target features, the target performance data corresponding to the target calculation operator can be determined; wherein, the target fitting curve is used to describe the relationship between features and performance data.
[0179] S806 determines the runtime of the target computation operator based on the computational complexity parameters and target performance data, and determines the prediction time information of the computation task based on the runtime of the target computation operator.
[0180] Optionally, if the target performance data includes throughput and the computational complexity parameter includes the amount of data to be read and written during the operation of the target computational operator, the runtime of the target computational operator is determined based on the ratio between the data volume of the target computational operator and the throughput.
[0181] Given that the target performance data includes computational efficiency and the computational complexity parameters include the amount of computation during the operation of the target computational operator, determine the product between the computational efficiency and the nominal computing power of the hardware on which the target computational operator is running; and determine the runtime of the target computational operator based on the ratio between the amount of computation of the target computational operator and the product.
[0182] S807: Obtain the actual time information of the computation task, and when the time difference between the predicted time information and the actual time information is greater than the time threshold, update the performance feature relationship based on the actual performance data of the target computation operator running under the target environment features.
[0183] The specific processes of S801-S807 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0184] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0185] Based on the same inventive concept, this application also provides a duration prediction device for implementing the duration prediction method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more duration prediction device embodiments provided below can be found in the limitations of the duration prediction method described above, and will not be repeated here.
[0186] In one exemplary embodiment, such as Figure 9 As shown, a duration prediction device 1 is provided, including: a data acquisition module 10, a performance determination module 20, and a time prediction module 30, wherein:
[0187] The data acquisition module 10 is used to determine the target operator features of the target computation operator and acquire the target environment features of the target computation operator; wherein, the target computation operator is the computation operator involved in the target model for processing the computation task, and the target environment features include at least the hardware environment features for running the target computation operator.
[0188] The performance determination module 20 is used to determine the target performance data corresponding to the target computation operator based on the performance feature relationship, the target operator feature and the target environment feature of the target computation operator; wherein, the performance feature relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature;
[0189] The time prediction module 30 is used to determine the prediction time information of the computing task based on the computational complexity parameters of the target computing operator and the target performance data.
[0190] In one exemplary embodiment, the performance determination module 20 is specifically used for:
[0191] Using the target features of the target computation operator as an index, a query is performed in the performance feature relationship; where the target features include target operator features and target environment features; if a target correspondence is found, the candidate performance data in the target correspondence is used as the target performance data corresponding to the target computation operator; where the candidate features in the target correspondence are the same as the target features; if no target correspondence is found, the target performance data corresponding to the target computation operator is determined based on the similarity between the target features and each candidate feature.
[0192] In one exemplary embodiment, the performance determination module 20 is further configured to:
[0193] Determine the similarity between the target feature and each candidate feature; if similar features exist, determine the target performance data corresponding to the target computation operator based on the candidate performance data corresponding to the similar features; where similar features are candidate features whose similarity to the target feature is greater than a similarity threshold; if no similar features exist, use the standard performance data as the target performance data corresponding to the target computation operator.
[0194] In an exemplary embodiment, when the number of similar features is at least two, the performance determination module 20 is further configured to:
[0195] Based on the similarity of each similar feature, the similar features are sorted in descending order; based on the mean of the candidate performance data corresponding to the first preset number of similar features, the target performance data corresponding to the target calculation operator is determined.
[0196] In one exemplary embodiment, the performance determination module 20 is further configured to:
[0197] Linear regression is performed on similar features and the candidate performance data corresponding to similar features to obtain the target fitting curve; the target fitting curve is used to describe the relationship between features and performance data; based on the target fitting curve and target features, the target performance data corresponding to the target calculation operator is determined.
[0198] In one exemplary embodiment, the time prediction module 30 is specifically used for:
[0199] Based on the computational complexity parameters and performance data of the target computational operator, determine the runtime of the target computational operator; based on the runtime of the target computational operator, determine the prediction time information of the computation task.
[0200] In an exemplary embodiment, the target performance data includes throughput, and the computational complexity parameter includes the amount of data to be read and written during the execution of the target computational operator; the time prediction module 30 is further configured to:
[0201] The runtime of the target computation operator is determined based on the ratio between data volume and throughput.
[0202] In an exemplary embodiment, the target performance data includes computational efficiency, and the computational complexity parameter includes the amount of computation during the execution of the target computational operator; the time prediction module 30 is further configured to:
[0203] Determine the product between computational efficiency and the nominal computing power of the hardware where the target computational operator is located; determine the runtime of the target computational operator based on the ratio between the computational load and the product.
[0204] In one exemplary embodiment, the target operator features include the operator type, input-output features, and data processing features of the target computation operator.
[0205] In an exemplary embodiment, the duration prediction device 1 further includes a relationship construction module, wherein the relationship construction module is specifically used for:
[0206] Obtain candidate operator features for different candidate computation operators; for each candidate computation operator, determine candidate performance data based on the runtime log data when the candidate computation operator runs on candidate hardware; construct performance feature relationships based on the candidate operator features, candidate performance data, and runtime candidate environment features of different candidate computation operators.
[0207] In one exemplary embodiment, the relationship building model is also used for:
[0208] The parameter configuration page is displayed to the operation and maintenance personnel, and the range of operator features input by the operation and maintenance personnel based on the parameter configuration page is obtained; based on the range of operator features, candidate operator features for different candidate computation operators are generated.
[0209] In an exemplary embodiment, the duration prediction device 1 further includes a relationship update module, wherein the relationship update module is specifically used for:
[0210] Obtain the actual time information of the computation task; when the time difference between the predicted time information and the actual time information is greater than the time threshold, update the performance feature relationship based on the actual performance data of the target computation operator running under the target environment features.
[0211] Each module in the aforementioned duration prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0212] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0213] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0214] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0215] It should be noted that the data involved in this application (including but not limited to performance data of the computation operator during runtime) are all data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0216] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0217] 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 application.
[0218] 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 patent 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, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A duration prediction method, characterized in that, The method includes: The target computation operator is determined by identifying its target operator characteristics and acquiring its target environment characteristics. The target computation operator is the computation operator involved in the target model that processes the computation task. The target operator characteristics include the operator type, input / output characteristics, and data processing characteristics of the target computation operator. The input / output characteristics include data dimension characteristics and data type. The data processing characteristics include data processing methods and data computation rules. The target environment characteristics include at least the hardware environment characteristics for running the target computation operator. Using the target feature of the target computation operator as an index, a query is performed in the performance feature relationship; wherein, the target feature includes the target operator feature and the target environment feature; the performance feature relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature; the performance data includes the throughput and computational efficiency of the computation operator; If a target correspondence is found, the candidate performance data in the target correspondence is used as the target performance data corresponding to the target calculation operator; or, if the target correspondence is not found, the target performance data corresponding to the target calculation operator is determined based on the similarity between the target feature and each candidate feature; wherein, the candidate features in the target correspondence are the same as the target feature; Based on the computational complexity parameters of the target computational operator and the target performance data, the prediction time information of the computational task is determined.
2. The method according to claim 1, characterized in that, The step of determining the target performance data corresponding to the target computation operator based on the similarity between the target feature and each candidate feature includes: Determine the similarity between the target feature and each candidate feature; In the presence of similar features, the target performance data corresponding to the target computation operator is determined based on the candidate performance data corresponding to the similar features; wherein, the similar features are candidate features whose similarity to the target feature is greater than a similarity threshold; In the absence of the aforementioned similar features, the standard performance data is used as the target performance data corresponding to the target computation operator.
3. The method according to claim 2, characterized in that, When the number of similar features is at least two, the target performance data corresponding to the target computation operator is determined based on the candidate performance data corresponding to the similar features, including: Based on the similarity scores of each feature, the similar features are sorted in descending order. The target performance data corresponding to the target calculation operator is determined based on the average of the candidate performance data corresponding to the first preset number of similar features.
4. The method according to claim 2, characterized in that, The step of determining the target performance data corresponding to the target computation operator based on the candidate performance data corresponding to the similar features includes: Linear regression processing is performed on the similar features and the candidate performance data corresponding to the similar features to obtain the target fitting curve; wherein, the target fitting curve is used to describe the relationship between the features and the performance data; Based on the target fitting curve and the target features, the target performance data corresponding to the target calculation operator is determined.
5. The method according to any one of claims 1-4, characterized in that, Determining the prediction time information of the computation task based on the computational complexity parameters of the target computation operator and the target performance data includes: The runtime of the target computation operator is determined based on the computational complexity parameters of the target computation operator and the target performance data. The prediction time information of the computation task is determined based on the runtime of the target computation operator.
6. The method according to claim 5, characterized in that, The target performance data includes throughput, and the computational complexity parameter includes the amount of data to be read and written during the operation of the target computational operator; determining the runtime of the target computational operator based on the computational complexity parameter and the target performance data includes: The runtime of the target computation operator is determined based on the ratio between the data volume and the throughput.
7. The method according to claim 5, characterized in that, The target performance data includes computational efficiency, and the computational complexity parameter includes the amount of computation during the execution of the target computational operator; Determining the runtime of the target computation operator based on its computational complexity parameters and performance data includes: Determine the product between the computational efficiency and the nominal computing power of the hardware running the target computational operator; The runtime of the target computation operator is determined based on the ratio between the computational cost and the product.
8. The method according to any one of claims 1-4, characterized in that, The target operator features include the operator type, input / output features, and data processing features of the target computation operator.
9. The method according to any one of claims 1-4, characterized in that, The performance characteristic relationships are constructed in the following way: Obtain the candidate operator features of different candidate computation operators; For each candidate computation operator, candidate performance data is determined based on the runtime log data of the candidate computation operator running on the candidate hardware. The performance characteristic relationship is constructed based on the candidate operator characteristics, candidate performance data, and candidate environment characteristics at runtime for different candidate computation operators.
10. The method according to claim 9, characterized in that, The process of obtaining candidate operator features for different candidate computation operators includes: Display the parameter configuration page to the operation and maintenance party, and obtain the operator feature range input by the operation and maintenance party based on the parameter configuration page; Based on the range of operator features, candidate operator features for different candidate computation operators are generated.
11. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtain the actual time information of the computation task; If the time difference between the predicted time information and the actual time information is greater than a time threshold, the performance feature relationship is updated based on the actual performance data of the target computation operator running under the target environmental features.
12. A duration prediction device, characterized in that, The device includes: The data acquisition module is used to determine the target operator features of the target computational operator and acquire the target environment features of the target computational operator; wherein, the target computational operator is the computational operator involved in the target model for processing the computational task; the target operator features include the operator type, input-output features, and data processing features of the target computational operator, the input-output features include data dimension features and data type, and the data processing features include data processing method and data computation rules; the target environment features at least include the hardware environment features for running the target computational operator; A performance determination module is used to query performance feature relationships using the target feature of the target computation operator as an index; if a target correspondence relationship is found, the candidate performance data in the target correspondence relationship is used as the target performance data corresponding to the target computation operator; or, if the target correspondence relationship is not found, the target performance data corresponding to the target computation operator is determined based on the similarity between the target feature and each candidate feature; wherein, the target feature includes the target operator feature and the target environment feature; the performance feature relationship includes the correspondence between different candidate features and different candidate performance data, each candidate feature includes a candidate operator feature and a candidate environment feature, and each candidate performance data is the actual performance data when running the candidate computation operator corresponding to the candidate operator feature under the candidate environment feature; the performance data includes the throughput and computational efficiency of the computation operator; the candidate features in the target correspondence relationship are the same as the target feature; The time prediction module is used to determine the prediction time information of the computing task based on the computational complexity parameters of the target computing operator and the target performance data.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Performance data prediction method, performance data prediction device, electronic equipment and medium
CN116611476A
Operator performance determination method and device, computing equipment and storage medium
CN117667330A