Method for selecting program simulation points

By building the program phase clustering model and automated parameter tuning method, and selecting program simulation points, the problems of slow speed and high error rate of existing simulators are solved, and a more efficient and accurate simulation program process is achieved.

CN119415981APending Publication Date: 2025-02-11UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411453027.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Existing architectural simulators are slow and have high error rates when simulating applications, making it difficult to achieve fast iteration and real-time feedback. At the same time, the SimPoint method has low accuracy and the results cannot be reproduced stably.

Method used

Through a high-performance simulator, a program phase clustering model is constructed, and two-stage clustering is performed using UMAP dimensionality reduction and HDBSCAN. Parameter tuning is automated to find the optimal parameters and select the centroid interval as Simulation point.

Benefits of technology

It effectively reduces the CPI error rate, improves the efficiency and accuracy of the simulation, and solves the problems of low accuracy of the SimPoint method and inreproducible results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415981A_ABST
    Figure CN119415981A_ABST
Patent Text Reader

Abstract

The invention discloses a method for selecting a program simulation point, which comprises the following steps of: acquiring a frequency vector BBV of each interval of a program through a high-performance simulator, acquiring an execution clock cycle of each interval of the program through a high-precision simulator, constructing a program phase clustering model, reducing dimensions by using UMAP, performing first-stage and second-stage clustering by using HDBSCAN, and selecting the program simulation point. An automatic parameter search process is used to find an optimal parameter suitable for each model, finally, the models are trained based on the optimal model parameters, a model result is recalculated, a program phase clustering result is obtained, centroid interval of each class is selected as a simulation point, and centroid interval in all classes is obtained to form a set of simulation points. According to the method, the BBV characteristics of the model are fully utilized, the CPI error rate can be effectively reduced, a program can be simulated more efficiently and accurately, and through the enhanced sampling simulation method, the key limitations that a widely-used SimPoint method is low in accuracy and results cannot be stably reproduced are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer system architecture, and in particular relates to a method for selecting program simulation points. Background Art

[0002] Modern computer architecture research requires a deep understanding of the cycle-level behavior of processors as they execute applications. To gain this understanding, researchers typically use detailed simulators that simulate every cycle. However, this level of detail comes at the expense of speed; even on the fastest simulators, simulating a full execution of a benchmark program can take weeks or even months to complete.

[0003] At the same time, system architecture researchers are also faced with the problem of high error rates when simulating applications using existing application-level simulators. Therefore, in order to accelerate the research process and improve the accuracy of simulation, in addition to solving the problem of simulation speed, it is also necessary to solve the accuracy problem of application-level simulators (such as SimPoint, SMARTS, FSA, Delorean) in simulating applications.

[0004] At present, the main difficulties in using architecture software simulation technology for performance evaluation are as follows:

[0005] 1. Simulation speed. The simulator needs to gradually simulate the behavior of the hardware in the software. When evaluating new design solutions, it takes a lot of time to simulate the operation of the processor. This long simulation limits the possibility of fast iteration and real-time feedback to a certain extent. For development teams that need to frequently modify and evaluate designs, this is undoubtedly a significant bottleneck.

[0006] 2. Simulation accuracy. Software simulation usually involves abstraction and simplification of hardware behavior. This abstraction inevitably introduces a certain degree of error, resulting in deviations between simulation results and real hardware in certain performance indicators. Although simulation technology can provide a preliminary evaluation of design solutions, in actual applications, these deviations may affect the accuracy of design decisions.

[0007] In summary, a lot of research has been done on existing architecture simulation and many methods have been proposed. The paper "Using SimPoint for Accurate and Efficient Simulation. ACM SIGMETRICS the International Conference on Measurement and Modeling of Computer Systems, June 2003" first proposed to select a small number of representative simulation points from a complete program for efficient and accurate simulation. The paper “SMARTS: Accelerating microarchitecture simulation via rigorous statistical sampling, Proceedings of the 30th annual international symposium on Computer architecture, 2003” proposed that it uses a statistically reliable method to configure system sampling simulation runs to achieve quantitative confidence in the credibility of the estimated values; the paper “Full speed ahead: Detailed architectural simulation at near-native speed. 2015 IEEE International Symposium on Workload Characterization, Atlanta, GA, USA, 2015” proposed the use of hardware virtualization to achieve efficient fast-forward function; the paper “Delorean: Virtualized Directed Profiling for Cache Modeling in Sampled Simulation, Technical report / Department of Information Technology, Uppsala University, Uppsala University, 2018” proposed a new and more accurate statistical cache modeling method, which uses hardware virtualization to accurately determine the memory area accessed and minimize the time required for data collection while maintaining accuracy.

[0008] The above methods have significantly improved accuracy and efficiency by selecting representative simulation points or using hardware acceleration. The current common practice is to collect the Basic Block Vector information of the program through a high-performance simulator, cluster to obtain representative intervals, and then use a high-performance simulator to fully execute the program to generate a checkpoint at the corresponding interval id, and then use a high-precision architecture simulator to execute the interval fragment in detail to obtain the number of clock cycles. However, the results obtained by the above process, such as SimPoint using random projection and Kmeans clustering, are often not reproducible. The error rate obtained by using the CPI of the obtained simulation point to infer the CPI of the complete program has huge fluctuations, and SimPoint uses the same set of parameters for dimension reduction and clustering for all programs, which cannot fully consider the characteristics of different programs. The simulation error rate of technologies such as SMARTS, FSA, and Delorean is relatively high. Summary of the invention

[0009] To solve the above technical problems, the present invention provides a method for selecting program simulation points. Through this enhanced sampling simulation method, the key limitations of the widely used SimPoint method, such as low accuracy and unstable results, are solved.

[0010] The technical solution adopted by the present invention is: a method for selecting a program simulation point, the specific steps are as follows:

[0011] S1. Collect the frequency vector BBV of each interval of the program through a high-performance simulator. Based on the old processor architecture, collect the execution clock cycle number cycle of each interval of the program through a high-precision simulator.

[0012] S2, build program phase clustering model;

[0013] The phase clustering model specifically includes:

[0014] (1) BBV dimensionality reduction;

[0015] Use UMAP to reduce the dimensionality of BBV.

[0016] (2) Two-stage clustering: one-stage clustering and two-stage clustering;

[0017] Based on the data after dimensionality reduction, the HDBSCAN clustering algorithm is used for one-stage clustering. Then, the centroid of each class is clustered in the second stage using the HDBSCAN clustering algorithm, and the clustering results corresponding to the centroids belonging to the same category are merged.

[0018] S3, based on the phase clustering model constructed in step S2, perform automated parameter exploration, that is, use Hyperopt to automatically tune the parameters of the model, and use the parameter scorer to calculate the score of each group of parameters to obtain the optimal parameters of the program phase clustering model;

[0019] The model parameters for automatic parameter tuning include: UMAP n_neighbors, UMAP min_dist, UMAP n_components, HDBSCAN min_cluster_size, HDBSCAN cluster_selection_epsilon, and HDBSCAN2 min_cluster_size.

[0020] Among them, UMAP n_neighbors indicates the number of neighbors around each data point considered in the UMAP dimensionality reduction process; UMAP min_dist indicates the minimum distance between data points in the space after UMAP dimensionality reduction; UMAP n_components indicates the target dimension to which UMAP reduces the data; HDBSCAN min_cluster_size indicates the minimum number of samples required to form a cluster in the specified one-stage clustering; HDBSCAN cluster_selection_epsilon indicates the maximum distance in the first-stage clustering that controls two clusters to be considered adjacent; HDBSCAN2 min_cluster_size indicates the minimum number of samples required to form a cluster in the specified two-stage clustering.

[0021] Hyperopt is used to automatically tune the parameters of the model. The objective function expression used in the Hyperopt model is as follows:

[0022]

[0023] Among them, e norm and c norm They respectively represent the normalized error rate and the number of clusters of the clustering results obtained by the model, and the smaller the score of the objective function, the better.

[0024] During automatic parameter tuning, based on the execution clock cycle number cycle of each interval of the program collected in step S1, a parameter scorer is used to calculate the score of each group of parameters. The parameter score calculation indicators include: CPI error rate e, number of clusters n.

[0025] First, the CPI error rate is calculated by dividing the average CPI of the simulation point by the CPI of the complete program, and the normalization formula is used to normalize e and n. The normalization formula is:

[0026] Among them, x represents the value to be normalized, min represents the lower bound of x, and max represents the upper bound of x.

[0027] Finally, the normalized e and n are calculated and the Euclidean distance from the origin is used as the scoring score. The model parameter with the smallest scoring score is the optimal parameter of the model, and the optimal model parameter is recorded.

[0028] S4. Based on the optimal model parameters obtained in step S3, the model is trained, the model results are recalculated, the program phase clustering results are obtained, the centroid interval of each class is selected as the simulation point, and the centroid intervals in all classes are obtained to form a set of simulation points.

[0029] Beneficial effects of the present invention: The method of the present invention first collects the frequency vector BBV of each interval of the program through a high-performance simulator, collects the execution clock cycle number cycle of each interval of the program through a high-precision simulator based on the old processor architecture, and then builds a program phase clustering model, uses UMAP to reduce the dimension, and then uses HDBSCAN to perform one-stage and two-stage clustering, uses an automated parameter search process to find the optimal parameters suitable for each model, and finally trains the model based on the optimal model parameters, recalculates the model results, obtains the program phase clustering results, selects the centroid interval of each class as a simulation point, and obtains a set of simulation points composed of the centroid intervals in all classes. The method of the present invention makes full use of the BBV characteristics of the model, can effectively reduce the CPI error rate, and thus simulates the program more efficiently and accurately. Through this enhanced sampling simulation method, the key limitations of the widely used SimPoint method, that is, low accuracy and non-stably reproducible results, are solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention is a flowchart of a method for selecting program simulation points. DETAILED DESCRIPTION

[0031] The method of the present invention is further described below with reference to the accompanying drawings and embodiments.

[0032] like Figure 1 As shown, a flow chart of a method for selecting a program simulation point of the present invention, the specific steps are as follows:

[0033] S1. The frequency vector BBV (Basic Block Vector) of each interval in the program is collected through a high-performance simulator, and the execution clock cycle number cycle of each interval in the program is collected through a high-precision simulator;

[0034] In this embodiment, the high-performance simulator uses NEMU, the acquisition program is the benchmark test program SPEC CPU 2006, and the high-precision simulator uses GEM5.

[0035] S2, build program phase clustering model (model for finding simulation points);

[0036] The phase clustering model specifically includes:

[0037] (1) BBV dimensionality reduction;

[0038] Use UMAP (Uniform Manifold Approximation and Projection) to reduce the dimension of BBV.

[0039] (2) Two-stage clustering: one-stage clustering and two-stage clustering;

[0040] Based on the data after dimensionality reduction, the HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) clustering algorithm is used for one-stage clustering. Then, the centroid of each class is clustered in the second stage using HDBSCAN based on the result of the first-stage clustering, and the clustering results corresponding to the centroids belonging to the same category are merged.

[0041] S3, based on the phase clustering model constructed in step S2, perform automated parameter exploration, that is, use Hyperopt to automatically tune the parameters of the model, and use the parameter scorer to calculate the score of each group of parameters to obtain the optimal parameters of the program phase clustering model;

[0042] The model parameters for automatic parameter tuning include: UMAP n_neighbors, UMAP min_dist, UMAP n_components, HDBSCAN min_cluster_size, HDBSCAN cluster_selection_epsilon, and HDBSCAN2 min_cluster_size.

[0043] Among them, UMAP n_neighbors indicates the number of neighbors around each data point considered in the UMAP dimensionality reduction process; UMAP min_dist indicates the minimum distance between data points in the space after UMAP dimensionality reduction; UMAP n_components indicates the target dimension to which UMAP reduces the data; HDBSCAN min_cluster_size indicates the minimum number of samples required to form a cluster in the specified one-stage clustering; HDBSCAN cluster_selection_epsilon indicates the maximum distance in the first-stage clustering that controls two clusters to be considered adjacent; HDBSCAN2 min_cluster_size indicates the minimum number of samples required to form a cluster in the specified two-stage clustering.

[0044] Hyperopt is used to automatically tune the parameters of the model. The objective function expression used in the Hyperopt model is as follows:

[0045]

[0046] Among them, e norm and c norm They respectively represent the normalized error rate and the number of clusters of the clustering results obtained by the model, and the smaller the score of the objective function, the better.

[0047] During automatic parameter tuning, based on the execution clock cycle number cycle of each interval of the program collected in step S1, a parameter scorer is used to calculate the score of each group of parameters. The parameter score calculation indicators include: CPI error rate e, number of clusters n.

[0048] First, the CPI error rate is calculated by dividing the average CPI of the simulation point by the CPI of the complete program, and the normalization formula is used to normalize e and n. The normalization formula is:

[0049] Among them, x represents the value to be normalized, min represents the lower bound of x, and max represents the upper bound of x.

[0050] Finally, the normalized e and n are calculated and the Euclidean distance from the origin is used as the scoring score. The model parameter with the smallest scoring score is the optimal parameter of the model, and the optimal model parameter is recorded.

[0051] S4. Based on the optimal model parameters obtained in step S3, the model is trained, the model results are recalculated, the program phase clustering results are obtained, the centroid interval of each class is selected as the simulation point, and the centroid intervals in all classes are obtained to form a set of simulation points.

[0052] In summary, the method of the present invention makes full use of the BBV characteristics of the program. Compared with the method of selecting simulation points by SimPoint, the method of the present invention can effectively reduce the CPI error rate. Taking the gcc program as an example, the fluctuation range of the CPI error rate of the simulation points selected by SimPoint is 0.04% to 18.86%, and the average error rate is 6.04%, while the fluctuation range of the CPI error rate of the simulation points selected by the method of the present invention is 0.01% to 5.17%, and the average error rate is 0.97%. The stability and accuracy of the results are guaranteed in other test programs.

[0053] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A method for selecting a program simulation point, the specific steps are as follows: S1. Collect the frequency vector BBV of each interval of the program through a high-performance simulator. Based on the old processor architecture, collect the execution clock cycle number cycle of each interval of the program through a high-precision simulator. S2, build program phase clustering model; The phase clustering model specifically includes: (1) BBV dimensionality reduction; Use UMAP to reduce the dimension of BBV; (2) Two-stage clustering: one-stage clustering and two-stage clustering; Based on the data after dimensionality reduction, the HDBSCAN clustering algorithm is used for one-stage clustering. Then, the centroid of each class is clustered in the second stage using the HDBSCAN clustering algorithm, and the clustering results corresponding to the centroids belonging to the same class are merged. S3, based on the phase clustering model constructed in step S2, perform automated parameter exploration, that is, use Hyperopt to automatically tune the parameters of the model, and use the parameter scorer to calculate the score of each group of parameters to obtain the optimal parameters of the program phase clustering model; The model parameters for automatic parameter tuning include: UMAP n_neighbors, UMAP min_dist, UMAPn_components, HDBSCAN min_cluster_size, HDBSCAN cluster_selection_epsilon, HDBSCAN2 min_cluster_size; Among them, UMAP n_neighbors indicates the number of neighbors around each data point considered in the UMAP dimensionality reduction process; UMAP min_dist indicates the minimum distance between data points in the space after UMAP dimensionality reduction; UMAP n_components indicates the target dimension to which UMAP reduces the data; HDBSCAN min_cluster_size indicates the minimum number of samples required to form a cluster in the specified one-stage clustering; HDBSCAN cluster_selection_epsilon indicates the maximum distance between two clusters considered to be adjacent in the first-stage clustering; HDBSCAN2 min_cluster_size indicates the minimum number of samples required to form a cluster in the specified two-stage clustering; Hyperopt is used to automatically tune the parameters of the model. The objective function expression used in the Hyperopt model is as follows: Among them, e norm and c norm They represent the normalized error rate and number of clusters of the clustering results obtained by the model, and the smaller the score of the objective function, the better; During automatic parameter tuning, based on the execution clock cycle number cycle of each interval of the program collected in step S1, a parameter scorer is used to calculate the score of each group of parameters. The parameter score calculation indicators include: CPI error rate e, number of clusters n; First, the CPI error rate is calculated by dividing the average CPI of the simulation point by the CPI of the complete program, and the normalization formula is used to normalize e and n. The normalization formula is: Among them, x represents the value to be normalized, min represents the lower bound of x, and max represents the upper bound of x; Finally, the normalized e and n are calculated and the Euclidean distance from the origin is used as the scoring score. The model parameter with the smallest scoring score is the optimal parameter of the model, and the optimal model parameter is recorded; S4. Based on the optimal model parameters obtained in step S3, the model is trained, the model results are recalculated, the program phase clustering results are obtained, the centroid interval of each class is selected as the simulation point, and the centroid intervals in all classes are obtained to form a set of simulation points.