Compilation method and compilation system of brain-like chip

Through brain-like chip compilation methods and compilation systems, large-scale brain-like applications are automatically deployed, and optimization adjustment and simulation evaluation are used to solve the problem of brain-like chip design space exploration, efficient deployment and performance optimization are achieved, and brain-like computing technology is promoted Widely used.

CN118569155BActive Publication Date: 2024-11-26TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411037639.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-26
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

It is difficult for existing technology to effectively explore and optimize the design space of large-scale brain-like chips, resulting in brain-like compilation optimization technology becoming a bottleneck that hinders the wider development and application of brain-like chips.

Method used

A brain-like chip compilation method and compilation system is proposed. By obtaining pre-trained models and data sets, generating initial architecture, performing optimization adjustments and simulations, evaluating performance based on simulation results, iterating optimization, until the preset optimization goal is met, and the output is optimal Architecture. This method combines partitioning strategies, mapping strategies, verification steps and multiple optimization operations, and utilizes top-level control strategies such as nonlinear optimization, heuristic search, and reinforcement learning.

Benefits of technology

It realizes the automated deployment of complex and large-scale brain-like applications, improves deployment efficiency and flexibility, shortens the design cycle, finds the optimal brain-like chip architecture that meets specific application needs, significantly improves the chip design quality and performance balance, and adapts to different Application scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569155B_ABST
    Figure CN118569155B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and discloses a compilation method and compilation system for brain-like chips. The compilation method includes: obtaining a pre-trained model and data set for brain-like applications; generating an initial brain-like chip architecture and network pulse input; performing optimization and adjustment operations, simulating and evaluating performance; judging whether the optimization goal is met, and optimizing in a loop until the optimal brain-like chip architecture is obtained. This method efficiently explores the optimal brain-like chip architecture in a huge design space through iterative optimization and effective evaluation, thereby improving design quality and efficiency. The present application also provides a corresponding compilation system, including a generator, a simulator, and a compiler, to achieve automated compilation deployment and provide support for large-scale multi-core brain-like chip design.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a compilation method and compilation system for a brain-like chip. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, brain-like computing that simulates the structure and function of the human brain has attracted much attention. As the core of brain-like computing, brain-like chips have shown great potential in achieving high-efficiency, low-latency intelligent computing. Especially in scenarios where resources are limited and real-time response is required, the application prospects of brain-like chips are broad.

[0003] Brain-like chips are often used to implement spiking neural networks (SNNs), which are artificial neural network models that are closer to the working principles of biological neural systems. Compared with traditional artificial neural networks, SNNs have significant advantages in information processing and energy efficiency. However, there are many challenges in efficiently deploying SNN algorithms on brain-like chips.

[0004] In particular, as the scale of applications increases, the design space of brain-inspired chips has expanded dramatically. Traditional manual design methods are unable to cope with such a large design space and cannot effectively explore and optimize chip architecture. Brain-inspired compilation and optimization technology has gradually become a bottleneck hindering the wider development and application of brain-inspired chips. Summary of the invention

[0005] The embodiments of the present application propose a compilation method and a compilation system for a brain-like chip to achieve automated deployment of complex and large-scale brain-like applications and multi-objective optimization of the brain-like chip architecture.

[0006] According to one embodiment of the present application, a compilation method of a brain-like chip is proposed, comprising:

[0007] Obtain pre-trained models and datasets for brain-inspired applications;

[0008] Generate an initial brain-like chip architecture based on the pre-trained model, and generate a network pulse input based on the data set;

[0009] Perform optimization and adjustment operations on the currently obtained brain-like chip architecture;

[0010] Applying the network pulse input to the optimized and adjusted brain-like chip architecture, performing simulation and obtaining simulation results, and evaluating the performance of the optimized and adjusted brain-like chip architecture based on the simulation results to generate an evaluation index value;

[0011] Determine whether the evaluation index value meets a preset optimization goal. If the evaluation index value does not meet the optimization goal, repeat the optimization adjustment, simulation, evaluation and judgment steps until an optimal brain-like chip architecture is obtained in which the evaluation index value meets the optimization goal.

[0012] Output the optimal brain-like chip architecture for deployment.

[0013] In some possible implementations, generating an initial brain-like chip architecture based on the pre-trained model includes:

[0014] According to a preset partitioning strategy, the neurons in the pre-trained model are divided into a plurality of partitions;

[0015] According to a preset mapping strategy, the multiple partitions are mapped to processing units of the brain-like chip architecture.

[0016] In some possible implementations, the method further includes:

[0017] The partition strategy is set based on the pre-trained model, application scenario and hardware platform, and the partition strategy includes one of the following strategies or a weighted combination of multiple strategies: a strategy for minimum number of partitions, a strategy for balanced number of partitions, a strategy for minimum global communication traffic between partitions, a strategy for balanced global communication and local communication traffic between partitions, a strategy for independent partitioning of a single network layer, a strategy for mixed partitioning of multiple network layers, and a strategy for balanced number of neurons within a partition;

[0018] And / or the mapping strategy is set based on the pre-trained model, application scenario and hardware platform, and the mapping strategy includes one of the following strategies or a weighted combination of multiple strategies: communication traffic minimization strategy, communication load balancing strategy, critical path shortest strategy, peak power consumption minimization strategy, average power consumption minimization strategy, deadlock avoidance strategy, and key link aging delay strategy.

[0019] In some possible implementations, after generating the network pulse input and before applying the network pulse input to the brain-like chip architecture to perform simulation, the method further includes verifying the generated network pulse input, wherein the verification includes one or more of the following:

[0020] Format check, used to verify whether the format of pulse input data meets predefined standards;

[0021] Time consistency check to ensure that the timestamps of the pulse trains are correct and in order;

[0022] Frequency analysis, used to verify that the pulse frequency is within the expected range;

[0023] Statistical property analysis, used to check whether the pulse distribution conforms to the expected statistical characteristics;

[0024] Coding consistency check, used to ensure that the pulse encoding method is consistent with the requirements of the pre-trained model;

[0025] Network structure consistency check is used to ensure that the network structure is consistent with the structure of the pre-trained model.

[0026] In some possible implementations, the method further includes:

[0027] The optimization adjustment operation is determined based on a top-level control optimization strategy, and the top-level control optimization strategy includes one of the following methods used alone or in combination: a nonlinear optimization method, a heuristic search method, a reinforcement learning method, a deep learning method, and a large language model method.

[0028] In some possible implementations, the optimization and adjustment operation includes performing one or more of the following in a set order:

[0029] Adjust the division of neurons between partitions;

[0030] Adjust the mapping position of partitions to the processing units of the brain-like chip architecture;

[0031] Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures;

[0032] Balancing the communication load of on-chip networks in brain-like chip architectures;

[0033] Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

[0034] In some possible implementations, the evaluation index value includes a comprehensive weighted value of one or more of the following: power consumption, inference / training speed, and chip area.

[0035] In some possible implementations, the brain-like application is an application for implementing a spiking neural network.

[0036] According to one embodiment of the present application, a compilation system for a brain-like chip is also proposed, including:

[0037] A generator, configured to receive a pre-trained model and a data set, generate an initial brain-like chip architecture based on the pre-trained model, and generate a network pulse input based on the data set;

[0038] A simulator, for receiving a brain-like chip architecture and a network pulse input, performing simulation on the received brain-like chip architecture and outputting the simulation result to a compiler;

[0039] A compiler is used to receive the simulation results, evaluate the performance of the brain-like chip architecture based on the simulation results, generate an evaluation index value, output the brain-like chip architecture whose evaluation index value meets the preset optimization target as the optimal brain-like chip architecture, perform optimization and adjustment operations on the brain-like chip architecture whose evaluation index value does not meet the optimization target, and output the optimized and adjusted brain-like chip architecture to the simulator for further simulation.

[0040] In some possible implementations, the generator includes:

[0041] An architecture generation module, used to generate an initial brain-like chip architecture based on a pre-trained model, including dividing the neurons in the pre-trained model into multiple partitions according to a preset partitioning strategy, and mapping the multiple partitions to processing units of the brain-like chip architecture according to a preset mapping strategy;

[0042] The input generation module is used to generate network pulse input based on the dataset.

[0043] In some possible implementations, the compiler includes:

[0044] An evaluator, used to evaluate the performance of the brain-like chip architecture based on the simulation results and generate an evaluation index value;

[0045] A controller, configured to determine whether the evaluation index value satisfies the optimization target, control the optimizer to perform optimization adjustment operations on the brain-like chip architecture whose evaluation index value does not satisfy the optimization target, and output the brain-like chip architecture whose evaluation index value satisfies the optimization target as the optimal brain-like chip architecture;

[0046] An optimizer is used to perform optimization and adjustment operations on the brain-like chip architecture based on the control of the controller, generate the optimized and adjusted brain-like chip architecture and output it to the simulator.

[0047] In some possible implementations, the optimization and adjustment operation includes performing one or more of the following in a set order:

[0048] Adjust the division of neurons between partitions;

[0049] Adjust the mapping position of partitions to the processing units of the brain-like chip architecture;

[0050] Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures;

[0051] Balancing the communication load of on-chip networks in brain-like chip architectures;

[0052] Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

[0053] In some possible implementations, the controller uses a top-level control optimization strategy to determine the optimization adjustment operation, and the top-level control optimization strategy includes one of the following methods used alone or in combination: nonlinear optimization method, heuristic search method, reinforcement learning method, deep learning method, and large language model method.

[0054] In some possible implementations, the generator, the compiler, and the simulator are deployed on three different computing platforms.

[0055] The compilation method and compilation system of the brain-like chip proposed in this application have the following significant beneficial effects:

[0056] First, by automatically compiling and deploying complex brain-like applications to brain-like chips, the deployment efficiency and flexibility are greatly improved, and the conversion process from pre-trained models to chip architectures can be automatically processed, effectively reducing the need for manual intervention, so that even complex large-scale brain-like applications can be quickly deployed; secondly, by adopting an iterative optimization method, combined with simulation evaluation and a variety of optimization operations, it is possible to effectively explore in a huge design space and find the optimal brain-like chip architecture that meets specific application requirements, which not only improves the quality of chip design, but also significantly shortens the design cycle; moreover, by introducing evaluation indicators and optimization goals, the comprehensive optimization of brain-like chip performance is achieved, so that the final chip architecture can better balance various performance indicators and adapt to the needs of different application scenarios. In addition, according to the automation and scalability characteristics of the technical solution of this application, it provides strong support for the design of large-scale multi-core brain-like chips, which helps to promote the application and development of brain-like computing technology in a wider range of fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0058] Figure 1 A flowchart of a method for compiling a brain-like chip according to an embodiment of the present application is shown;

[0059] Figure 2 A structural block diagram of a compilation system of a brain-like chip according to an exemplary embodiment of the present application is shown;

[0060] Figure 3 A structural block diagram of a compilation system for a brain-like chip according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0061] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0062] The embodiments of the present application can be applied to computer systems / servers, which can operate with many other general or special computing system environments or configurations. Examples of well-known computing systems, environments and / or configurations suitable for use with computer systems / servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0063] Computer systems / servers may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. In general, program modules may include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers may be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules may be located on local or remote computing system storage media including storage devices.

[0064] One aspect of the present application provides a compilation method for a brain-like chip, which can effectively automatically compile and deploy complex brain-like applications on the brain-like chip, and achieve multi-objective optimization of the chip architecture during the compilation process. The technical solution of the present application is described in detail below in conjunction with specific embodiments.

[0065] Figure 1 A flowchart of a method for compiling a brain-like chip according to an embodiment of the present application is shown. As shown in the figure, the method includes steps 1 to 6.

[0066] Step 1: Obtain pre-trained models and datasets for brain-inspired applications.

[0067] In one embodiment of the present application, the brain-like application is to implement the application of spiking neural networks (SNNs). SNNs are an artificial neural network model that is closer to the working principle of biological neural systems and has significant advantages in information processing and energy efficiency.

[0068] The process of obtaining a pre-trained model includes importing the network checkpoint file (ckpt) of the spiking neural network. The ckpt file contains all the parameter states of the SNN at a specific training stage and is a snapshot of the network saved during the training process. By reading the ckpt file, key information such as the weight of the network can be extracted. This information defines the strength of the connection between neurons and the overall structure of the network, which can be used for subsequent architecture generation and optimization adjustments.

[0069] At the same time, a task data set corresponding to the SNN model can also be obtained. The data set usually contains input data for a specific task (such as image classification, speech recognition, etc.). It can be understood by those skilled in the art that the selection of the data set should match the task type of the pre-trained model to ensure that the subsequently generated network pulse input can correctly reflect the actual application scenario.

[0070] Step 2: Generate an initial brain-like chip architecture based on the pre-trained model, and generate a network pulse input based on the data set.

[0071] This step consists of two main parts: generating the initial brain-like chip architecture and generating network pulse input.

[0072] According to one embodiment of the present application, generating an initial brain-like chip architecture based on a pre-trained model may mainly include the following two sub-steps:

[0073] According to a preset partitioning strategy, the neurons in the pre-trained model are divided into a plurality of partitions;

[0074] According to a preset mapping strategy, the multiple partitions are mapped to processing units of the brain-like chip architecture.

[0075] The partition strategy can be set by comprehensively considering the characteristics of the pre-trained model, the target application scenario and the hardware platform. The partition strategy adopted in the implementation of the present application can include one of the following strategies or a weighted combination of multiple strategies:

[0076] The strategy of minimizing the number of partitions is mainly aimed at reducing communication overhead and is suitable for scenarios with high communication costs.

[0077] The partition quantity balancing strategy is used to ensure that the computing load is evenly distributed and is suitable for hardware platforms with strong parallel computing capabilities;

[0078] The strategy of minimizing the global communication traffic between partitions is mainly aimed at reducing cross-partition communication and improving overall efficiency;

[0079] The partitioned global communication and local communication traffic balancing strategy aims to find a balance between global and local communications and is suitable for complex network structures.

[0080] The single network layer independent partitioning strategy is used to ensure that the network structure layer of brain-like applications is divided into the same partition. It is suitable for large and complex network structures to improve the architecture performance.

[0081] The multi-network layer mixed partitioning strategy is used to allow multiple network structure layers of brain-like applications to be mixed and divided into the same partition, which is suitable for small and medium-sized network structures to improve resource utilization efficiency;

[0082] The strategy of balancing the number of neurons within a partition aims to homogenize each partition and balance the resource utilization and performance of each partition.

[0083] Those skilled in the art will appreciate that these strategies may be used individually or in combination in a weighted synthesis manner to meet different needs.

[0084] For example, it is desired to deploy a pre-trained SNN model for image classification on a brain-like chip with 16 processing units (PEs). The SNN model contains an input layer, two hidden layers, and an output layer, with a total of 10,000 neurons. According to this application, considering the application scenario and hardware platform, the following partitioning strategy can be set:

[0085] Partition quantity balancing strategy (weight 0.4);

[0086] Minimum strategy for global communication traffic between partitions (weight 0.4);

[0087] Minimum number of partitions strategy (weight 0.2).

[0088] Based on the above partitioning strategy, the following partitioning can be performed:

[0089] First, the network is initially divided into 16 partitions, each containing approximately 625 neurons to meet the partition quantity balance strategy;

[0090] After that, we analyze the connections between neurons and try to organize closely connected neurons in the same partition to reduce inter-partition communication. For example, we may allocate the neurons of the input layer mainly to the first few partitions, the neurons of the hidden layer to the middle partitions, and the neurons of the output layer to the last few partitions, so as to meet the strategy of minimizing the global communication flow between partitions.

[0091] Finally, it may be found that the number of neurons in some partitions is very small, then the partition can be merged into the adjacent partition, and finally 14 partitions are obtained instead of 16, which satisfies the strategy of minimum number of partitions to a certain extent without significantly affecting the balance.

[0092] The setting of the mapping strategy in the second sub-step can also comprehensively consider the pre-trained model, application scenario and hardware platform. The mapping strategy adopted in the implementation of the present application can include one of the following strategies or a weighted combination of multiple strategies:

[0093] The communication traffic minimization strategy is mainly aimed at reducing the data transmission between processing units;

[0094] The communication load balancing strategy is mainly aimed at ensuring that the communication burden of each processing unit is relatively balanced;

[0095] The shortest critical path strategy aims to optimize the critical calculation path and improve the overall response speed;

[0096] The peak power consumption minimum strategy and the average power consumption minimum strategy are mainly aimed at considering energy consumption factors and are suitable for scenarios that are sensitive to power consumption.

[0097] The deadlock avoidance strategy is mainly aimed at ensuring the stable operation of the compilation system;

[0098] The strategy of delaying the aging of key links is mainly aimed at considering the hardware life and improving the long-term reliability of the compilation system.

[0099] Those skilled in the art will appreciate that these mapping strategies may also be used alone or in combination through weighted synthesis.

[0100] The above example is continued to illustrate the mapping strategy. For example, the following mapping strategy can be set:

[0101] Minimum communication traffic strategy (weight 0.5);

[0102] Load balancing strategy (weight 0.3);

[0103] Minimum power consumption strategy (weight 0.2).

[0104] Based on the above mapping strategy, the following mapping results can be obtained:

[0105] First, partitions with frequent communication are mapped to physically adjacent PEs. For example, partitions containing input layer neurons can be mapped to PEs close to the edge of the chip because these partitions need to directly receive external inputs.

[0106] Then, considering the computational load of each partition (e.g., it can be determined by the number of neurons and activation frequency), try to map high-load partitions and low-load partitions to PEs alternately to achieve load balancing;

[0107] Finally, the power consumption characteristics of certain PEs can be taken into account (for example, PEs in the center of the chip may be more susceptible to heat dissipation), and high-activity partitions can be mapped to these PEs to optimize overall power consumption.

[0108] The above mapping strategy not only meets the communication minimization requirement, but also takes into account load balancing and power consumption optimization.

[0109] Another major part of this step, generating network spike inputs based on the dataset, is the process of converting regular input data into spike trains that the SNN can process. This process usually involves a specific encoding scheme, such as frequency encoding or time encoding.

[0110] According to the present application, after the network pulse input is generated, a series of checks may be performed on it to ensure the quality and validity of the generated pulse input. The checks used in the implementation of the present application may include one or more of the following:

[0111] Format Check: Verifies that the format of the pulse input data complies with predefined standards.

[0112] Time consistency check: Ensures that the timestamps of the pulse trains are correct and in order.

[0113] Frequency Analysis: Verifies that the pulse frequency is within the expected range.

[0114] Statistical characteristic analysis: Check whether the pulse distribution conforms to the expected statistical characteristics.

[0115] Coding consistency check: ensure that the pulse encoding method is consistent with the requirements of the pre-trained model;

[0116] Network structure consistency check is used to ensure that the network structure is consistent with the structure of the pre-trained model.

[0117] By verifying the network pulse input, it is ensured that the generated network pulse input can accurately reflect the characteristics of the original data set and is compatible with the pre-trained model and the obtained brain-like chip architecture.

[0118] Step 3: perform optimization and adjustment operations on the current brain-like chip architecture.

[0119] After the initial brain-like chip architecture is generated, it can be optimized and adjusted to further improve performance, reduce power consumption, optimize resource utilization, etc. The optimization and adjustment operation is one of the core steps in the compilation method proposed in this application, which automatically improves the brain-like chip architecture through a series of operations to make it better adapt to the target application and hardware platform.

[0120] According to some embodiments, the optimization and adjustment operation includes performing one or more of the following in a set order:

[0121] Adjust the division of neurons between partitions;

[0122] Adjust the mapping position of partitions to the processing units of the brain-like chip architecture;

[0123] Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures;

[0124] Balancing the communication load of on-chip networks in brain-like chip architectures;

[0125] Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

[0126] Adjust the division of neurons between partitions to re-evaluate and adjust the initial partitioning results. For example, you may find that the communication overhead between some partitions is too large. At this time, you can try to reallocate neurons that communicate frequently to the same partition, or split the overloaded partition into multiple smaller partitions.

[0127] Adjust the mapping position of partitions to brain-like chip architecture processing units to rearrange the distribution of partitions on physical processing units. For example, if you find that the utilization of some processing units is too low or too high, you can try to readjust the mapping of partitions to achieve better load balancing.

[0128] The performance of the Network-on-Chip (NoC) has an important impact on the efficiency of the overall system. By adjusting the routing and topology strategies of the Network-on-Chip in the brain-like chip architecture, the routing algorithm of the data packet can be changed, or the topology of the NoC can be adjusted to reduce communication delays and improve throughput.

[0129] Balancing the communication load of the on-chip network in the brain-inspired chip architecture is used to avoid network congestion and hot spots. For example, partitions with high communication demands can be reallocated, or data flow patterns can be adjusted to disperse the communication load.

[0130] Adjust the communication arbitration priority of the on-chip network in the brain-like chip architecture to optimize the allocation of network resources. For example, higher transmission priority can be assigned to data packets on critical paths to reduce overall latency.

[0131] The optimization adjustment process is usually managed by a controller in the compiler. The controller can use a top-level control optimization strategy to decide how to perform the above optimization operations. The top-level control optimization strategy adopted according to the implementation of the present application can include the following methods used alone or in combination: nonlinear optimization method, heuristic search method, reinforcement learning method, deep learning method, large language model method.

[0132] Nonlinear optimization methods are mainly used to deal with complex, nonlinear optimization problems.

[0133] Heuristic search methods, such as simulated annealing and genetic algorithms, are used to quickly find near-optimal solutions in large-scale search spaces.

[0134] Reinforcement learning methods are used to learn optimal policies by interacting with the environment, and are particularly suitable for dynamically changing optimization problems.

[0135] Deep learning methods refer to the use of neural networks to learn complex optimization strategies.

[0136] The large language model method refers to using the reasoning ability of large-scale language models to guide optimization decisions.

[0137] These methods can be used individually or in combination. For example, reinforcement learning methods can be used to control the optimization process as a whole, while heuristic search methods can be applied to specific optimization operations.

[0138] The process of controller control management optimization adjustment operation is illustrated by taking reinforcement learning method as an example. In this example, the controller can be used as an agent for reinforcement learning, the current architecture state and evaluation index value constitute the environment state, the selection of optimization operation is regarded as action, and the improvement degree of evaluation index value can be used as reward signal.

[0139] In this way, the controller can learn more effective optimization strategies and make smarter decisions during the optimization process.

[0140] By optimizing and adjusting operations, the brain-like chip architecture has been improved, providing an optimized architecture for subsequent simulation and evaluation, which is very helpful in finding a more optimal solution in the vast design space.

[0141] Step 4: Apply the network pulse input to the optimized and adjusted brain-like chip architecture, perform simulation and obtain simulation results, and evaluate the performance of the optimized and adjusted brain-like chip architecture based on the simulation results to generate evaluation index values.

[0142] Before starting the simulation, the brain-like architecture configuration file and the corresponding network pulse input required for the simulation process can be prepared.

[0143] Specifically, a configuration file describing the brain-like chip architecture can be generated based on the brain-like chip architecture optimized and adjusted in step 3, which includes information such as neuron distribution, connection topology, and processing unit configuration. During the iteration process, the network input pulse data generated in step 2 can remain basically unchanged, but it may be necessary to make slight format adjustments or reorganizations of the network input pulses according to the current optimized and adjusted brain-like chip architecture to ensure better adaptation to the new architecture.

[0144] The simulation process can be performed in the simulator. The simulator can receive the brain-like architecture configuration file and the corresponding network pulse input, and perform system-level simulation to simulate the overall behavior of the brain-like chip architecture, including the activation of neurons, the transmission of synapses, and the communication of the on-chip network, and then output the simulation results.

[0145] During the simulation process, the processing of network pulse input on the brain-like chip architecture will be simulated, and various related data will be recorded.

[0146] After the simulation is completed, the simulator will output a series of raw simulation result data, which may include but are not limited to: the activation pattern of each neuron, the timing information of synaptic transmission, the activity of the processing unit, the communication mode and load of the on-chip network, etc.

[0147] The simulation results are transmitted to the evaluator module in the compiler. The evaluator analyzes the data and evaluates the performance of the brain-like chip architecture, for example, obtaining a hardware PPA evaluation index value. In some embodiments, the evaluation index value may include a comprehensive weighted value of one or more of the following: power consumption, inference / training speed, and chip area.

[0148] Power consumption (Power) can include static power consumption and dynamic power consumption, which reflects the energy efficiency of the architecture; inference / training speed (Performance) is used to indicate the speed at which the architecture processes input data, usually measured in terms of the number of inferences / training times that can be processed per second; chip area (Area) reflects the resource utilization of the architecture and potential manufacturing costs.

[0149] Step 5, determine whether the evaluation index value meets the preset optimization goal. If the evaluation index value does not meet the optimization goal, return to step 3 and repeat the optimization adjustment, simulation, evaluation and judgment steps until the optimal brain-like chip architecture in which the evaluation index value meets the optimization goal is obtained.

[0150] This step is the core control link of the entire compilation optimization process. By judging whether the evaluation index value meets the preset optimization goal, it is decided whether the optimization adjustment process for the brain-like chip architecture continues or has reached the expected optimization goal.

[0151] The controller module in the compiler can receive an evaluation index value from the evaluator. In one example, the evaluation index value combines factors such as power consumption, speed, and area. The controller can compare the evaluation index value with a preset optimization target.

[0152] The setting of optimization goals may vary depending on the application scenario. For example, in resource-constrained scenarios, more emphasis may be placed on minimizing power consumption; in scenarios with high real-time processing requirements, more attention may be paid to speed improvement; in cost-sensitive applications, more emphasis may be placed on area optimization. Multiple (for example, 2) optimization goals can be set at the same time, and when each optimization goal is met, it is determined that the current brain-like chip architecture meets the preset optimization goal.

[0153] The controller can make decisions based on the judgment results. If the evaluation index value meets the preset optimization goal, the optimization process ends and the current brain-like chip architecture is considered to be the optimal brain-like chip architecture. If the evaluation index value does not meet the preset optimization goal, the controller will instruct to return to step 3 and continue to iterate the optimization adjustment.

[0154] When further optimization and adjustment is required, the above steps 3 to 5 can be repeated. Specifically, execute step 3 to perform a new round of optimization and adjustment operations on the current brain-like chip architecture; execute step 4 to simulate the adjusted architecture, evaluate its performance and generate evaluation index values; then execute step 5 again to determine whether the evaluation index values ​​meet the preset optimization goals.

[0155] The above iterative optimization process will be repeated until a brain-like chip architecture with evaluation index values ​​that meet the optimization goals is found, or the preset maximum number of iterations is reached.

[0156] In this application, the brain-like chip architecture is continuously improved until the optimal solution that meets specific application requirements is found, thereby allowing the compilation system to effectively explore the huge design space, and ultimately obtain a high-performance brain-like chip architecture that meets expectations in terms of power consumption, speed, and area.

[0157] Step 6: output the optimal brain-like chip architecture for deployment.

[0158] The output optimal brain-like chip architecture may include the neuron distribution, processing unit configuration, on-chip network topology, memory allocation, timing information, etc. of the optimal brain-like chip architecture.

[0159] In some embodiments, multiple optimal brain-like chip architectures with evaluation index values ​​that meet the optimization goal can be output as candidates for selection and deployment by the target brain-like chip. For example, the optimal brain-like chip architecture with the highest accuracy and the second highest accuracy that meets the optimization goal can be output as the candidate architecture of the target brain-like chip to increase the flexibility of the final selection.

[0160] The compiler can send the optimal brain-like chip architecture to the target brain-like chip through a suitable communication interface.

[0161] In some examples, after receiving the optimal brain-like chip architecture, the brain-like chip can start parsing the optimal brain-like chip architecture, configure various components of the chip according to the parsed content, and initialize the chip status, etc., thereby generating and compiling the optimized brain-like chip architecture according to this application and transforming it from a theoretical design to a practically usable hardware configuration.

[0162] The brain-like chip compilation method proposed in this embodiment realizes the automated compilation and deployment of complex large-scale brain-like applications to brain-like chips, greatly improving the deployment efficiency and flexibility. The above-mentioned brain-like chip compilation method adopts an iterative optimization method, combined with simulation evaluation and multiple optimization operations, to effectively explore in a huge design space and find the optimal brain-like chip architecture that meets specific application requirements. This method not only improves the quality of chip design, but also significantly shortens the design cycle. In addition, by introducing specific evaluation indicators and optimization goals, such as power consumption, reasoning / training speed, chip area, etc., a comprehensive optimization of brain-like chip performance is achieved, so that the final chip architecture can better adapt to the needs of different application scenarios. Moreover, the automation and scalability characteristics of the brain-like chip compilation method provide strong support for the design of large-scale multi-core brain-like chips, which helps to promote the application and development of brain-like computing technology in a wider range of fields.

[0163] In another aspect of the present application, a compilation system for a brain-like chip is also provided. Figure 2 The structure block diagram of the compilation system of the brain-like chip according to an exemplary embodiment of the present application is shown. As shown in the figure, the compilation system includes a generator, a simulator and a compiler.

[0164] The generator is used to receive a pre-trained model (such as a pre-trained SNN model) and a data set, generate an initial brain-like chip architecture based on the pre-trained model, and generate a network pulse input based on the data set.

[0165] In some embodiments, the generator may include:

[0166] An architecture generation module, used to generate an initial brain-like chip architecture based on a pre-trained model, including dividing the neurons in the pre-trained model into multiple partitions according to a preset partitioning strategy, and mapping the multiple partitions to processing units of the brain-like chip architecture according to a preset mapping strategy;

[0167] The input generation module is used to generate network pulse input based on the dataset.

[0168] Figure 2 In the schematic diagram shown, the initial brain-like chip architecture generated by the generator is directly output to the simulator. In other embodiments, the initial brain-like chip architecture generated by the generator may be first transmitted to the compiler for optimization and adjustment and then transmitted to the simulator for simulation. These embodiments all fall within the scope of protection of the present application.

[0169] like Figure 2 As shown, the simulator is used to receive brain-like chip architecture and network pulse input, perform simulation on the received brain-like chip architecture and output the simulation results to the compiler.

[0170] The compiler is used to receive the simulation results, evaluate the performance of the brain-like chip architecture based on the simulation results, generate an evaluation index value, output the brain-like chip architecture whose evaluation index value meets the preset optimization target as the optimal brain-like chip architecture, perform optimization and adjustment operations on the brain-like chip architecture whose evaluation index value does not meet the optimization target, and output the optimized and adjusted brain-like chip architecture to the simulator for further simulation.

[0171] like Figure 2 In the illustrated embodiment, the compiler may include an evaluator, an optimizer, and a controller.

[0172] The evaluator is used to evaluate the performance of the brain-like chip architecture based on the simulation results and generate an evaluation index value.

[0173] The controller is used to determine whether the evaluation index value meets the optimization target, control the optimizer to perform optimization adjustment operations on the brain-like chip architecture whose evaluation index value does not meet the optimization target, and output the brain-like chip architecture whose evaluation index value meets the optimization target as the optimal brain-like chip architecture. Figure 2 In the embodiment shown, the evaluation index value needs to satisfy both optimization target 1 and optimization target 2, and the controller will determine that the evaluation index value satisfies the optimization target. Figure 2 In the illustrated embodiment, the compiler outputs two optimal brain-like chip architectures - a first candidate architecture and a second candidate architecture, to increase the selectivity and flexibility of the final deployment.

[0174] In some embodiments, the controller adopts a top-level control optimization strategy to control the optimization adjustment operation, and the top-level control optimization strategy may include one of the following methods used alone or in combination: nonlinear optimization method, heuristic search method, reinforcement learning method, deep learning method, large language model method.

[0175] The optimizer is used to perform optimization and adjustment operations on the brain-like chip architecture based on the control of the controller, generate the optimized and adjusted brain-like chip architecture and output it to the simulator. In some embodiments, the optimization and adjustment operation includes performing one or more of the following in a set order:

[0176] Adjust the division of neurons between partitions;

[0177] Adjust the mapping position of partitions to the processing units of the brain-like chip architecture;

[0178] Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures;

[0179] Balancing the communication load of on-chip networks in brain-like chip architectures;

[0180] Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

[0181] For other details and advantages of this embodiment, please refer to the above description of the compilation method of the brain-like chip, which will not be repeated here.

[0182] Figure 3 FIG. 1 shows a structural block diagram of a compilation system of a brain-like chip according to an exemplary embodiment of the present application. Figure 3 As shown, the generator, the compiler and the simulator are deployed on three different computing platforms. Different computing platforms may be different nodes of a cloud computing platform, or different parallel computing units, or different physical servers.

[0183] By running the generator, compiler and simulator on different computing platforms, different components can run simultaneously, improving the overall processing speed and flexibly allocating computing resources according to the needs of each component. It is also beneficial to expand the processing power of each component and achieve fault isolation, thereby improving the efficiency, reliability and scalability of the entire compilation system.

[0184] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0185] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0186] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0187] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0188] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0189] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A compilation method for a brain-like chip, It is characterized in that include: Obtain pre-trained models and datasets for brain-inspired applications; Generate an initial brain-like chip architecture based on the pre-trained model, and generate a network pulse input based on the data set, wherein generating the initial brain-like chip architecture based on the pre-trained model includes: dividing the neurons in the pre-trained model into multiple partitions according to a preset partitioning strategy; mapping the multiple partitions to the processing units of the brain-like chip architecture according to a preset mapping strategy; Perform optimization and adjustment operations on the currently obtained brain-like chip architecture; Applying the network pulse input to the optimized and adjusted brain-like chip architecture, performing simulation and obtaining simulation results, and evaluating the performance of the optimized and adjusted brain-like chip architecture based on the simulation results to generate an evaluation index value; Determine whether the evaluation index value meets a preset optimization goal. If the evaluation index value does not meet the optimization goal, repeat the optimization adjustment, simulation, evaluation and judgment steps until an optimal brain-like chip architecture is obtained in which the evaluation index value meets the optimization goal. Outputting the optimal brain-like chip architecture for deployment; The method further comprises: The partition strategy is set based on the pre-trained model, application scenario and hardware platform, and the partition strategy includes one of the following strategies or a weighted combination of multiple strategies: a strategy for minimum number of partitions, a strategy for balanced number of partitions, a strategy for minimum global communication traffic between partitions, a strategy for balanced global communication and local communication traffic between partitions, a strategy for independent partitioning of a single network layer, a strategy for mixed partitioning of multiple network layers, and a strategy for balanced number of neurons within a partition; And / or setting the mapping strategy based on the pre-trained model, application scenario and hardware platform, the mapping strategy includes one of the following strategies or a weighted combination of multiple strategies: communication traffic minimization strategy, communication load balancing strategy, critical path shortest strategy, peak power consumption minimization strategy, average power consumption minimization strategy, deadlock avoidance strategy, and key link aging delay strategy; After generating the network pulse input and before applying the network pulse input to the brain-like chip architecture to perform simulation, the method further includes verifying the generated network pulse input, wherein the verification includes one or more of the following: Format check, used to verify whether the format of pulse input data meets predefined standards; Time consistency check to ensure that the timestamps of the pulse trains are correct and in order; Frequency analysis, used to verify that the pulse frequency is within the expected range; Statistical property analysis, used to check whether the pulse distribution conforms to the expected statistical characteristics; Coding consistency check, used to ensure that the pulse encoding method is consistent with the requirements of the pre-trained model; Network structure consistency check is used to ensure that the network structure is consistent with the structure of the pre-trained model.

2. The method according to claim 1, It is characterized in that The method further comprises: The optimization adjustment operation is determined based on a top-level control optimization strategy, and the top-level control optimization strategy includes one of the following methods used alone or in combination: a nonlinear optimization method, a heuristic search method, a reinforcement learning method, a deep learning method, and a large language model method.

3. The method according to claim 1, It is characterized in that The optimization and adjustment operation includes performing one or more of the following in a set order: Adjust the division of neurons between partitions; Adjust the mapping position of partitions to the processing units of the brain-like chip architecture; Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures; Balancing the communication load of on-chip networks in brain-like chip architectures; Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

4. The method according to claim 1, It is characterized in that The evaluation index value includes a comprehensive weighted value of one or more of the following: power consumption, inference / training speed, and chip area.

5. The method according to claim 1, It is characterized in that The brain-like application is the application of realizing pulse neural network.

6. A compilation system for brain-like chips, It is characterized in that include: A generator is used to receive a pre-trained model and a data set, generate an initial brain-like chip architecture based on the pre-trained model, generate a network pulse input based on the data set, and verify the generated network pulse input, wherein the verification includes one or more of the following: a format check to verify whether the format of the pulse input data meets the predefined standard; a time consistency check to ensure that the timestamps of the pulse sequence are correct and in order; Frequency analysis is used to verify whether the pulse frequency is within the expected range; statistical characteristics analysis is used to check whether the pulse distribution conforms to the expected statistical characteristics; Coding consistency check, used to ensure that the pulse coding method is consistent with the requirements of the pre-trained model; network structure consistency check, used to ensure that the network structure is consistent with the structure of the pre-trained model; A simulator, for receiving a brain-like chip architecture and a network pulse input, performing simulation on the received brain-like chip architecture and outputting the simulation result to a compiler; A compiler, configured to receive the simulation results, evaluate the performance of the brain-like chip architecture based on the simulation results, generate an evaluation index value, output the brain-like chip architecture whose evaluation index value meets a preset optimization target as the optimal brain-like chip architecture, perform an optimization adjustment operation on the brain-like chip architecture whose evaluation index value does not meet the optimization target, and output the optimized and adjusted brain-like chip architecture to the simulator for further simulation; Among them, the generator includes an architecture generation module, which is used to generate an initial brain-like chip architecture based on a pre-trained model, including dividing the neurons in the pre-trained model into multiple partitions according to a preset partitioning strategy, and mapping the multiple partitions to the processing units of the brain-like chip architecture according to a preset mapping strategy, wherein the partitioning strategy is set based on the pre-trained model, the application scenario and the hardware platform, and the partitioning strategy includes one of the following strategies or a weighted combination of multiple strategies: a strategy for minimum number of partitions, a strategy for balanced number of partitions, a strategy for minimum global communication traffic between partitions, a strategy for balanced global and local communication traffic between partitions, a strategy for independent partitioning of a single network layer, a strategy for mixed partitioning of multiple network layers, and a strategy for balanced number of neurons within a partition; and / or the mapping strategy is set based on the pre-trained model, the application scenario and the hardware platform, and the mapping strategy includes one of the following strategies or a weighted combination of multiple strategies: a strategy for minimum communication traffic, a strategy for balanced communication load, a strategy for shortest critical path, a strategy for minimum peak power consumption, a strategy for minimum average power consumption, a strategy for avoiding deadlock, and a strategy for delaying aging of critical links.

7. The system according to claim 6, It is characterized in that The generator also includes: The input generation module is used to generate network pulse input based on the dataset.

8. The system according to claim 6, It is characterized in that The compiler comprises: An evaluator, used to evaluate the performance of the brain-like chip architecture based on the simulation results and generate an evaluation index value; A controller, configured to determine whether the evaluation index value satisfies the optimization target, control the optimizer to perform optimization adjustment operations on the brain-like chip architecture whose evaluation index value does not satisfy the optimization target, and output the brain-like chip architecture whose evaluation index value satisfies the optimization target as the optimal brain-like chip architecture; An optimizer is used to perform optimization and adjustment operations on the brain-like chip architecture based on the control of the controller, generate the optimized and adjusted brain-like chip architecture and output it to the simulator.

9. The system according to claim 6, It is characterized in that The optimization and adjustment operation includes performing one or more of the following in a set order: Adjust the division of neurons between partitions; Adjust the mapping position of partitions to the processing units of the brain-like chip architecture; Adjust the routing and topology strategies of on-chip networks in brain-like chip architectures; Balancing the communication load of on-chip networks in brain-like chip architectures; Adjust the communication arbitration priority of on-chip networks in brain-like chip architectures.

10. The system according to claim 8, It is characterized in that The controller adopts a top-level control optimization strategy to determine the optimization adjustment operation, and the top-level control optimization strategy includes one of the following methods used alone or in combination: nonlinear optimization method, heuristic search method, reinforcement learning method, deep learning method, and large language model method.

11. The system according to claim 6, It is characterized in that The generator, the compiler and the simulator are deployed on three different computing platforms.