Circuit genetic evolution method and system, electronic equipment and storage medium
Through the circuit genetic evolution method, combined with local and global search, and using deep neural network evaluation models to optimize multiplier design, it solves the problems of large design space and high sampling cost in multiplier optimization, and achieves efficient circuit design and performance improvement.
Patent Information
- Application Number
- CN202411253234.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Multiplier optimization is an NP-hard problem with a large combinatorial design space and high sampling cost. It is difficult for existing technology to effectively navigate the design space and obtain an optimization solution with high sample efficiency.
Using the circuit genetic evolution method, the target circuit is modeled as a gene sequence model, combined with local search and global search, using the hybrid learning evaluation model of the deep neural network for iterative optimization, designing local and global structures, and performing multi-granularity genetic variation factors. Intersect and filter until preset conditions are met.
It achieves a high-performance circuit design solution, improves circuit design efficiency, saves design costs, and is significantly better than traditional methods in terms of area and delay.
Smart Images

Figure CN118761368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of machine learning, arithmetic logic circuit optimization and deep evolutionary learning, and in particular to a circuit genetic evolution method and system, an electronic device and a storage medium. Background Art
[0002] Arithmetic logic circuits are the basic building blocks of real-world circuits, especially in central processing units and graphics processing units. In these circuits, multiplication operations have become the focus of research for those skilled in the art due to their fundamentality and frequent use in various computationally intensive applications, such as deep neural networks (DNNs), digital signal processors, and microprocessors. It is worth noting that in many popular DNN architectures, such as ResNet (Deep Residual Network), ViT (Visual Transformer), and BERT (Bidirectional Encoder Representations from Transformers), multiplication operations account for more than 90% of all operations. Therefore, designing high-speed and area-efficient multipliers plays a key role in improving the performance of computationally intensive applications, especially in DNN accelerators.
[0003] However, due to its NP-hard nature, multiplier (or multiplication circuit) optimization is a challenging combinatorial optimization problem. On the one hand, the combinatorial design space grows exponentially with the input bit width of the multiplier. On the other hand, using synthesis tools to cyclically evaluate the post-synthesis performance (design performance) of the multiplier design is very time-consuming, resulting in high sampling costs. Therefore, how to effectively navigate the huge multiplier design space while maintaining high sample efficiency has become an important challenge in the field of multiplier optimization design. Summary of the invention
[0004] In view of the above problems, the present invention provides a circuit genetic evolution method and system, an electronic device and a storage medium.
[0005] According to a first aspect of the present invention, a circuit genetic evolution method is provided, the method comprising:
[0006] The target circuit is modeled as a gene sequence model, and the circuit gene representing the initial structure of the target circuit in the gene sequence model is used as the initial state information of the local search operator;
[0007] The target case set is used to repeatedly restart the initial state of the reinforcement learning agent task to complete the design of the local search operator, and the local search operator is used to optimize the local structure of the gene sequence model;
[0008] A global search operator is designed based on multi-granularity genetic variation factors, and the global search operator is used to perform global structural optimization on the gene sequence model after local structural optimization.
[0009] The hybrid learning evaluation model based on deep neural network is used to screen the gene sequence model after global structure optimization to obtain the gene sequence model after circuit gene update;
[0010] Iterate the local structure optimization operation, the global structure optimization operation and the screening operation until the preset training conditions are met to obtain the target circuit after structural optimization.
[0011] According to an embodiment of the present invention, modeling the target circuit into a gene sequence model includes:
[0012] Determine the distribution state of the compressor tree in the gene sequence model based on the structural information of the target circuit;
[0013] The number of compressors in each column of the compressor tree is used as the circuit gene, and the compressor tree is used to represent the gene sequence.
[0014] According to an embodiment of the present invention, the above-mentioned method of repeatedly restarting the initial state of the reinforcement learning agent task using the target case set to complete the design of the local search operator includes:
[0015] Set the target state of the target case set used in the current training phase as the new initial state;
[0016] Restart the initial state of the reinforcement learning agent task using the new initial state to correct the optimization goal of reinforcement learning;
[0017] The local search operator of the current training phase is designed using reinforcement learning after optimization objective correction.
[0018] According to an embodiment of the present invention, the above-mentioned design of a global search operator based on multi-granularity genetic variation factors includes:
[0019] The action space of reinforcement learning in the current training stage is used to modify the mutation action of the circuit gene in the gene sequence model to complete the design of the single gene granularity mutation operator.
[0020] According to an embodiment of the present invention, the above-mentioned design of a global search operator based on multi-granularity genetic variation factors further includes:
[0021] Two target circuit designs are obtained from the target case set of the current training phase, and a column is randomly selected from each target circuit design;
[0022] Re-cross-combining the circuit genes of the two target circuit design solutions in the selected column to complete the design of the column-granularity crossover operator;
[0023] Two columns are randomly selected from each target circuit design scheme, and the circuit genes of the two target circuit design schemes are recombined between the selected multiple columns to complete the design of the substructure granularity crossover operator.
[0024] According to an embodiment of the present invention, the hybrid learning evaluation model based on a deep neural network is used to screen the gene sequence model after global structure optimization to obtain the gene sequence model after the circuit gene is updated, including:
[0025] A hybrid learning evaluation model is constructed based on a deep neural network, and the hybrid learning evaluation model is used to initially sort the gene sequence model after global structure optimization;
[0026] Screening gene sequence models based on the results of the initial ranking and a predefined performance threshold;
[0027] The gene sequence models obtained by screening are comprehensively sorted using a predefined multi-type sorting method to obtain the updated gene sequence model of the circuit gene in the current training stage.
[0028] According to an embodiment of the present invention, the target circuit includes a multiplication circuit, an addition circuit and a priority encoding circuit.
[0029] According to a second aspect of the present invention, there is provided a circuit genetic evolution system, the system comprising:
[0030] A target circuit modeling module is used to model the target circuit into a gene sequence model, and use the circuit gene representing the initial structure of the target circuit in the gene sequence model as the initial state information of the local search operator;
[0031] The local structure optimization module is used to repeatedly restart the initial state of the reinforcement learning agent task using the target case set to complete the design of the local search operator, and use the local search operator to optimize the local structure of the gene sequence model;
[0032] The global structure optimization module is used to design a global search operator based on multi-granularity genetic variation factors, and use the global search operator to perform global structure optimization on the gene sequence model after local structure optimization;
[0033] A screening module is used to screen the gene sequence model after global structure optimization using a hybrid learning evaluation model based on a deep neural network to obtain a gene sequence model after the circuit gene is updated;
[0034] The iterative training module is used to iteratively perform local structure optimization operations, global structure optimization operations and screening operations until preset training conditions are met to obtain a target circuit after structural optimization.
[0035] A third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0036] The fourth aspect of the present invention further provides a computer-readable storage medium on which a computer program or instruction is stored, and the steps of the above method are implemented when the above computer program or instruction is executed by a processor.
[0037] The circuit genetic evolution method provided by the present invention models the target circuit into a gene sequence model, effectively combines the local search and global search of the target circuit, and utilizes a hybrid learning evaluation model based on a deep neural network to perform genetic iterative evolution on the target circuit; the above method can not only obtain a high-performance circuit design solution, but also improve the efficiency of circuit design, greatly saving the cost of circuit design. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0039] Figure 1 is a flow chart of a circuit genetic evolution algorithm according to an embodiment of the present invention;
[0040] Figure 2 is a circuit genetic evolution framework diagram based on a hybrid learning evaluation model according to an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of the structure of a circuit genetic evolution system according to an embodiment;
[0042] Figure 4 is a schematic diagram of Pareto curve results of a comparative experiment according to an embodiment of the present invention;
[0043] Figure 5 The block diagram of an electronic device suitable for implementing a circuit genetic evolution method according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0044] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0045] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0046] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0047] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0048] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0049] In order to leverage the power of deep learning, researchers recently proposed formulating the multiplier optimization problem as a reinforcement learning (RL) proxy task, which provides a promising path for discovering high-speed and area-efficient multipliers in a sample-efficient manner. Specifically, starting from an initial design solution, the researchers learn a strategy to sequentially modify the design structure locally and use the design performance gain as a reward signal. Intuitively, the hand-designed proxy reward based on performance gain can guide the RL agent to explore directions that gradually improve the design performance.
[0050] In response to the challenges faced in the field of multiplier optimization technology, the researchers of this invention theoretically demonstrated that the optimal strategy based on RL (proxy task) converges to the local optimal multiplier solution (original task), and empirically showed that the underlying design evaluation function is highly oscillatory. Therefore, this leads to a significant optimization target gap between the RL-based proxy task and the original task. Based on theoretical and empirical analysis, the researchers of this invention summarized the key technical points of multiplier optimization: On the one hand, the huge design space and high sampling cost require the learning and generalization capabilities of RL methods to achieve high sample efficiency. However, the proxy RL formula actually optimizes the cumulative discounted performance of all modified solutions in the entire trajectory, ignoring the best case seeking nature of the multiplier optimization task-the final performance is determined by a single or a few best performance multipliers found during training. This leads to a significant optimization target gap between the RL-based proxy task and the original multiplier optimization task. On the other hand, the black box evolutionary algorithm (EA: Evolutionary Algorithm) can directly promote the optimization of the best performance solution. However, due to its gradient-free random search nature, the EA formulation suffers from low sample efficiency, which makes it difficult to effectively navigate the huge design space under high sampling cost. Therefore, existing technical solutions are difficult to solve the technical problems faced by the above multiplication circuit optimization.
[0051] In order to solve the technical problems in the prior art, the present invention provides a circuit genetic evolution method.
[0052] Figure 1 is a flow chart of a circuit genetic evolution algorithm according to an embodiment of the present invention.
[0053] like Figure 1 As shown, the above circuit genetic evolution method includes operations S110 to S150.
[0054] In operation S110, the target circuit is modeled as a gene sequence model, and the circuit gene representing the initial structure of the target circuit in the gene sequence model is used as initial state information of the local search operator.
[0055] According to an embodiment of the present invention, the target circuit includes a multiplication circuit, an addition circuit and a priority coding circuit. Although the present invention takes a multiplication circuit (or a multiplier, the same below) as a specific embodiment, those skilled in the art can apply the method provided by the present invention to other arithmetic logic circuits based on the present invention.
[0056] In operation S120, the initial state of the reinforcement learning agent task is repeatedly restarted using the target case set to complete the design of the local search operator, and the local structure of the gene sequence model is optimized using the local search operator.
[0057] The target case set is usually a best case set with the best training effect. Operation S120 is to design a local search operator based on the best case mechanism.
[0058] In operation S130, a global search operator is designed based on the multi-granularity genetic variation factor, and the global search operator is used to perform global structural optimization on the gene sequence model after local structural optimization.
[0059] In operation S140, the gene sequence model after global structure optimization is screened using a hybrid learning evaluation model based on a deep neural network to obtain a gene sequence model after the circuit gene is updated.
[0060] In operation S150, a local structure optimization operation, a global structure optimization operation, and a screening operation are iteratively performed until a preset training condition is satisfied, thereby obtaining a target circuit after structural optimization.
[0061] The circuit genetic evolution method provided by the present invention models the target circuit into a gene sequence model, effectively combines the local search and global search of the target circuit, and utilizes a hybrid learning evaluation model based on a deep neural network to perform genetic iterative evolution on the target circuit; the above method can not only obtain a high-performance circuit design solution, but also improve the efficiency of circuit design, greatly saving the cost of circuit design.
[0062] According to an embodiment of the present invention, the above-mentioned modeling of the target circuit into a gene sequence model includes: determining the distribution state of the compressor tree in the gene sequence model based on the structural information of the target circuit; taking the number of compressors in each column of the compressor tree as the circuit gene, and using the compressor tree to characterize the gene sequence.
[0063] The above operation involves modeling the target circuit. The number of different compressors in each column implicitly encodes the structure of the compressor tree, which significantly affects the post-synthesis performance of the multiplier. Therefore, the total number of compressors in each column is formulated as a circuit gene, and the compressor tree is used as the gene sequence. This genetic formula is equivalent to the state in the existing RL formula. This equivalence enables the method provided by the present invention to seamlessly transfer information between local search and global exploration.
[0064] According to an embodiment of the present invention, the above-mentioned use of the target case set to repeatedly restart the initial state of the reinforcement learning agent task and then complete the design of the local search operator includes: setting the target state of the target case set used in the current training stage as a new initial state; using the new initial state to restart the initial state of the reinforcement learning agent task and then correct the optimization target of the reinforcement learning; using the reinforcement learning after the optimization target correction to complete the design of the local search operator of the current training stage.
[0065] The design process of the above local search operator is further described in detail below through specific embodiments.
[0066] To improve the sample efficiency of evolutionary search, a natural approach is to integrate learning capabilities into the search framework. However, directly integrating existing RL-based methods does not take into account the nature of seeking the best case in the learning process, resulting in low sample efficiency. To address this challenge, the present invention introduces a best case learning mechanism to the existing RL formulation. The key observation is that incremental reward formulations are good at finding improvements to local solutions from the starting state, although they have difficulty finding the global optimal solution. Consider an extreme example. If the discount factor in the RL formulation is set to 0, the optimization objective becomes maximizing the single-step reward. This guides the agent to always choose actions that can improve the next state, thereby achieving local improvements. Therefore, the present invention reformulates the existing RL formulation by introducing a best case restart initial state distribution. Specifically, the present invention repeatedly restarts the initial state of the RL agent by setting the currently found best state as the new initial state. This adjustment approximately corrects the original RL optimization objective to the objective of seeking the best case.
[0067] According to an embodiment of the present invention, the above-mentioned global search operator based on multi-granularity genetic mutation factors includes: using the action space of reinforcement learning in the current training stage to modify the mutation action of the circuit gene in the gene sequence model to complete the design of the single gene granularity mutation operator; obtaining two target circuit design schemes from the target case set of the current training stage, and randomly selecting a column from each target circuit design scheme; re-cross-combining the circuit genes of the two target circuit design schemes in the selected column to complete the design of the column granularity crossover operator; randomly selecting two columns from each target circuit design scheme, and re-combining the circuit genes of the two target circuit design schemes between the selected multiple columns to complete the design of the substructure granularity crossover operator.
[0068] The design process of the above-mentioned global search operator is further described in detail below through specific embodiments.
[0069] Existing RL formulations restrict structural modifications to incremental changes of a single column and 3:2 or 2:2 compressors, because larger modifications often lead to illegal structures and designing legalization mechanisms is challenging. However, local modification actions significantly limit exploration capabilities. In order to enhance global exploration and escape local optima, it is critical to develop structural modification operators that can make substantial changes. To this end, the present invention first reformulates each state as a genetic sequence. Based on this genetic reformulation, the present invention designs a novel multi-granularity genetic mutation operator.
[0070] Based on the above circuit genetic formula proposed by the present invention, the present invention can design mutation operators of various granularities, which are inspired by the mutation and recombination processes that produce diversity in biological evolution. The main advantage is that the granularity of multiplier structure changes can be expanded from a single column level to a multi-column level, and can be expanded from incremental changes involving only one compressor to substantial changes involving multiple compressors. This significantly enhances the global exploration capability of the technical solution of the present invention, thereby improving the ability of the technical solution of the present invention to escape from the local optimal solution.
[0071] In the design process of the single-gene granularity mutation operator, inspired by the mutation process in biological evolution, the mutation operator selects a column of the design solution and applies local modifications to specific genes (compressor numbers) in that column for mutation. It is impractical to mutate genes without restriction because it poses a huge challenge to legalize these mutated solutions. Therefore, the present invention utilizes local modifications designed in the existing RL action space as mutation actions, which have well-defined heuristic methods for legalizing any mutated solution. To choose which column to mutate and what type of local modification to apply, the present invention can utilize a random strategy or any RL strategy.
[0072] In the column-granular crossover operator design process, given two high-performance design solutions and , the present invention models the solution as a gene sequence, i.e.
[0073] ,
[0074] .
[0075] In order to recombine these high-performance genes to obtain high-quality offspring, the column-granular crossover operator randomly selects a column and recombine the genes of the two solutions in that column. Specifically, the column-granular crossover operator generates two children in the following form:
[0076] ,
[0077] ,
[0078] in is the selected column.
[0079] In the substructure granularity crossover operator design process, given two high-performance design solutions and , in order to recombine these high-performance genes and obtain high-quality offspring, the substructure granularity crossover operator randomly selects two columns and recombine the genes of the two solutions between the selected columns. Specifically, the substructure granularity crossover operator generates two children in the following form:
[0080] ,
[0081] ,
[0082] in and are the two selected columns.
[0083] According to an embodiment of the present invention, the above-mentioned use of a hybrid learning evaluation model based on a deep neural network to screen the gene sequence model after global structure optimization to obtain the gene sequence model after the circuit gene is updated includes: constructing a hybrid learning evaluation model based on a deep neural network, and using the hybrid learning evaluation model to initially sort the gene sequence model after global structure optimization; screening the gene sequence model based on the result of the initial sorting and a predefined performance threshold; using a predefined multi-type sorting method to comprehensively sort the gene sequence models obtained by the screening to obtain the gene sequence model after the circuit gene is updated in the current training stage.
[0084] The above screening process provided by the present invention is further described in detail below through specific examples.
[0085] The success of EA search usually relies on sampling a large number of solutions. However, in the multiplier optimization task, it is very time-consuming to evaluate each design solution using a synthesis tool, which significantly limits the number of samples that the EA method can handle. In order to significantly improve the sample efficiency, the present invention proposes to use a deep neural network to learn the evaluation model, which is inspired by model-based RL. This fast evaluation model enables fast sampling and parallel evaluation of a large number of design solutions, significantly improving the search efficiency. However, previous model-based RL methods have shown that directly using a learning model to replace the real environment will suffer from the problem of model utilization, that is, overfitting model errors. To solve this problem, the present invention proposes a model-based hybrid evaluation method to use the learning model conservatively. Specifically, the method of the present invention involves using a predictive model to pre-rank the generated multiplier designs and filter out designs with low estimated performance. Then, the present invention uses a synthesis tool to fine-rank the selected top k designs.
[0086] Figure 2 4 is a circuit genetic evolution framework diagram based on a hybrid learning evaluation model according to an embodiment of the present invention.
[0087] like Figure 2As shown, the above-mentioned circuit genetic evolution framework (MUTE) based on the hybrid learning evaluation model provided by the present invention promotes the optimization of the best performance solution while achieving high sample efficiency. The main innovations of MUTE come from two aspects. (1) Effective local search through approximate base case learning. Since the use of performance gain as a proxy reward can effectively improve the solution locally, MUTE regards the RL agent as an efficient local search operator for a given initial solution and repeatedly restarts its initial state from the currently found best state to approximate the best case to seek the goal. In addition, MUTE uses the collected experience to learn the evaluation model, so the time-consuming circuit synthesis process can be eliminated from the loop. (2) Effective global exploration through multi-granular genetic mutation. Based on the observation that the underlying design evaluation function is highly oscillatory and has many local optimal points, the local modifications in the existing formula are subject to limited exploration capabilities, making it difficult to escape the local optimal point. Therefore, MUTE proposes a multi-granular genetic mutation operator to promote effective global exploration by mutating and recombining circuit genes at different granularities.
[0088] The significance of MUTE for hardware design lies in the study of the applicability of reinforcement learning (RL) for circuit design space exploration, and the use of evolutionary search as a superior alternative for optimizing circuits such as multipliers, adders, and priority encoders. For the field of machine learning, the MUTE iterative evolutionary framework of the present invention effectively combines local search with global exploration, providing a general and powerful solution for sample-efficient evolutionary search. The experiments attached to the present invention show that the designs discovered by MUTE have significant Pareto advantages over those generated by manual design, mathematical optimization-based, and learning-based methods, achieving up to 58% hypervolume. In addition, the present invention deploys MUTE-optimized multipliers and baselines to large-scale computationally intensive circuits, and experiments show that MUTE significantly outperforms the baseline in terms of area and delay. The results of the present invention highlight the superior ability of MUTE in discovering high-speed and area-efficient circuits suitable for real-world computing applications.
[0089] Figure 3 is a schematic diagram of the structure of a circuit genetic evolution system according to an embodiment.
[0090] like Figure 3 As shown, the circuit genetic evolution system includes a target circuit modeling module 310 , a local structure optimization module 320 , a global structure optimization module 330 , a screening module 340 and an iterative training module 350 .
[0091] The target circuit modeling module 310 is used to model the target circuit into a gene sequence model, and use the circuit gene representing the initial structure of the target circuit in the gene sequence model as the initial state information of the local search operator. The target circuit modeling module 310 can be used to perform the operation S110 described above, which will not be repeated here.
[0092] The local structure optimization module 320 is used to repeatedly restart the initial state of the reinforcement learning agent task using the target case set to complete the design of the local search operator, and optimize the local structure of the gene sequence model using the local search operator. The local structure optimization module 320 can be used to perform the operation S120 described above, which will not be repeated here.
[0093] The global structure optimization module 330 is used to design a global search operator based on multi-granularity genetic variation factors, and use the global search operator to perform global structure optimization on the gene sequence model after local structure optimization. The global structure optimization module 330 can be used to perform the operation S130 described above, which will not be repeated here.
[0094] The screening module 340 is used to screen the gene sequence model after global structure optimization using a hybrid learning evaluation model based on a deep neural network to obtain a gene sequence model after the circuit gene is updated. The screening module 340 can be used to perform the operation S140 described above, which will not be repeated here.
[0095] The iterative training module 350 is used to iteratively perform local structure optimization operations, global structure optimization operations and screening operations until the preset training conditions are met to obtain a target circuit after structure optimization. The iterative training module 350 can be used to perform the operation S150 described above, which will not be repeated here.
[0096] According to an embodiment of the present invention, any multiple modules of the target circuit modeling module 310, the local structure optimization module 320, the global structure optimization module 330, the screening module 340 and the iterative training module 350 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the target circuit modeling module 310, the local structure optimization module 320, the global structure optimization module 330, the screening module 340 and the iterative training module 350 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a proper combination of any of them. Alternatively, at least one of the target circuit modeling module 310, the local structure optimization module 320, the global structure optimization module 330, the screening module 340 and the iterative training module 350 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0097] The effectiveness and advantages of the above method provided by the present invention are further illustrated by comparative experiments and accompanying drawings.
[0098] Figure 4 Schematic diagram of Pareto curve results of comparative experiments according to an embodiment of the present invention.
[0099] In the experiment set up by the present invention, the OpenROAD flow and NanGate 45nm open source cell library were used for circuit synthesis, and OpenSTA was used for timing analysis. These settings follow previous work. These tools represent the most advanced open source chip design automation (EDA) tools and are widely used in EDA research. The method provided by the present invention was applied to eight different multiplier design tasks, including 8-bit wide, 16-bit wide, 32-bit wide, and 64-bit wide multipliers based on AND gates and Booth-coded partial product generation techniques.
[0100] The results of the comparative experiment of the present invention are as follows Figure 4 As shown, area represents area, delay represents delay, and lines of different colors represent different methods. For comparison, the present invention compares the performance difference between the MUTE algorithm and the current most advanced algorithms such as existing reinforcement learning in multiplier optimization tasks. Figure 4 It can be seen that the method provided by the present invention far exceeds the comparative method in performance.
[0101] The following is a specific example to illustrate the process of the method provided by the present invention in practical application.
[0102] In the preparation stage: for the multiplication circuit optimization task, it is modeled into two parts: the agent and the environment. The agent receives the state selection structure adjustment action from the multiplication circuit environment feedback; the environment receives the action to obtain a new state, that is, a new multiplication circuit architecture. Then, the reward accepted by the agent is set. Maximizing the performance of the multiplication circuit architecture is the goal of the present invention.
[0103] In the training phase: using deep learning methods to achieve Figure 2 The framework diagram in . Deploy it in the agent. The agent follows the corresponding process in the pseudocode to interact with the environment and use the interaction information for policy training. Repeat the training for a period of time.
[0104] In the verification stage: the multiplication circuit architecture in the training process is translated and optimized using actual circuit synthesis tools to obtain a multiplication circuit design with small area and high speed.
[0105] Figure 5 The block diagram of an electronic device suitable for implementing a circuit genetic evolution method according to an embodiment of the present invention is schematically shown.
[0106] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present invention includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0107] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0108] According to an embodiment of the present invention, the electronic device 500 may further include an input / output (I / O) interface 905, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that the computer program read therefrom is installed into the storage portion 508 as needed.
[0109] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0110] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0113] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A circuit genetic evolution method, characterized in that: The method comprises: Modeling the target circuit into a gene sequence model, and using the circuit gene representing the initial structure of the target circuit in the gene sequence model as the initial state information of the local search operator; The initial state of the reinforcement learning agent task is repeatedly restarted by using the target case set to complete the design of the local search operator, and the local structure of the gene sequence model is optimized by using the local search operator; Designing a global search operator based on multi-granularity genetic variation factors, and using the global search operator to perform global structural optimization on the gene sequence model after local structural optimization; The hybrid learning evaluation model based on deep neural network is used to screen the gene sequence model after global structure optimization to obtain the gene sequence model after circuit gene update; Iterate the local structure optimization operation, the global structure optimization operation and the screening operation until the preset training conditions are met to obtain the target circuit after structural optimization.
2. The method according to claim 1, characterized in that Modeling the target circuit into a gene sequence model includes: Determining a distribution state of a compressor tree in the gene sequence model based on structural information of the target circuit; The number of compressors in each column of the compressor tree is used as a circuit gene, and the compressor tree is used to represent a gene sequence.
3. The method according to claim 1, characterized in that Using the target case set to repeatedly restart the initial state of the reinforcement learning agent task to complete the design of the local search operator includes: Set the target state of the target case set used in the current training phase as the new initial state; Restarting the initial state of the reinforcement learning agent task using the new initial state to correct the optimization goal of the reinforcement learning; The local search operator of the current training phase is designed using reinforcement learning after optimization objective correction.
4. The method according to claim 1, characterized in that: The global search operators designed based on multi-granularity genetic variation factors include: The action space of reinforcement learning in the current training phase is used to modify the mutation action of the circuit gene in the gene sequence model to complete the design of the single gene granularity mutation operator.
5. The method according to claim 1, characterized in that Also includes: Two target circuit design solutions are obtained from the target case set in the current training phase, and a column is randomly selected from each of the target circuit design solutions; Re-cross-combining the circuit genes of the two target circuit design solutions in the selected column to complete the design of the column-granularity crossover operator; Two columns are randomly selected from each of the target circuit design solutions, and the circuit genes of the two target circuit design solutions are recombined between the selected multiple columns to complete the design of the substructure granularity crossover operator.
6. The method according to claim 1, characterized in that The hybrid learning evaluation model based on deep neural network is used to screen the gene sequence model after global structure optimization, and the gene sequence model after circuit gene update includes: Constructing a hybrid learning evaluation model based on a deep neural network, and using the hybrid learning evaluation model to initially sort the gene sequence model after the global structure optimization; Screening the gene sequence model based on the result of the initial sorting and a predefined performance threshold; The gene sequence models obtained by screening are comprehensively sorted using a predefined multi-type sorting method to obtain the updated gene sequence model of the circuit gene in the current training stage.
7. The method according to claim 1, wherein: The target circuit includes a multiplication circuit, an addition circuit and a priority encoding circuit.
8. A circuit genetic evolution system, characterized in that: The system comprises: A target circuit modeling module, used to model the target circuit into a gene sequence model, and use the circuit gene representing the initial structure of the target circuit in the gene sequence model as the initial state information of the local search operator; A local structure optimization module, used to repeatedly restart the initial state of the reinforcement learning agent task using the target case set to complete the design of the local search operator, and optimize the local structure of the gene sequence model using the local search operator; A global structure optimization module, which is used to design a global search operator based on multi-granularity genetic variation factors, and use the global search operator to perform global structure optimization on the gene sequence model after local structure optimization; A screening module is used to screen the gene sequence model after global structure optimization using a hybrid learning evaluation model based on a deep neural network to obtain a gene sequence model after the circuit gene is updated; The iterative training module is used to iteratively perform local structure optimization operations, global structure optimization operations and screening operations until preset training conditions are met to obtain a target circuit after structural optimization.
9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program or instruction is stored thereon, wherein when the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Self-adaptive learning neural network implementation method based on evolutionary algorithm
CN105279555A
Parallel analog circuit optimization method based on genetic algorithm and machine learning
CN110245436A
Circuit board layout optimization method and device, electronic equipment and storage medium
CN117313630A
Scalable flexibility control of distributed loads in a power grid
US20180269687A1
A parallel analog circuit optimization method based on genetic algorithm and machine learning
US20230092630A1
Cited By
Liquid crystal elastomer structure multi-objective optimization method based on depth evolution mapping
CN121439049A
Liquid crystal elastomer structure multi-objective optimization method based on deep evolutionary mapping
CN121439049B
