An accelerator architecture design method and electronic device
By combining dynamic fractal space encoding and meta-learning dynamic weight entropy search with Bayesian optimization, the problem of low efficiency in traditional accelerator architecture design is solved, and a fast and effective accelerator architecture design is achieved, which is adapted to the development of modern technology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional accelerator architecture design relies on human experience, making it difficult to adapt quickly and effectively to the development of modern accelerator technology. Furthermore, existing machine learning-based methods cannot deeply explore the non-uniformity and strong coupling between parameters, resulting in long simulation times and an inability to quickly find the optimal design.
A method combining dynamic fractal space encoding and meta-learning dynamic weight entropy search with Bayesian optimization is adopted. Dimensionality is reduced through dynamic fractal space encoding, and meta-learning dynamic weight entropy search is performed using historical task datasets to determine a new design scheme. Multi-objective optimization simulation is carried out under the condition that the difference in sensitivity parameters is satisfied, and the simulation results of the neighbor set are reused to reduce redundant simulation.
It enables rapid exploration of the accelerator architecture design space, reduces the number of simulations, improves design efficiency and accuracy, and adapts to the rapid development of modern accelerator technology.
Smart Images

Figure CN121233091B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to an accelerator architecture design method and an electronic device. BACKGROUND
[0002] Accelerator architecture design is a key stage in the accelerator development process, which defines the implementation of the Instruction Set Architecture (ISA) in the accelerator. Different combinations of internal components of the accelerator show different accelerator power consumption, performance, area and other indicators under the micro-architecture design of the specific technology process. Design space exploration explores the entire design space of the processor through explicit optimization goals, which is an effective way to solve the accelerator design.
[0003] Traditional accelerator architecture design relies on the experience of architects, has poor scalability and is difficult to adapt to the rapid development of modern accelerator technology. Recently, machine learning-based methods have been introduced for accelerator architecture modeling, such as K-Means algorithm, AdaBoost learning, Monte Carlo tree search, etc. These algorithms lack exploration of high-dimensional parameter design, do not deeply mine the non-uniformity and strong coupling between accelerator architecture parameters, and cannot traverse and evaluate each micro-architecture to retrieve the best design. Moreover, the time for simulation is several hours or even days, and a large amount of time is needed to obtain valuable indicators.
[0004] Therefore, how to quickly and effectively realize the accelerator architecture design is a problem to be solved by those skilled in the art. SUMMARY
[0005] The present application provides an accelerator architecture design method and an electronic device to at least solve the problem that the accelerator architecture design cannot be quickly and effectively realized in the related art.
[0006] The present application provides an accelerator architecture design method, comprising:
[0007] The design parameter matrix of the accelerator is dynamically fractal space coded to obtain a simulation coding vector; wherein the dimension of the simulation coding vector is less than the dimension of the design parameter matrix;
[0008] The simulation coding vector is subjected to meta-learning dynamic weight entropy search using a historical task data set to determine a new design scheme; wherein the historical task data set is obtained based on sampling simulation of the simulation coding vector;
[0009] In a case where the difference between the new design scheme and the difference in the sensitivity parameters in the neighbor set meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation, and the new design scheme and the simulation result thereof are added to the historical task data set; wherein the neighbor design schemes contained in the neighbor set belong to the historical design schemes contained in the historical task data set.
[0010] In a case where the difference between the new design scheme and the difference in the sensitivity parameters in the neighbor set does not meet the difference condition, the simulation result of the neighbor set is reused, and the new design scheme and the simulation result thereof are added to the historical task data set.
[0011] According to Bayesian optimization, iterative search is performed, and a final accelerator architecture design scheme is determined from the selected design scheme and the simulation result thereof.
[0012] The application also provides an accelerator architecture design device, comprising an encoding unit, a searching unit, a simulation unit, a reuse unit and a determination unit.
[0013] The encoding unit is configured to perform dynamic fractal space encoding on a design parameter matrix of an accelerator to obtain a simulation encoding vector; wherein the dimension of the simulation encoding vector is less than the dimension of the design parameter matrix.
[0014] The searching unit is configured to perform meta-learning dynamic weight entropy search on the simulation encoding vector by using a historical task data set to determine a new design scheme; wherein the historical task data set is obtained based on sampling simulation of the simulation encoding vector.
[0015] The simulation unit is configured to, in a case where the difference between the new design scheme and the difference in the sensitivity parameters in the neighbor set meets the difference condition, perform multi-objective optimization simulation on the new design scheme, and add the new design scheme and the simulation result thereof to the historical task data set; wherein the neighbor design schemes contained in the neighbor set belong to the historical design schemes contained in the historical task data set.
[0016] The reuse unit is configured to, in a case where the difference between the new design scheme and the difference in the sensitivity parameters in the neighbor set does not meet the difference condition, reuse the simulation result of the neighbor set, and add the new design scheme and the simulation result thereof to the historical task data set.
[0017] The determination unit is configured to perform iterative search according to Bayesian optimization, and determine a final accelerator architecture design scheme from the selected design scheme and the simulation result thereof.
[0018] The application also provides an electronic device, comprising a memory for storing a computer program, and a processor for executing the computer program to implement the steps of any of the above accelerator architecture design methods.
[0019] The application further provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program.
[0020] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of any of the accelerator architecture design methods.
[0021] By the application, the design parameter matrix of the accelerator is dynamically fractal space coded to obtain a simulation coding vector; wherein the dimension of the simulation coding vector is less than the dimension of the design parameter matrix. The simulation coding vector is subjected to meta-learning dynamic weight entropy search by using a historical task data set to determine a new design scheme. The processing mode of each design scheme is similar, and the new design scheme is taken as an example, in which any one of the design schemes in all design schemes has not been simulated. In the case that the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation to obtain a simulation result of the new design scheme. In the case that the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, it is indicated that the performance of the new design scheme is similar to that of the neighbor design scheme in the neighbor set, and the simulation result of the neighbor set can be directly reused, thereby reducing the simulation times. Iterative search is performed according to Bayesian optimization, and a final accelerator architecture design scheme is determined from the selected design scheme and the simulation result thereof. In the technical scheme, the topological coupling relationship between the design parameters can be captured by dynamic fractal space coding, and the high-dimensional discrete space is reduced to obtain a low-dimensional simulation coding vector. The search direction is guided by the efficient meta-learning dynamic weight entropy acquisition function. When the new design scheme is obtained, the simulation result is reused by the difference between the sensitive parameters, thereby reducing the redundant simulation. The rapid exploration of the accelerator architecture design space under multi-objective optimization is realized. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the application, the drawings required to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0023] Figure 1 A flowchart of an accelerator architecture design method provided by an embodiment of the application;
[0024] Figure 2 A flowchart of a method for converting a design parameter matrix into a simulation coding vector provided by an embodiment of the application;
[0025] Figure 3An architecture diagram of a dynamic fractal space coding module provided by an embodiment of the present application is provided.
[0026] Figure 4 A flowchart of a method for determining a new design scheme provided by an embodiment of the present application is provided.
[0027] Figure 5 A flowchart of a method for multi-objective optimization simulation of a new design scheme provided by an embodiment of the present application is provided.
[0028] Figure 6 An architecture diagram of an accelerator architecture design system provided by an embodiment of the present application is provided.
[0029] Figure 7 A structural schematic diagram of an accelerator architecture design apparatus provided by an embodiment of the present application is provided. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0031] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0032] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0033] Embodiments of the present application provide an accelerator architecture design method, which is described in detail in combination with the execution flow of the accelerator architecture design method.
[0034] Figure 1 A flowchart of an accelerator architecture design method provided by an embodiment of the present application is provided, which includes:
[0035] S101: dynamically fractal space coding is performed on a design parameter matrix of an accelerator to obtain a simulation coding vector.
[0036] The dimension of the simulation coding vector is less than the dimension of the design parameter matrix.
[0037] Each row in the design parameter matrix is a design point, and each column is a specific design parameter.
[0038] According to different task requirements, there are tens to hundreds of dynamically adjustable design parameters in the design space of the accelerator architecture, such as instruction fetch width, instruction cache (I-Cache) capacity, associativity, and access delay, arithmetic logic unit (ALU) number of functional units, floating-point unit (FPU) multiplier delay, and load / store unit (Ld / St) number, etc.
[0039] These design parameters constitute a huge design space. Due to the combination explosion of the search space and the expensive calculation, the application proposes to use a dynamic fractal space encoding (Dynamic Fractal-Hierarchical for Transformer Encoding, DFH-Transformer) to integrate dynamic fractal attention into the space encoding process of the transformer encoder (Transformer). On the one hand, it can reduce the discrete high-dimensional space to a low-dimensional coupled vector, and on the other hand, it can capture the topological coupling relationship between variables, improve the compatibility and convergence efficiency of the subsequent Bayesian optimization proxy model.
[0040] The dynamic fractal space encoding algorithm constructs a hierarchical sparse attention mask through the self-similarity of fractal geometry, realizes the self-similarity dynamic dimension reduction of all design parameters in the high-dimensional design space. Combined with the input adaptive fractal pattern generated by the differentiable parameter predictor, it replaces the traditional position encoding to maintain the spatial topology invariability. The dynamic fractal space encoding algorithm reduces the Transformer computation complexity to O(nlogn), significantly improves the dynamic modeling efficiency and spatial relationship perception ability of long sequence design parameters of the accelerator architecture.
[0041] S102: Perform meta-learning dynamic weight entropy search on the simulation encoding vector using the historical task data set to determine a new design scheme.
[0042] The historical task data set is obtained based on sampling simulation of the simulation encoding vector.
[0043] In the embodiments of the application, a meta-learning dynamic weight entropy search (Meta-Learning Dynamic-Weighted Entropy Search, ML-DWES) is used to construct a collection function, and the optimal accelerator architecture design scheme is found based on the collection function.
[0044] The meta-learning layer learns which parameter regions are prone to optimal solutions (Pareto solutions) from the optimization history of similar tasks and learns the correlation patterns between objectives, such as the trade-off curve of the number of instructions per cycle (IPC) and power consumption in each cycle.
[0045] The meta-learning framework transfers historical optimization tasks to dynamically modulate the weight distribution of multi-objective entropy search, thereby significantly improving the convergence efficiency and coverage of the optimal solution frontier in high-dimensional and expensive black-box accelerator design space exploration (DSE).
[0046] S103: In the case where the difference between the new design scheme and the neighbor set in the sensitivity parameter meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation, and the new design scheme and the simulation result thereof are added to the historical task data set.
[0047] The neighbor design schemes included in the neighbor set belong to the historical design schemes included in the historical task data set.
[0048] In the embodiments of the present application, the graph-constrained causal lasso (GCCL) model identifies the key design parameters, i.e., the sensitivity parameters, in the accelerator architecture space through causal graph-constrained sparse regression, and reuses the simulation results of causal neighbors in combination with a sensitivity threshold triggering mechanism to achieve dynamic optimization of simulation cost. For ease of description, the graph-constrained causal lasso model can be referred to as a graph-constrained causal model.
[0049] In the case where the difference between the new design scheme and the neighbor set in the sensitivity parameter meets the difference condition, the new design scheme can be subjected to multi-objective optimization simulation by using simulation software to obtain the simulation result of the new design scheme.
[0050] In the embodiments of the present application, the multi-objective optimization includes optimization of performance, power, and area indicators (PPA).
[0051] S104: In the case where the difference between the new design scheme and the neighbor set in the sensitivity parameter does not meet the difference condition, the simulation result of the neighbor set is reused, and the new design scheme and the simulation result thereof are added to the historical task data set.
[0052] The similarity between design schemes is used to propagate simulation results, reduce redundant simulation of specific accelerator architecture design schemes, and save time.
[0053] The GCCL model uses graph Laplacian regularization to maintain physical consistency between design parameters, updates the causal graph incrementally to adapt to non-stationary design space, reduces the number of redundant simulations, and is suitable for design exploration of high-dimensional and strongly coupled systems.
[0054] S105: Iterative search is performed according to Bayesian optimization, and a final accelerator architecture design scheme is determined from the selected design scheme and simulation results.
[0055] As can be seen from the above technical solution, the design parameter matrix of the accelerator is dynamically coded in a fractal space to obtain a simulation coding vector; wherein the dimension of the simulation coding vector is less than the dimension of the design parameter matrix. The simulation coding vector is subjected to meta-learning dynamic weight entropy search using historical task data sets to determine a new design scheme. Each design scheme is processed similarly. Taking any one of the design schemes in the design scheme that has not been simulated, i.e., the new design scheme, as an example, if the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation to obtain the simulation result of the new design scheme. If the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, it means that the performance of the new design scheme is similar to that of the neighbor design scheme in the neighbor set, and the simulation result of the neighbor set can be directly reused, thereby reducing the number of simulations. Iterative search is performed according to Bayesian optimization, and a final accelerator architecture design scheme is determined from the selected design scheme and simulation results. In this technical solution, the topological coupling relationship between the design parameters can be captured by dynamic fractal space coding, and the high-dimensional discrete space can be reduced to obtain a low-dimensional simulation coding vector. The search direction is guided by an efficient meta-learning dynamic weight entropy acquisition function. When the new design scheme is obtained, the simulation result is reused by the difference between the sensitive parameters, thereby reducing redundant simulations. The rapid exploration of the accelerator architecture design space under multi-objective optimization is realized.
[0056] Figure 2 A flowchart of a method for converting a design parameter matrix into a simulation coding vector provided in an embodiment of the present application, the method comprising:
[0057] S201: The design parameter matrix of the accelerator is subjected to hierarchical perception to construct a fractal mask.
[0058] In an embodiment of the present application, the design parameter matrix of the accelerator can be analyzed using a multi-layer perception machine to obtain fractal parameters; wherein each level in the fractal parameters includes recursive depth, sparsity, and scale factor. According to the rules of the Menger sponge, a basic fractal mask matching the recursive depth is created. The basic fractal mask is randomly zeroed according to the sparsity to obtain the fractal mask.
[0059] In a specific implementation, a simple multilayer perceptron (MLP) can be used in the fractal parameter predictor to obtain the fractal parameter θ. In order to successfully combine the fractal parameter with the Transformer encoding, m levels are used for fractal perception, and 3 parameters are required for each level, including the recursion depth λ, the sparsity ρ, and the scale factor s. The dimension of the fractal parameter θ is 3xm, and m can be selected according to the dimension of the accelerator design space. The basic principle is that the higher the dimension, the greater m is appropriately increased.
[0060] The recursion depth λ is an integer, the sparsity ρ of the design parameter is between 0.3 and 1.0, and the scale factor s is between 0.5 and 1.0. Therefore, the range is constrained by the following activation function (sigmoid):
[0061] ;
[0062] ;
[0063] where i takes values [1, 2, …, m], representing different levels of encoding; ρ i represents the sparsity of the i-th layer; s i represents the scale factor of the i-th layer.
[0064] After obtaining the fractal parameter θ, a plurality of levels of fractal masks can be generated according to θ. In actual application, a dynamic fractal mask can be generated using the Sierpinski sponge algorithm according to the recursion depth. For each recursion level, the grid is divided into 3x3 window blocks, and if the block size after dividing the grid is less than 1, it is skipped. The center area of each block is set to 0 to simulate the Sierpinski sponge; then ρ i is used for random zeroing, that is, each position is set to 0 with a probability of ρ i , and the probability of remaining 1 is 1-ρ i . Thus, m layers of fractal masks M i are obtained, and M i is a porous, binary matrix with fractal characteristics, composed of 0 and 1, and has the same dimension as the two-dimensional matrix P.
[0065] S202: Position encoding is performed on the design parameter matrix to obtain spatial coordinate embedding.
[0066] In the embodiments of the present application, a corresponding spatial coordinate can be constructed for the design parameter matrix to obtain a corresponding two-dimensional matrix. Each grid point in the spatial coordinate corresponds to a dimension value of the design parameter matrix D, and corresponds to a set of two-dimensional coordinates (x, y) to obtain a corresponding two-dimensional matrix P. The present application does not limit the specific size of the two dimensions of the matrix P, but only requires that the number of grid points be greater than the dimension of the design parameter D, and the excess grid points are completed as 0 in the design parameter.
[0067] According to the recursion depth and the sparsity, the two-dimensional coordinates of each point in the two-dimensional matrix are harmonically encoded to obtain a position encoding vector; the position encoding vector is spliced with the two-dimensional matrix to obtain a spliced vector; and the spliced vector is linearly transformed to obtain a spatial coordinate embedding.
[0068] By constructing a corresponding spatial coordinate corresponding to the design parameter matrix, a corresponding two-dimensional matrix P can be obtained. The two-dimensional coordinates of each point in the two-dimensional matrix P are harmonically encoded, and the sine and cosine functions use different frequencies at different points to increase the frequency information, thereby generating a position encoding vector P of each point harmonic :
[0069] ;
[0070] where d j is the result of the original design parameter D using Z-Score standardization, and j is an integer value traversing between 1 and the dimension of the design parameter D.
[0071] After obtaining P harmonic , it is spliced with the two-dimensional matrix P to obtain the final spatial coordinate embedding :
[0072] ;
[0073] where W p represents the weight matrix of the linear layer, b p represents the bias vector of the linear layer, concat represents the splicing function, and GeLU represents the activation function.
[0074] S203: According to the fractal mask, the spatial coordinate embedding, and the self-attention vector of the design parameter matrix, a dynamic fractal attention is constructed.
[0075] In specific implementation, the fractal mask and the self-attention vector corresponding to each level can be multiplied with the spatial coordinate embedding to obtain the fractal attention of each level; and the fractal attention of all levels is averaged to obtain the dynamic fractal attention.
[0076] In calculating the self-attention vector, first, the receptive field size of the attention is dynamically calculated according to the scale factor, and the receptive field size of the i-th layer is the integer part of the product of the scale factor s i and the length of the design parameter D. Then, according to the size of the receptive field, the self-attention calculation is performed on the design parameter matrix D by the shared MLP calculation method, and the self-attention vector is converted into a two-dimensional operator attn i after the dimension of the two-dimensional matrix P. Similarly, the redundant grid points in the design parameter are also completed as 0.
[0077] m layers are set in the fractal parameter predictor, and a dynamic fractal mask M is obtained i There are also m layers, and the final dynamic fractal attention Attn is obtained by averaging the m layers, which is used for the later Transformer encoding:
[0078] ;
[0079] wherein i takes values [1, 2, …, m], representing different hierarchical encodings; attn i represents a two-dimensional operator of the i-th layer; represents a spatial coordinate embedding, M i represents the fractal mask of the i-th layer.
[0080] S204: Spatially encode the spatial coordinate embedding and the dynamic fractal attention to obtain an analog encoding vector.
[0081] In the embodiments of the present application, the spatial coordinate embedding and the dynamic fractal attention can be spatially encoded in the manner of Transformer encoding, so as to obtain an analog encoding vector.
[0082] In a specific implementation, the dynamic fractal attention Attn is subjected to residual connection and normalization calculation, that is, the output of the fractal attention layer is added to the input spatial coordinate embedding, and then layer normalization is performed. Subsequently, a feed-forward network (FFN) is entered, which has two linear layers and adopts GeLU activation in the middle. Residual connection and layer normalization are entered again, and the output of the FFN is added to the input of the FFN after normalization processing.
[0083] The normalized features are hierarchically dimensionally reduced and output, first the normalized features are globally aggregated, and a global feature vector is obtained through a mean pooling operator, and then a MLP is used to realize dimension reduction mapping, and the global feature vector is mapped to a low-dimensional analog encoding vector R.
[0084] Figure 3This application provides an architecture diagram of a dynamic fractal space encoding module. For the input high-dimensional discrete design parameter matrix D, there are three processing branches. The first branch outputs a two-dimensional matrix through a spatial coordinate generator. Encoding the two-dimensional matrix based on the recursion depth λ and sparsity ρ yields a position encoding vector. This position encoding vector is concatenated with the two-dimensional matrix, and the final spatial coordinate embedding is obtained through a spatial coordinate embedding layer. The second branch uses a fractal parameter predictor to obtain fractal parameters; dynamic fractal mask generation is performed on the fractal parameters, generating multiple levels of fractal masks. The third branch obtains a two-dimensional attention operator through self-attention and dimensionality transformation. Based on the spatial coordinate embedding, fractal mask, and two-dimensional attention operator, a dynamic fractal attention mechanism can be constructed. Inputting the dynamic fractal attention into the transformer encoder outputs a low-dimensional analog encoding vector. The transformer encoder comprises five parts: addition & layer normalization, feedforward network, addition & layer normalization, global feature aggregation, and hierarchical dimensionality reduction output.
[0085] Figure 3 The diagram illustrates the encoding process of the encoder. The decoder design is similar to the encoder, consisting of a dynamic fractal attention layer, residual connections and normalization layers, a feedforward network layer, residual connections and normalization layers, a global feature aggregation layer, and a hierarchical dimensionality reduction output layer. For a detailed implementation, please refer to [reference needed]. Figure 3 It should be noted that: 1) The dynamic fractal attention layer also uses m layers for fractal calculation, similar to the encoder process, and the receptive field size of the i-th layer is the scale factor s. i The product of the length of the analog coding vector R and the integer part of the result is used to perform self-attention calculation on the analog coding vector R according to the size of the receptive field through shared MLP computation, thus obtaining the attention for each layer. The final dynamic fractal attention is the average of the product of each fractal attention and the analog coding vector. 2) At the end of the decoder, the multilayer perceptron maps from the low-dimensional space back to the high-dimensional space of the design parameter matrix D, thereby obtaining... The purpose of decoding is to output the desired result. Equal to D. 3) Considering the discreteness of input and output, the loss function uses mean squared error and cross-entropy loss functions to calculate the encoder and decoder. 4) The training process is carried out simultaneously on the encoder and decoder. In the subsequent Bayesian optimization process, this application only performs the process of converting the design parameter matrix D into the simulated encoding vector R.
[0086] In the Transformer encoder layer, multi-head self-attention is replaced with dynamic fractal multi-head attention. The fractal mask sparsifies the attention computation, reducing the computational complexity from O(n^2) to O(n^2). 2 Reduced to O(nlogn):
[0087] ;
[0088] where C(n) represents the computational complexity, n represents the length of the input sequence, k represents the sequence block, and K represents the hyperparameter of the Transformer encoder.
[0089] In the embodiments of the present application, by using the self-similarity of fractal geometry, a hierarchical sparse attention mask is constructed to realize the self-similarity dynamic dimension reduction of all design parameters in a high-dimensional design space, and the Transformer computational complexity is reduced to O(nlogn), which significantly improves the dynamic modeling efficiency and spatial relationship perception ability of the accelerator architecture.
[0090] Figure 4 A flowchart of a method for determining a new design scheme provided in the embodiments of the present application, the method comprising:
[0091] S401: Training a meta-model according to a historical task data set.
[0092] where each historical design scheme in the historical task data set contains a historical encoding vector, a multi-objective historical simulation result, and a non-dominated solution set. The historical task data set is recorded in a meta-database.
[0093] In the embodiments of the present application, Bayesian optimization is used in the design space for iterative exploration, and a high-efficiency ML-DWES acquisition function is used to guide the search direction, thereby obtaining a design scheme.
[0094] In order to distinguish the simulation encoding vector corresponding to the current task and the historical encoding vector contained in the historical design scheme, R is used to represent the simulation encoding vector, and is used to represent the historical encoding vector.
[0095] The historical task data set input into the Bayesian optimization process is denoted as N represents the total number of tasks contained in the historical task data set, and as the historical task data set is continuously expanded, the value of N will also change, and the value of N is equal to the iteration number up to the current iteration.
[0096] Each historical task contains a historical encoding vector , a corresponding multi-objective simulation result Y, and a non-dominated solution set Par. These data are simply cleaned and preprocessed, such as eliminating outliers, normalizing the multi-objective simulation result Y, etc.
[0097] According to the processed data, a meta model is trained. In the embodiment of the application, a deep kernel learning (DKL) can be used to train a kernel function, a general feature representation across tasks is learned through a neural network, and the general feature representation is embedded in a kernel function of a Gaussian process (GP), so that the representation capability of deep learning and the probabilistic modeling advantage of the Gaussian process are combined, and efficient migration of knowledge between tasks is realized. The deep kernel function is defined as:
[0098] ;
[0099] wherein, and are different encoding vectors; is a feature mapping learned by a neural network sharing a weight W; is a basic kernel function, which can be a radial basis function kernel (RBF) or a Matern kernel (Matern) or the like; denotes a task feature extracted by the neural network from ; denotes a task feature extracted by the neural network from ; denotes a similarity between the encoding vector and the encoding vector .
[0100] Different from a traditional kernel function calculation, an input of the deep kernel learning is no longer a raw design parameter, but a task-invariant feature extracted by the neural network .
[0101] S402: Based on the trained meta model, a similarity analysis is performed on a simulation encoding vector of a current task and a historical encoding vector in a meta database, and a task similarity is determined.
[0102] The trained meta model is used to extract a first task feature vector of the simulation encoding vector and a second task feature vector of the historical encoding vector, respectively. The first task feature vector and the second task feature vector are analyzed according to a kernel function of the meta model, and the task similarity is determined.
[0103] The meta knowledge reward function of the application is designed in a double driving mode. One is a task similarity, which ensures the scene relevance of the migrated knowledge. The other is information gain, which is used to maintain the adaptability to the characteristics of the current task.
[0104] The task similarity is a similarity (Sim) between a current task and a historical task. According to the deep kernel function The similarity can be calculated. To facilitate the distinction, the feature vector of the current task can be referred to as a first task feature vector, and the feature vector of the historical task can be referred to as a second task feature vector.
[0105] S403: Determine the information gain of the simulation encoding vector according to the candidate solution in the current task.
[0106] The information gain (InfoGain) is an experience mode estimation based on the historical task, which estimates the amount of information that can be obtained by sampling at the current point.
[0107] The information gain calculation formula is as follows: ;
[0108] wherein, represents the gradient at the simulation encoding vector R, is an information gain predictor based on meta-knowledge, T meta is a historical task feature matrix from a pre-constructed meta-knowledge base, and InfoGain(R) represents the information gain of the simulation encoding vector.
[0109] S404: Determine the expected return of the simulation encoding vector according to the task similarity and the information gain.
[0110] The meta-knowledge reward function R meta (R) is designed as a multiplicative coupling of similarity and information gain, the similarity as the confidence weight of knowledge transfer, and the information gain determines the value intensity of knowledge application, encourages sampling of parameter points similar to the historical optimal region, and adaptively adjusts the exploration balance between targets. The calculation formula of the meta-knowledge reward function is as follows:
[0111] ;
[0112] wherein, R meta (R) represents the expected return; R represents the simulation encoding vector, i.e. the design parameter encoding combination being considered for sampling in the current task and not yet simulated; T current represents the feature vector of the current task being optimized, which changes in real time with the optimization process; T meta is a historical task feature matrix from a pre-constructed meta-knowledge base; Sim(·) represents a similarity calculation function; and InfoGain represents the information gain.
[0113] S405: According to the simulation encoding vector and its expected return and the historical encoding vector in the meta-database, a dynamic weight entropy search is performed on the accelerator design space using a meta-learning dynamic weight entropy acquisition function, to determine a new design scheme.
[0114] In the embodiments of the present application, the posterior predictive distribution of the simulation encoding vector can be updated according to the historical encoding vectors in the meta database and the multi-objective historical simulation results thereof, to obtain a posterior predictive distribution. Based on the information entropy of the posterior predictive distribution and the corresponding dynamic weight, and the expected return and the corresponding meta-knowledge reward weight, the acquisition function value of the current candidate design point is determined; according to the meta-learning dynamic weight entropy acquisition function, all design points in the simulation encoding vector are traversed, and the design scheme corresponding to the maximum acquisition function value is taken as the new design scheme.
[0115] For the determination of the acquisition function value, the information entropy of the posterior predictive distribution can be weighted and averaged according to the dynamic weight, to obtain an expected value; based on the product value of the expected return and the meta-knowledge reward weight, and the expected value, the acquisition function value of the current candidate design point is determined.
[0116] In specific implementation, dynamic weight entropy search can be added on the basis of meta-knowledge extraction, and the entropy reduction of the "region close to the optimal solution" is taken as the target, instead of only focusing on the optimal solution itself, and adaptive search is realized through online dynamic adjustment of the weight. The present application proposes to use a weight function to control the sensitivity of the weight to the suboptimal solution.
[0117] ML-DWES acquisition function The calculation formula is:
[0118] ;
[0119] Among them, represents the acquisition function value, which is used to evaluate the good or bad degree of the design scheme, E represents the expectation; w(t) is the dynamic weight; H(·) is the Shannon information entropy, and the larger the value is, the greater the amount of information provided by the point is; P(Y|R,Z) is the posterior predictive distribution of the surrogate model, Z is each set of historical encoding vectors in the historical task data set, and Y represents the simulation result predicted by the surrogate model under the current simulation encoding vector parameter R; β is the weight of the meta-knowledge reward item, which is the meta-knowledge reward, i.e., the expected return.
[0120] For the determination method of the dynamic weight, the optimal solution set of the tthiteration of the simulation encoding vector can be obtained; based on the kernel density estimation of the multi-objective optimization on the optimal solution set, the performance value of the optimal solution set on a single objective, the minimum function value and the optimal decay coefficient, the dynamic weight of the multi-objective optimization in the tthiteration is determined.
[0121] The dynamic weight w(t) is calculated based on the target space coverage density of the current Pareto front, and the dynamic importance weight of the jthobjective in the tthiteration is The specific formula is:
[0122] ;
[0123] where Par t denotes the current Pareto optimal solution set at the t-th iteration, is the kernel density estimation of objective j on Par t , ε denotes a small non-zero value, and y(R) is the objective function value of the current candidate design parameter R obtained by the surrogate model, which generally includes power consumption, performance, area, etc. is the current observed minimum function value, is the optimal decay coefficient.
[0124] The parameters of the weight function can be updated in real time during the optimization process to adapt to the uncertainty of the posterior model, which is the key to the efficiency of the ML-DWES acquisition function, allowing sparse objectives to obtain higher weights and guiding the exploration of uncovered areas.
[0125] Specifically, the calculation of the optimal decay coefficient is to minimize the absolute difference between the two integrals of the potential optimal region volume and the weighted region volume, and by adjusting the decay coefficient , the region covered by the weight function is accurately matched with the potential optimal region predicted by the posterior:
[0126] ;
[0127] where, is an exponential decay weight function that measures the difference between the candidate solution and the current optimal solution, denotes that there is a probability of q that the global minimum value will be lower than this quantile threshold.
[0128] In the embodiments of the present application, a new ML-DWES acquisition function is proposed to calculate the acquisition function value of each candidate point for finding the optimal accelerator architecture design. The acquisition function transfers historical optimization tasks through a meta-learning framework to dynamically modulate the weight distribution of multi-objective entropy search, thereby significantly improving the convergence efficiency and coverage rate of the Pareto front in high-dimensional and expensive black-box accelerators.
[0129] Figure 5 A flowchart of a method for multi-objective optimization simulation of a new design scheme provided by the embodiments of the present application, the method comprising:
[0130] S501: Similarity analysis is performed on the new design scheme and the historical design schemes in the historical task data set to determine a neighbor set of the new design scheme.
[0131] The neighbor set includes at least one neighbor design scheme.
[0132] In the embodiments of the present application, R new represents a new design scheme, and R j represents the jth historical design scheme in the historical task data set.
[0133] By calculating the similarity between the new design scheme R new and each historical design scheme R j in the historical task data set, a neighbor set N(R new ) of the new design scheme can be found. The similarity between the design schemes can be measured by a conventional metric operator such as Euclidean distance, cosine similarity, or distance on a graph.
[0134] S502: Screening each type of simulation parameter whose sensitivity parameter exceeds the sensitivity threshold from the neighbor set.
[0135] The importance table constructed in the offline stage contains the sensitivity threshold corresponding to each type of parameter. According to the importance table, each type of simulation parameter in the neighbor set N(R new ) whose sensitivity parameter exceeds the corresponding sensitivity threshold can be determined, and these simulation parameters belong to important parameters. Let the set of each type of simulation parameter be ; wherein, τ represents the sensitivity threshold.
[0136] S503: In the case that the comprehensive absolute difference between each type of simulation parameter in the new design scheme and each type of simulation parameter in each neighbor design scheme is greater than the difference threshold, the new design scheme is simulated by using the simulation software for multi-objective optimization to obtain the simulation result of the new design scheme.
[0137] For each simulation parameter, the absolute difference between the value of the simulation parameter in the new design scheme R new and the value of the simulation parameter in the neighbor design scheme can be calculated.
[0138] Under different task requirements, different types of design parameters have different weights. After calculating the absolute difference corresponding to each simulation parameter, the absolute differences of all simulation parameters can be weighted and summed according to the weights of all simulation parameters under the current task requirement, so as to obtain a final absolute difference. There is a corresponding final absolute difference between the new design scheme and each neighbor design scheme.
[0139] In practical applications, the average of all absolute differences can be taken as the comprehensive absolute difference, or the minimum of all absolute differences can be taken as the comprehensive absolute difference.
[0140] In the case that the comprehensive absolute difference is greater than the difference threshold, it indicates that the performance deviation between the new design scheme and the neighbor design scheme is large, and the new design scheme needs to be simulated.
[0141] If simulation is needed, run the corresponding simulation software to obtain the simulation result of the new design scheme, that is, the multi-objective result Y new , and add the new design scheme to the historical task data set for subsequent model updating.
[0142] In the case where the comprehensive absolute difference is less than or equal to the difference threshold, it is indicated that the performance of the new design scheme is relatively close to that of the neighbor design scheme, and in this case, the simulation result of the neighbor design scheme can be directly reused.
[0143] In a specific implementation, the simulation result of the neighbor design scheme with the smallest absolute difference from the new design scheme can be taken as the simulation result of the new design scheme. Alternatively, the average or weighted average of the simulation results of all neighbor design schemes can be taken as the simulation result of the new design scheme. When the weighted average is taken, the weight can be the similarity between the design schemes.
[0144] Taking the weighted average as an example, the simulation result of the new design scheme can be determined according to the following formula:
[0145] where Y new represents the simulation result of the new design scheme, w i represents the weight, Y i represents the simulation result of the i-th neighbor design scheme.
[0146] The weight w i may be the similarity between the design schemes, for example, , d is a distance function, R new represents the new design scheme, and R i represents the i-th neighbor design scheme.
[0147] In the screening of the parameters to be simulated, the sensitivity threshold needs to be relied on. For the setting of the sensitivity threshold, the historical task data set and the objective function with the introduction of graph constraints can be used to train the graph causal constraint model. The historical design schemes contained in the historical task data set are converted into a graph network. The trained graph causal constraint model is used to analyze the graph network to determine the final historical sensitivity parameters; and the sensitivity threshold is determined according to the quantile of the historical sensitivity parameters in the confidence interval.
[0148] In the determination of the final historical sensitivity parameters, the posterior mean of each iteration can be determined according to the regression coefficient of the design parameter in each iteration; and the propagation matrix of the graph network is constructed according to the random walk normalization principle. The propagation matrix, the sensitivity score of the design parameter at each iteration, and the posterior mean of each iteration are iteratively propagated to obtain the final historical sensitivity parameters.
[0149] The median of the lower bound of the confidence interval of the historical sensitivity parameters is taken as the sensitivity threshold.
[0150] The objective function of the standard Lasso model is:
[0151] ;
[0152] where L Lasso represents the output of the Lasso model, n * is the number of historical design schemes in the currently acquired historical task data set, R is the simulation encoding vector, Y is the corresponding multi-objective simulation result, β is the regression coefficient, and λ L is a regularization parameter used to control sparsity.
[0153] However, in complex systems, there are often dependent relationships between design parameters, such as increasing the launch width requires synchronously increasing the Reorder Buffer (ROB) size, otherwise it will cause instruction dispatch blocking, which constitutes special causal, topological and spatial relationships. These relationships can be represented by a graph structure, which can be represented by G = (V, E), where V is the node set (each node corresponds to a design parameter), and E is the edge set (representing the association between parameters).
[0154] In order to utilize this graph structure, the present application introduces a graph constraint in L Lasso , so that the coefficients of related parameters also tend to be similar, in order to capture the causal or topological relationships between design parameters. The objective function of the designed GCCL model is as follows:
[0155] ;
[0156] where L GCCL represents the output of the GCCL model; n * is the number of historical design schemes in the currently acquired historical task data set; is the graph Laplacian, which encodes the graph structure information; λ1 represents the control of L1 regularization strength, producing sparsity; λ2 represents the control of graph regularization strength, forcing the coefficients of related parameters to be similar; is the graph regularization term.
[0157] The graph Laplacian is defined as: ;
[0158] where I is the identity matrix, is a diagonal matrix, ; A is the adjacency matrix, and if there is an edge between node i and node j, then A ij = 1 (or the weight of the edge), otherwise 0.
[0159] The graph regularization term can be unfolded as: .
[0160] This term penalizes the difference of coefficients between neighboring nodes (i.e. design parameters that are associated in the accelerator design). Thus, if two parameters are connected in the graph structure G (i.e. A ij > 0), their regression coefficients β i and β j are encouraged to be similar, ensuring that the contribution of the related parameters is consistent with the causal topology, i.e. design parameters that are correlated should have similar influence on the output.
[0161] Based on the GCCL model, the parameter sensitivity is calculated and the importance table is constructed. In the graph-constrained Lasso regression, the graph structure G is designed according to the physical meaning of the accelerator design parameters. The sensitivity is propagated on the graph nodes in this application, so that the sensitivities of neighboring parameters are enhanced. At the same time, the posterior distribution of the sensitivity is calculated by using the Bayesian Lasso, and the robust importance table is constructed by using the confidence interval. The importance table contains the sensitivity threshold corresponding to each type of design parameter.
[0162] For the calculation of parameter sensitivity, the posterior mean can be calculated, i.e. the absolute value of the regression coefficient is calculated and then normalized:
[0163] ;
[0164] wherein β is the regression coefficient of the jth design parameter in the mth iteration, and |β is the absolute value of the regression coefficient.
[0165] On this basis, the sensitivity propagation on the graph structure is proposed, and the propagation matrix P is constructed according to the random walk normalization principle.
[0166] wherein A PM is the adjacency matrix corresponding to the graph structure G, and D PM is the degree matrix corresponding to the graph structure G.
[0167] The iteration propagation formula is: ;
[0168] wherein α is the damping factor, PM jk denotes the transition probability from node k to node j, and β is the sensitivity score of the kth design parameter in the tth iteration. is the sensitivity score of the jth design parameter in the t+1th iteration, N(j) represents the neighbor node set of parameter node j, and the enhanced sensitivity parameter is obtained after final convergence .
[0169] For the enhanced sensitivity parameter , the 95% confidence interval CI j is calculated according to its bootstrap sample (Bootstrap) ; wherein CI j represents the confidence interval, represents the 2.5% quantile, and the 97.5% quantile.
[0170] The median of the lower bounds of the confidence intervals of all parameters is calculated as the sensitivity threshold τ:
[0171] ;
[0172] If the lower bound of the confidence interval of a specific parameter j (such as cache size, launch width) in the design parameter matrix D is greater than τ, it is marked as a key parameter, and the importance table is obtained.
[0173] The sensitivity threshold τ is set according to the median of the lower bounds of the sensitivity of all parameters, which can adapt to the data distribution. This algorithm not only considers the point estimate of sensitivity, but also considers the reliability of the estimate. Only parameters with sensitivity significantly greater than the threshold at the 95% confidence level are marked as key parameters.
[0174] In the Bayesian optimization exploration, one of the following two conditions is met to stop iteration: the pre-defined simulation evaluation resources are exhausted: stop when the total time budget, computing resources or allowed simulation times (i.e. upper limit of objective function evaluation times) allocated to exploration are used up. When the new design point found by continuous multiple iterations (such as 10-20 times) brings an improvement of the optimization target PPA less than a certain pre-set small threshold, it indicates that the optimization may have converged to the vicinity of the optimal region.
[0175] After determining the final accelerator architecture design scheme, the accelerator architecture design scheme can be converted into a gate-level netlist; based on the process library information and the circuit components and interconnection relationships contained in the gate-level netlist, the accelerator is constructed.
[0176] Figure 6An accelerator architecture design system provided by an embodiment of the present application is shown in a block diagram. The method converts a design parameter matrix of tens to hundreds of dimensions into a low-dimensional simulation encoding vector by means of dynamic fractal space coding, and extracts complete topological relationships between various design parameters by means of self-attention of a transformer encoder, for subsequent Bayesian optimization exploration.
[0177] Subsequently, in the Bayesian optimization process, the simulation encoding vector can be initially sampled, and then simulated by a simulation tool, so as to construct a historical task dataset. Iterative sampling of the simulation encoding vector can obtain a new design scheme. If the new design scheme needs to be simulated, the simulation tool can be used for simulation. If the new design scheme can reuse the simulation result of a neighbor design scheme, the simulation result can be directly reused. After each new design scheme and its simulation result are obtained, they can be recorded in the historical task dataset.
[0178] In the present application, a deep kernel Gaussian process model is used to represent the design space. A meta-learning dynamic weight entropy acquisition function learns knowledge from historical optimization tasks by deep kernel learning to train a meta-model, and guides the exploration of the current task by dynamic weight entropy search. Depending on the posterior predictive distribution of the Gaussian process proxy model, the acquisition function value of the current candidate design point is determined; and according to the meta-learning dynamic weight entropy acquisition function, all design points in the simulation encoding vector are traversed, and the design scheme corresponding to the maximum acquisition function value is taken as a new design scheme. A graph causal constraint model generates a graph structure G=(V,E) according to the causal, topological and spatial relationships of the design generated by the meta-learning dynamic weight entropy acquisition function, so as to construct a parameter importance table. Only the design scheme filtered by the graph causal constraint model can enter the simulation platform to obtain a simulation result, so as to reduce unnecessary simulation time. The Bayesian optimization is stopped when the optimization value of the objective function is lower than a preset threshold or the maximum number of explorations is reached. After the exploration of the design space ends, the obtained Pareto design can be converted into a gate-level netlist, and after the back-end physical design steps such as layout planning, layout and routing based on process library information, various circuit components and interconnection relationships in the accelerator architecture design scheme are finally mapped to a wafer to obtain an accelerator.
[0179] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.
[0180] Figure 7 An accelerator architecture design apparatus provided by an embodiment of the present application is shown in a structural schematic diagram. The apparatus comprises an encoding unit 71, a searching unit 72, a simulation unit 73, a reusing unit 74 and a determining unit 75.
[0181] The encoding unit 71 is configured to perform dynamic fractal space encoding on the design parameter matrix of the accelerator to obtain a simulation encoding vector; wherein the dimension of the simulation encoding vector is less than the dimension of the design parameter matrix.
[0182] The searching unit 72 is configured to perform meta-learning dynamic weight entropy search on the simulation encoding vector by using a historical task data set to determine a new design scheme; wherein the historical task data set is obtained based on sampling simulation of the simulation encoding vector.
[0183] The simulation unit 73 is configured to perform multi-objective optimization simulation on the new design scheme in the case that the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, and add the new design scheme and its simulation result to the historical task data set; wherein the neighbor design schemes contained in the neighbor set belong to the historical design schemes contained in the historical task data set.
[0184] The multiplexing unit 74 is configured to multiplex the simulation results of the neighbor set in the case that the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, and add the new design scheme and its simulation result to the historical task data set.
[0185] The determining unit 75 is configured to perform iterative search according to Bayesian optimization, and determine a final accelerator architecture design scheme from the selected design scheme and its simulation result.
[0186] In some embodiments, the encoding unit includes a first constructing subunit, a first obtaining subunit, a second constructing subunit, and a second obtaining subunit.
[0187] The first constructing subunit is configured to perform hierarchical perception on the design parameter matrix of the accelerator to construct a fractal mask.
[0188] The first obtaining subunit is configured to perform position encoding on the design parameter matrix to obtain a space coordinate embedding.
[0189] The second constructing subunit is configured to construct a dynamic fractal attention according to the fractal mask, the space coordinate embedding, and a self-attention vector of the design parameter matrix.
[0190] The second obtaining subunit is configured to perform space encoding on the space coordinate embedding and the dynamic fractal attention to obtain a simulation encoding vector.
[0191] In some embodiments, the first constructing subunit is configured to analyze the design parameter matrix of the accelerator by using a multi-layer perception machine to obtain fractal parameters; wherein each level in the fractal parameters includes a recursion depth, a sparsity rate, and a scale factor.
[0192] According to the Menger sponge generation rule, a basic fractal mask matching the recursion depth is created.
[0193] According to the sparsity, the base fractal mask is randomly set to zero to obtain a fractal mask.
[0194] In some embodiments, the first obtaining subunit is configured to construct a corresponding spatial coordinate for the design parameter matrix to obtain a corresponding two-dimensional matrix.
[0195] According to the recursion depth and the sparsity, the two-dimensional coordinates of each point in the two-dimensional matrix are harmonically encoded to obtain a position encoding vector.
[0196] The position encoding vector is spliced with the two-dimensional matrix to obtain a spliced vector.
[0197] The spliced vector is linearly transformed to obtain a spatial coordinate embedding.
[0198] In some embodiments, the second constructing subunit is configured to multiply the fractal mask corresponding to each level and the self-attention vector with the spatial coordinate embedding to obtain fractal attention of each level.
[0199] The fractal attention of all levels is averaged to obtain dynamic fractal attention.
[0200] In some embodiments, the searching unit includes a training subunit, an analysis subunit, a gain determination subunit, a benefit determination subunit, and a scheme determination subunit.
[0201] The training subunit is configured to train a meta-model according to a historical task data set; wherein each historical design scheme in the historical task data set includes a historical encoding vector, a multi-objective historical simulation result, and a non-dominated solution set.
[0202] The analysis subunit is configured to perform similarity analysis on the simulation encoding vector of the current task and the historical encoding vector in the meta database based on the trained meta-model to determine a task similarity.
[0203] The gain determination subunit is configured to determine the information gain of the simulation encoding vector according to the candidate solution in the current task.
[0204] The benefit determination subunit is configured to determine the expected benefit of the simulation encoding vector according to the task similarity and the information gain.
[0205] The scheme determination subunit is configured to perform dynamic weight entropy search on the accelerator design space using a meta-learning dynamic weight entropy acquisition function according to the simulation encoding vector and its expected benefit and the historical encoding vector in the meta database to determine a new design scheme.
[0206] In some embodiments, the analysis subunit is configured to extract a first task feature vector of the simulation encoding vector and a second task feature vector of the historical encoding vector using the trained meta-model.
[0207] The kernel function according to the meta-model is used to analyze the first task feature vector and the second task feature vector to determine the task similarity.
[0208] In some embodiments, the scheme determination subunit is configured to update a probability distribution of the simulation code vector according to the historical code vector and the multi-objective historical simulation result thereof in the meta database to obtain a posterior predictive distribution.
[0209] Based on the information entropy of the posterior predictive distribution and the corresponding dynamic weight, and the expected return and the corresponding meta-knowledge reward weight, a collection function value of the current candidate design point is determined.
[0210] According to the meta-learning dynamic weight entropy collection function, all design points in the simulation code vector are traversed, and the design scheme corresponding to the maximum collection function value is taken as a new design scheme.
[0211] In some embodiments, the device further includes a solution set acquisition unit and a weight determination unit for determining the dynamic weight.
[0212] The solution set acquisition unit is configured to acquire an optimal solution set of the tth iteration of the simulation code vector.
[0213] The weight determination unit is configured to determine the dynamic weight of the multi-objective optimization in the tth iteration according to the kernel density estimation of the multi-objective optimization on the optimal solution set, the performance value of the optimal solution set on a single objective, the minimum function value, and an optimal decay coefficient.
[0214] In some embodiments, the scheme determination subunit is configured to perform a weighted average operation on the information entropy of the posterior predictive distribution according to the dynamic weight to obtain an expected value.
[0215] Based on the product value of the expected return and the meta-knowledge reward weight and the expected value, a collection function value of the current candidate design point is determined.
[0216] In some embodiments, the simulation unit is configured to perform a similarity analysis on the new design scheme and the historical design schemes in the historical task data set to determine a neighbor set of the new design scheme; wherein the neighbor set includes at least one neighbor design scheme.
[0217] From the neighbor set, each type of simulation parameter whose sensitivity parameter exceeds a sensitivity threshold is selected.
[0218] In the case where the comprehensive absolute difference between each type of simulation parameter in the new design scheme and each type of simulation parameter in each neighbor design scheme is greater than a difference threshold, the new design scheme is simulated by using a simulation software to obtain a simulation result of the new design scheme.
[0219] In some embodiments, the device further comprises a training unit, a conversion unit, a sensitivity parameter determination unit and a threshold determination unit, in response to the setting of the sensitivity threshold;
[0220] The training unit is configured to train the graph causal constraint model by using a historical task data set and a target function with introduced graph constraints;
[0221] The conversion unit is configured to convert a historical design scheme contained in the historical task data set into a graph network;
[0222] The sensitivity parameter determination unit is configured to analyze the graph network by using the trained graph causal constraint model to determine a final historical sensitivity parameter;
[0223] The threshold determination unit is configured to determine the sensitivity threshold according to a quantile of the historical sensitivity parameter in a confidence interval.
[0224] In some embodiments, the sensitivity parameter determination unit is configured to determine a posterior mean of each iteration according to a regression coefficient of a design parameter in each iteration;
[0225] The propagation matrix of the graph network is constructed according to the random walk normalization principle;
[0226] The final historical sensitivity parameter is obtained by iteratively propagating the propagation matrix, the sensitivity score of the design parameter in each iteration and the posterior mean of each iteration.
[0227] In some embodiments, the threshold determination unit is configured to take a median of a lower bound of the confidence interval of the historical sensitivity parameter as the sensitivity threshold.
[0228] In some embodiments, the multiplexing unit is configured to, in a case where a comprehensive absolute difference between each type of to-be-simulated parameter in the new design scheme and each type of to-be-simulated parameter in each neighbor design scheme is less than or equal to a difference threshold, take a simulation result of a neighbor design scheme with the smallest absolute difference with the new design scheme as a simulation result of the new design scheme.
[0229] In some embodiments, the device further comprises a conversion unit and a construction unit;
[0230] The conversion unit is configured to convert the accelerator architecture design scheme into a gate-level netlist;
[0231] The construction unit is configured to construct the accelerator based on a physical design step of the process library information and each circuit component and interconnection relationship contained in the gate-level netlist.
[0232] The features of the embodiments corresponding to the accelerator architecture design device can be referred to the related descriptions of the embodiments corresponding to the accelerator architecture design method, which will not be repeated here.
[0233] It can be seen from the above technical solution that the design parameter matrix of the accelerator is dynamically coded in a fractal space to obtain a simulation coding vector; wherein the dimension of the simulation coding vector is less than the dimension of the design parameter matrix. The simulation coding vector is subjected to meta-learning dynamic weight entropy search using a historical task data set to determine a new design scheme. Each design scheme is processed in a similar manner. Taking any one of the design schemes in the simulation set as the new design scheme, if the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation to obtain a simulation result of the new design scheme. If the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, it indicates that the performance of the new design scheme is similar to that of the neighbor design scheme in the neighbor set, and the simulation result of the neighbor set can be directly reused, thereby reducing the simulation times. The final accelerator architecture design scheme is determined from the selected design scheme and the simulation result thereof according to Bayesian optimization. In the technical solution, the topological coupling relationship between the design parameters can be captured by dynamic fractal space coding, and the high-dimensional discrete space can be reduced to obtain a low-dimensional simulation coding vector. An efficient meta-learning dynamic weight entropy acquisition function is used to guide the search direction. When the new design scheme is obtained, the simulation result is reused by the difference between the sensitive parameters, thereby reducing redundant simulation. The accelerator architecture design space is quickly explored under multi-objective optimization.
[0234] Embodiments of the present application also provide an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the above accelerator architecture design method embodiments.
[0235] Embodiments of the present application also provide a computer readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above accelerator architecture design method embodiments when executed.
[0236] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic or optical disk, and various media that can store computer programs.
[0237] Embodiments of the present application also provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to perform the steps in any of the above accelerator architecture design method embodiments.
[0238] The embodiment of the present application further provides another computer program product comprising a non-volatile computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above accelerator architecture design method embodiments.
[0239] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or both, and that the interchangeability of hardware and software methods is contemplated. Accordingly, the examples described herein are presented for purposes of illustration and not limitation. The steps of the examples are not necessarily limited to the order described, and the steps of the examples can be implemented in any order.
[0240] The above provides a detailed introduction to the accelerator architecture design method, device, equipment, medium and product provided by the present application. The principles and implementation modes of the present application are described herein by applying specific examples, and the above description of the examples is only applicable to help understand the method and core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A method of accelerator architecture design, the method comprising: The method comprises the following steps: dynamically fractal space encoding a design parameter matrix of an accelerator to obtain a simulation encoding vector; wherein the dimension of the simulation encoding vector is less than the dimension of the design parameter matrix; performing meta-learning dynamic weight entropy search on the simulation encoding vector using a historical task data set to determine a new design scheme; wherein the historical task data set is obtained based on sampling simulation of the simulation encoding vector; in the case that the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, performing multi-objective optimization simulation on the new design scheme, and adding the new design scheme and its simulation result to the historical task data set; wherein the neighbor design schemes contained in the neighbor set belong to the historical design schemes contained in the historical task data set; in the case that the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, reusing the simulation result of the neighbor set, and adding the new design scheme and its simulation result to the historical task data set; iterative search according to Bayesian optimization, and determining a final accelerator architecture design scheme from the selected design scheme and its simulation result; dynamically fractal space encoding a design parameter matrix of an accelerator to obtain a simulation encoding vector, comprising: performing hierarchical perception on the design parameter matrix to construct a fractal mask; position encoding the design parameter matrix to obtain a space coordinate embedding; constructing dynamic fractal attention according to the fractal mask, the space coordinate embedding, and the self-attention vector of the design parameter matrix; spatially encoding the space coordinate embedding and the dynamic fractal attention to obtain a simulation encoding vector; performing meta-learning dynamic weight entropy search on the simulation encoding vector using a historical task data set to determine a new design scheme, comprising: determining the expected return of the simulation encoding vector; according to the simulation encoding vector, its expected return, and the historical encoding vectors in the meta database, performing dynamic weight entropy search on the accelerator design space using the meta-learning dynamic weight entropy acquisition function to determine a new design scheme.
2. The accelerator architecture design method of claim 1, wherein, performing hierarchical perception on the design parameter matrix of the accelerator to construct a fractal mask, comprising: analyzing the design parameter matrix of the accelerator using a multi-layer perception machine to obtain fractal parameters; wherein each level in the fractal parameters includes recursive depth, sparsity, and scale factor; creating a basic fractal mask matching the recursive depth according to the Geng sponge generation rule; randomly setting the basic fractal mask to zero according to the sparsity to obtain a fractal mask.
3. The accelerator architecture design method of claim 2, wherein, position encoding the design parameter matrix to obtain a space coordinate embedding, comprising: constructing corresponding space coordinates for the design parameter matrix to obtain a corresponding two-dimensional matrix; performing harmonic coding on the two-dimensional coordinates of each point in the two-dimensional matrix according to the recursive depth and the sparsity to obtain a position encoding vector; splicing the position encoding vector and the two-dimensional matrix to obtain a splicing vector; performing linear transformation on the splicing vector to obtain a space coordinate embedding.
4. The accelerator architecture design method of claim 1, wherein, According to the fractal mask, the spatial coordinate embedding, and the self-attention vector of the design parameter matrix, a dynamic fractal attention is constructed, including: Multiplying the fractal mask and the self-attention vector corresponding to each level with the spatial coordinate embedding to obtain the fractal attention of each level; Taking the average of the fractal attention of all levels to obtain the dynamic fractal attention.
5. The accelerator architecture design method of claim 1, wherein, Determining the expected return of the simulation encoding vector, including: Training a meta-model based on a historical task data set; wherein each historical design scheme in the historical task data set includes a historical encoding vector, multi-objective historical simulation results, and a non-dominated solution set; Performing similarity analysis on the simulation encoding vector of the current task and the historical encoding vector in the meta database based on the trained meta-model to determine the task similarity; According to the candidate solution in the current task, the information gain of the simulation encoding vector is determined; According to the task similarity and the information gain, the expected return of the simulation encoding vector is determined.
6. The accelerator architecture design method of claim 5, wherein, Performing similarity analysis on the simulation encoding vector of the current task and the historical encoding vector in the meta database based on the trained meta-model to determine the task similarity, including: Extracting a first task feature vector of the simulation encoding vector and a second task feature vector of the historical encoding vector using the trained meta-model; According to the kernel function of the meta-model, analyzing the first task feature vector and the second task feature vector to determine the task similarity.
7. The accelerator architecture design method of claim 5, wherein, According to the simulation encoding vector and its expected return and the historical encoding vector in the meta database, using a meta-learning dynamic weight entropy acquisition function to perform dynamic weight entropy search on the accelerator design space to determine a new design scheme, including: According to the historical encoding vector in the meta database and its multi-objective historical simulation results, updating the probability distribution of the simulation encoding vector to obtain a posterior predictive distribution; Based on the information entropy of the posterior predictive distribution and its corresponding dynamic weight, and the expected return and its corresponding meta-knowledge reward weight, the acquisition function value of the current candidate design point is determined; According to the meta-learning dynamic weight entropy acquisition function, all design points in the simulation encoding vector are traversed, and the design scheme corresponding to the maximum acquisition function value is taken as the new design scheme.
8. The accelerator architecture design method of claim 7, wherein, For the determination method of the dynamic weight, the method further includes: Obtaining the optimal solution set of the simulation encoding vector in the tthiteration; According to the kernel density estimation of multi-objective optimization on the optimal solution set, the performance value of the optimal solution set on a single objective, the minimum function value, and the optimal decay coefficient, the dynamic weight of multi-objective optimization in the tthiteration is determined.
9. The accelerator architecture design method of claim 7, wherein, Based on the information entropy of the posterior predictive distribution and its corresponding dynamic weight, and the expected return and its corresponding meta-knowledge reward weight, the acquisition function value of the current candidate design point is determined, including: According to the dynamic weight, the information entropy of the posterior predictive distribution is weighted and averaged to obtain an expected value; Based on the product value of the expected return and the meta-knowledge reward weight and the expected value, the acquisition function value of the current candidate design point is determined.
10. The accelerator architecture design method of claim 1, wherein, In the case that the difference between the new design scheme and the sensitive parameters in the neighbor set meets the difference condition, the new design scheme is subjected to multi-objective optimization simulation, including: Similarity analysis is performed on the new design scheme and the historical design schemes in the historical task data set to determine the neighbor set of the new design scheme; wherein the neighbor set includes at least one neighbor design scheme; From the neighbor set, each type of simulation parameter whose sensitive parameter exceeds the sensitivity threshold is screened out; In the case that the comprehensive absolute difference between each type of simulation parameter in the new design scheme and each type of simulation parameter in each neighbor design scheme is greater than the difference threshold, the new design scheme is subjected to multi-objective optimization simulation by using simulation software to obtain the simulation result of the new design scheme; In the case that the difference between the new design scheme and the sensitive parameters in the neighbor set does not meet the difference condition, the simulation result of the neighbor set is reused, including: In the case that the comprehensive absolute difference between each type of simulation parameter in the new design scheme and each type of simulation parameter in each neighbor design scheme is less than or equal to the difference threshold, the simulation result of the neighbor design scheme with the smallest absolute difference from the new design scheme is taken as the simulation result of the new design scheme.
11. The accelerator architecture design method of claim 10, wherein, For the setting of the sensitivity threshold, the method further includes: Training a graph causal constraint model by using a historical task data set and a target function with graph constraints introduced; Converting historical design schemes contained in the historical task data set into a graph network; Analyzing the graph network by using the trained graph causal constraint model to determine the final historical sensitive parameters; Determining the sensitivity threshold according to the quantile of the historical sensitive parameters in the confidence interval.
12. The accelerator architecture design method of claim 11, wherein, Analyzing the graph network by using the trained graph causal constraint model to determine the final historical sensitive parameters, including: Determining the posterior mean of each iteration according to the regression coefficient of the design parameter in each iteration; Constructing a propagation matrix of the graph network according to the random walk normalization principle; Iterative propagation is performed on the propagation matrix, the sensitivity score of the design parameter at each iteration, and the posterior mean of each iteration to obtain the final historical sensitive parameters.
13. The accelerator architecture design method of any one of claims 1 to 12, wherein, After determining the final accelerator architecture design scheme according to the simulation result corresponding to each design scheme, further including: Converting the accelerator architecture design scheme into a gate-level netlist; Based on the physical design steps of the process library information and each circuit component and interconnection relationship contained in the gate-level netlist, an accelerator is constructed.
14. An electronic device, comprising: Including: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the accelerator architecture design method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Parameterization design method and system for deep learning accelerator chip
CN117236187A
Aero-engine model Bayesian optimization method for quantizing uncertainty
CN121031378A