Energy consumption calculation method of deep pulse neural network training architecture and related equipment
Through the energy consumption calculation method of the deep pulse neural network training architecture, the problem of energy consumption calculation of deep pulse neural network training tasks is solved, and accurate calculation of energy consumption and energy consumption are achieved.
Patent Information
- Application Number
- CN202411827416.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The prior art is difficult to effectively solve the energy consumption problem of deep pulse neural network training tasks, especially in the training process that depends on GPU, resulting in lower training and inference energy efficiency.
A method for energy consumption calculation of deep pulse neural network training architecture is proposed. By obtaining the number of operations of pulse convolution in training tasks, membrane potential gradient convolution and weight gradient in the number of operations of logical discrimination, floating point addition and floating point multiplication, as well as the reuse factor of variables in memory, the task read and write energy consumption and calculation energy consumption are calculated, and the task energy consumption is accumulated.
Accurate calculation of energy consumption during deep pulse neural network training is realized, reducing task energy consumption and improving the accuracy of energy consumption calculation.
Smart Images

Figure CN119940458A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to an energy consumption calculation method and related equipment for a deep pulse neural network training architecture. Background Art
[0002] With the growing demand for intelligent computing, traditional intelligent computing architectures (GPU, TPU) are increasingly unable to cope with challenges related to energy efficiency. Neuromorphic computing is a paradigm that aims to mimic the structure and function of the human brain, providing an important way to realize new energy-efficient intelligent computing systems. As the basis of neuromorphic computing, spiking neural networks (SNNs) have attracted much attention due to their unique potential in high energy efficiency and simulation of biological neural processes. As the classification accuracy of deep SNN models approaches that of traditional deep neural networks (DNNs), they have demonstrated great potential in realizing efficient intelligent computing.
[0003] However, the development of hardware that supports efficient SNN training is seriously lagging behind. Existing near-memory computing chips, such as TrueNorth, Loihi, and Tianjic, are mainly used for feedforward computing and local learning methods, such as synaptic timing-dependent plasticity, but are insufficient in deep SNN training that relies on global optimization methods based on error back propagation (BP), making current SNN training mainly dependent on GPUs. Due to the lack of targeted optimization of GPUs for key features of SNNs such as multi-step computing and pulse convolution, it consumes more memory and takes longer to train than DNN training on GPUs, resulting in lower training and reasoning energy efficiency. Therefore, the research and development of energy-efficient hardware architectures that meet the data representation and computing characteristics for deep SNN global optimization training tasks has become a hot topic in the field of energy-efficient intelligent computing. As the basis for supporting the rapid iteration of intelligent computing architecture research and development towards high energy efficiency, systematic energy consumption evaluation methods have formed a number of relatively mature methods and software tools in DNN reasoning accelerators, such as TimesLoop and ZigZag, but there is currently no training energy consumption method suitable for deep pulse neural network training tasks. Summary of the invention
[0004] The embodiments of the present application provide an energy consumption calculation method and related equipment for a deep pulse neural network training architecture, which can accurately obtain the energy consumption of the deep pulse neural network model during the training process.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for calculating energy consumption of a deep pulse neural network training architecture, the method comprising:
[0006] Obtain the number of operations of logical discrimination, floating-point addition and floating-point multiplication in the pulse convolution, membrane potential gradient convolution and weight gradient of the deep pulse neural network training task, wherein the number of operations includes the number of logical discrimination corresponding to the logical discrimination, the number of accumulation operations corresponding to the floating-point addition and the number of accumulation operations corresponding to the floating-point multiplication;
[0007] Respectively obtaining reuse factors of a plurality of the variables for read and write operations in a memory of the deep spiking neural network training architecture, the memory comprising DRAM, SRAM, and registers;
[0008] Calculating the task read and write energy consumption based on the number of logical determinations, the reuse factor and the unit read and write energy consumption of the memory;
[0009] Calculate the task computing energy consumption based on the number of accumulation operations, the number of multiplication operations, the number of logic determinations and the corresponding unit computing energy consumption;
[0010] The task energy consumption of the deep pulse neural network training task is obtained by accumulating the task reading and writing energy consumption and the task computing energy consumption.
[0011] In some embodiments, the calculating the task read / write energy consumption based on the logic determination quantity, the reuse factor and the unit read / write energy consumption of the memory includes:
[0012] Obtaining from the logical discrimination quantity a forward pass discrimination quantity corresponding to the forward pass and a weight gradient discrimination quantity corresponding to the weight gradient update;
[0013] Obtaining from the reuse factors a forward transfer reuse factor corresponding to the forward transfer, a back propagation reuse factor corresponding to error back propagation, and a weight gradient reuse factor corresponding to the weight gradient update;
[0014] Based on the forward transfer discrimination quantity, the forward transfer reuse factor and the unit read and write energy consumption, the forward transfer read and write energy consumption is calculated;
[0015] The back propagation read and write energy consumption is calculated based on the number of back propagation cumulative multiplication operations, the back propagation reuse factor, and the unit read and write energy consumption, wherein the number of back propagation cumulative multiplication operations corresponds to the error back propagation;
[0016] Based on the weight gradient discrimination quantity, the weight gradient reuse factor and the unit read-write energy consumption, the weight gradient read-write energy consumption is calculated, and the forward pass read-write energy consumption, the back propagation read-write energy consumption and the weight gradient read-write energy consumption are accumulated to obtain the task read-write energy consumption.
[0017] In some embodiments, the deep pulse neural network training task includes multiple layers of neurons, and the forward transfer read and write energy consumption is calculated based on the forward transfer discriminant quantity, the forward transfer reuse factor, and the unit read and write energy consumption, including:
[0018] For each of the variables, the variable read / write energy consumption is obtained based on the ratio of the corresponding unit read / write energy consumption and the forward transfer reuse factor, and the forward variable read / write energy consumption is obtained by accumulating all the variable read / write energy consumptions;
[0019] Accumulating the forward transmission discrimination quantity of all the neurons to obtain the model forward discrimination quantity;
[0020] The forward transfer read-write energy consumption is obtained by multiplying the model forward discrimination quantity and the forward variable read-write energy consumption.
[0021] In some embodiments, the unit computing energy consumption includes determination unit computing energy consumption, accumulation unit computing energy consumption, and multiplication unit computing energy consumption, and the task computing energy consumption is calculated based on the number of accumulation operations, the number of multiplication operations, the number of logic determinations, and the corresponding unit computing energy consumption, including:
[0022] Obtaining from the number of accumulation operations the number of forward transfer accumulation operations corresponding to the forward transfer, the number of back propagation accumulation operations corresponding to the error back propagation, and the number of weight gradient accumulation operations corresponding to the weight gradient update, and obtaining from the number of accumulation operations the number of back propagation accumulation operations corresponding to the error back propagation;
[0023] Accumulate all the forward transfer determination numbers, multiply by the determination unit calculation energy consumption, and add the product of the forward transfer accumulation operation number and the accumulation unit calculation energy consumption to obtain the forward transfer calculation energy consumption;
[0024] Accumulate all the back-propagation accumulation operation numbers, multiply by the accumulation unit calculation energy consumption, and add the product of the back-propagation accumulation multiplication operation number and the multiplication unit calculation energy consumption to obtain the back-propagation calculation energy consumption;
[0025] Accumulate all the weight gradient discrimination quantities, multiply by the discrimination unit calculation energy consumption, and add the product of the weight gradient accumulation operation quantity and the accumulation unit calculation energy consumption to obtain the weight gradient calculation energy consumption;
[0026] The forward pass computing energy consumption, the back propagation computing energy consumption and the weight gradient computing energy consumption are accumulated to obtain the task computing energy consumption.
[0027] In some embodiments, respectively obtaining reuse factors of the plurality of variables for reading and writing operations in the memory of the deep spiking neural network training architecture comprises:
[0028] Taking each of the variables as the target variable one by one;
[0029] The reuse factor corresponding to the target variable is generated based on the read and write operations of the target variable in the first data transmission process or the second data transmission process, wherein the first data transmission process is a data transmission process between the register and the SRAM, and the second data transmission process is a data transmission process between the SRAM and the DRAM.
[0030] In some embodiments, the number of logical judgments includes the number of forward pass judgments and the number of weight gradient judgments, the number of logical judgments includes the number of forward pass judgments and the number of weight gradient judgments, the number of accumulation operations includes the number of forward pass accumulation operations, the number of back propagation accumulation operations and the number of weight gradient accumulation operations, and the number of logical judgments corresponding to the logical judgment operations and the number of accumulation operations corresponding to the accumulation operations for multiple variables in the deep pulse neural network training task are obtained, including:
[0031] Generate the forward transfer discrimination quantity and the forward transfer accumulation operation quantity according to the convolution operation in the forward transfer update function in the deep spiking neural network training task;
[0032] Generate the number of back-propagation accumulation operations and the number of back-propagation accumulation multiplication operations according to the convolution operation and the multiplication operation in the back-propagation update function in the deep spiking neural network training task;
[0033] The weight gradient discrimination quantity and the weight gradient accumulation operation quantity are generated according to the convolution operation in the weight gradient update function in the deep pulse neural network training task.
[0034] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a deep pulse neural network training architecture, wherein the system includes a forward transmission component, a back-propagation component, a unified buffer area, and a computing processor;
[0035] The forward transfer component includes a forward transfer engine and a first direct memory access module connected to each other, and the first direct memory access module is connected to the unified cache area;
[0036] The back propagation component includes a back propagation engine, a weight gradient engine and a second direct memory access module, the back propagation engine and the weight gradient engine are both connected to the second direct memory access module, and the second direct memory access module is connected to the unified cache area;
[0037] The computing processor is used to execute the energy consumption calculation method of the deep pulse neural network training architecture as described in the first aspect.
[0038] In some embodiments, the forward pass component is used to perform forward pass processing in a deep spiking neural network training task;
[0039] The back propagation component is used to perform error back propagation processing and weight gradient update processing in deep pulse neural network training tasks.
[0040] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes an energy consumption calculation device for a deep pulse neural network training architecture, the device comprising:
[0041] A calculation quantity acquisition module is used to obtain the number of operations of logical discrimination, floating-point addition and floating-point multiplication in pulse convolution, membrane potential gradient convolution and weight gradient of deep pulse neural network training tasks, wherein the number of operations includes the number of logical discrimination corresponding to logical discrimination, the number of accumulation operations corresponding to floating-point addition and the number of accumulation operations corresponding to floating-point multiplication;
[0042] A reuse factor acquisition module, used to respectively acquire reuse factors of a plurality of variables for read and write operations in a memory of the deep pulse neural network training architecture, wherein the memory includes DRAM, SRAM and registers;
[0043] A read / write energy consumption calculation module, used to calculate the task read / write energy consumption based on the logic determination quantity, the reuse factor and the unit read / write energy consumption of the memory;
[0044] A computing energy consumption calculation module, used to calculate the task computing energy consumption based on the number of accumulation operations, the number of multiplication operations, the number of logic judgments and the corresponding unit computing energy consumption;
[0045] The task energy consumption calculation module is used to accumulate the task reading and writing energy consumption and the task computing energy consumption to obtain the task energy consumption of the deep pulse neural network training task.
[0046] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the energy consumption calculation method of the deep pulse neural network training architecture as described in the first aspect.
[0047] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, it implements the energy consumption calculation method of the deep pulse neural network training architecture described in the first aspect above.
[0048] The energy consumption calculation method and related equipment of the deep pulse neural network training architecture proposed in the embodiment of the present application include: first, obtaining the number of operations of logical discrimination, floating-point addition and floating-point multiplication in the pulse convolution, membrane potential gradient convolution and weight gradient of the deep pulse neural network training task, the operation number includes the number of logical discrimination corresponding to the logical discrimination, the number of accumulation operations corresponding to the floating-point addition and the number of accumulation operations corresponding to the floating-point multiplication; secondly, respectively obtaining the reuse factors of the read and write operations of multiple variables in the memory of the deep pulse neural network training architecture, the memory includes DRAM, SRAM and registers; next, based on the number of logical discrimination, the reuse factor and the unit read and write energy consumption of the memory, the task read and write energy consumption is calculated; then, based on the number of accumulation operations, the number of accumulation operations, the number of logical discrimination and the corresponding unit calculation energy consumption, the task calculation energy consumption is calculated; finally, the task read and write energy consumption and the task calculation energy consumption are accumulated to obtain the task energy consumption of the deep pulse neural network training task. The embodiments of the present application focus on the number of logical judgments corresponding to logical judgment operations on multiple variables in a deep pulse neural network training task and the number of accumulation operations corresponding to accumulation operations. The reuse factor generated by the read and write characteristics of the memory of the deep pulse neural network training architecture is used to reduce the number of read and write operations on the same data. The unit read and write energy consumption and the unit computing energy consumption are further combined to reduce the task energy consumption corresponding to the deep pulse neural network training task while accurately calculating the task energy consumption corresponding to the neural network computing task.
[0049] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a structural diagram of a deep pulse neural network training architecture provided in one embodiment of the present application.
[0051] Figure 2 This is a flowchart of a method for calculating energy consumption of a deep pulse neural network training architecture provided in another embodiment of the present application.
[0052] Figure 3 yes Figure 2 Flow chart of step 201 in FIG.
[0053] Figure 4 This is a schematic diagram of changes in convolution calculation during a forward transfer process provided by another embodiment of the present application.
[0054] Figure 5 This is a schematic diagram of changes in convolution calculation during a back-propagation process provided by another embodiment of the present application.
[0055] Figure 6 This is a schematic diagram of the changes in convolution kernel gradient convolution calculation provided by another embodiment of the present application.
[0056] Figure 7 This is a schematic diagram of the read and write actions of a memory provided in another embodiment of the present application.
[0057] Figure 8 yes Figure 2 Flow chart of step 202 in FIG.
[0058] Fig. 9 This is a schematic diagram of a reuse factor of each variable at each level of storage provided by another embodiment of the present application.
[0059] Fig.10 This is a schematic diagram of unit read and write energy consumption of each level of storage provided by another embodiment of the present application.
[0060] Fig.11 It is a schematic diagram of the unit read and write energy consumption of each variable at each level of storage provided by another embodiment of the present application.
[0061] Fig.12 This is a schematic diagram of power consumption of an operator provided in yet another embodiment of the present application.
[0062] Fig.13 yes Figure 2 Flow chart of step 203 in FIG.
[0063] Fig.14 yes Fig.13 Flowchart of step 1303 in FIG.
[0064] Fig.15 yes Figure 2 Flow chart of step 204 in FIG.
[0065] Fig.16 It is a structural schematic diagram of an energy consumption calculation device for a deep pulse neural network training architecture provided in yet another embodiment of the present application.
[0066] Fig.17 This is a schematic diagram of the hardware structure of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0070] With the growing demand for intelligent computing, traditional intelligent computing architectures (GPU, TPU) are increasingly unable to cope with challenges related to energy efficiency. Neuromorphic computing is a paradigm that aims to mimic the structure and function of the human brain, providing an important way to realize new energy-efficient intelligent computing systems. As the basis of neuromorphic computing, spiking neural networks (SNNs) have attracted much attention due to their unique potential in high energy efficiency and simulation of biological neural processes. As the classification accuracy of deep SNN models approaches that of traditional deep neural networks (DNNs), they have demonstrated great potential in realizing efficient intelligent computing.
[0071] However, the development of hardware that supports efficient SNN training is seriously lagging behind. Existing near-memory computing chips, such as TrueNorth, Loihi, and Tianjic, are mainly used for feedforward computing and local learning methods, such as synaptic timing-dependent plasticity, but are insufficient in deep SNN training that relies on global optimization methods based on error back propagation (BP), making current SNN training mainly dependent on GPUs. Due to the lack of targeted optimization of GPUs for key features of SNNs such as multi-step computing and pulse convolution, it consumes more memory and takes longer to train than DNN training on GPUs, resulting in lower training and reasoning energy efficiency. Therefore, the research and development of energy-efficient hardware architectures that meet the data representation and computing characteristics for deep SNN global optimization training tasks has become a hot topic in the field of energy-efficient intelligent computing. As the basis for supporting the rapid iteration of intelligent computing architecture research and development towards high energy efficiency, systematic energy consumption evaluation methods have formed a number of relatively mature methods and software tools in DNN reasoning accelerators, such as TimesLoop and ZigZag, but there is currently no training energy consumption method suitable for deep pulse neural network training tasks.
[0072] In order to accurately obtain the energy consumption of the pulse neural network model during the training process, the embodiment of the present application performs logical judgment operations corresponding to the number of logical judgment operations and the number of accumulation operations corresponding to the accumulation operations on multiple variables in the deep pulse neural network training task, and uses the reuse factor generated by the read and write characteristics of the memory of the pulse neural network model to reduce the number of read and write operations of the same data, and further combines the unit read and write energy consumption and the unit computing energy consumption. It can reduce the task energy consumption corresponding to the deep pulse neural network training task while accurately calculating the task energy consumption corresponding to the neural network computing task.
[0073] The following will further describe the energy consumption calculation method and related equipment of the deep pulse neural network training architecture provided by the embodiment of the present application. First, the deep pulse neural network training architecture provided by the embodiment of the present application is described. Figure 1 , is a schematic diagram of a deep pulse neural network training architecture provided in an embodiment of the present application. Figure 1As shown in , the deep pulse neural network training architecture is provided with a forward pass component, a back propagation component, a unified cache area and a computing processor. Among them, the forward pass component is also the forward pass sub-core (FP Sub-Core), which is mainly responsible for processing the forward pass (FP) process of the pulse neural network. In this process, the input data is passed through the network layer, and the neurons of each layer calculate the output according to the input and weight until the prediction result of the network is finally generated. The back propagation component is also the back propagation sub-core (BP Sub-Core), which is mainly responsible for processing the back propagation (BP) process of the pulse neural network. During the training process, back propagation is used to calculate the gradient of the loss function with respect to the network parameters (such as weights), and these gradients are then used to update the network parameters to reduce the prediction error. The unified cache area is a dynamic random access memory (DRAM), which is used to store all parameter data of the pulse neural network during the training process.
[0074] like Figure 1 As shown in FIG. , the forward transfer component includes a forward transfer engine (FP Engine) and a first direct memory access module (ie, Figure 1 The DMA module in the forward pass component is shown in Figure 1). Variables s dedicated to spiking neural networks are designed in the forward pass engine. l-1 、w l-1 、ConvFP l The static random access memory (SRAM) has a capacity / bit width of 32KB / 1bit, 576KB / 16bit, and 128KB / 16bit, respectively. A FP Array of 16×16 Mux-Add units suitable for pulse convolution is also designed. Each Mux-Add unit consists of a 1-bit logic discriminator, an FP16 accumulator, a 1-bit Reg (storing 1 pulse data), and two 16-bit Regs (storing 1 weight and partial sum data respectively). The DMA module is connected to the DRAM and SRAM respectively, and is used to read and write data between the DRAM and SRAM.
[0075] like Figure 1 As shown in , the back propagation component includes a back propagation engine (BP Engine), a weight gradient engine (WGEngine), and a second direct memory access module (i.e., Figure 1 As shown in the DMA module in the back propagation component, the back propagation engine and the weight gradient engine are both connected to the second direct memory access module, and the second direct memory access module is connected to the unified cache area. The BP Engine is designed with a variable ▽u dedicated to the spiking neural network l+1 , w′ l, ConvBP l The SRAM has a capacity / bit width of 128KB / 16bit, 576KB / 16bit, and 128KB / 16bit, respectively. A BP Array of 16×16 Mul-Add units suitable for membrane potential gradient convolution is designed. Each Mul-Add unit consists of an FP16 multiplier and adder, and 3 16-bit Regs (store 1 weight and part of the data respectively). WG Engine has designed a variable s dedicated to spiking neural networks. l 、▽w l The SRAM has a capacity / bit width of 16KB / 1bit and 9KB / 16bit respectively. The WG Engine and BP Engine share the variables of the pulse neural network. l+1 The 16×16 Mux-Add units of the WG Array are designed for weight gradient calculation. The DMA module is connected to the DRAM and SRAM respectively, and is used to read and write data between DRAM and SRAM.
[0076] Based on the above deep pulse neural network training architecture, the energy consumption calculation method of the deep pulse neural network training architecture will be further described below. Figure 2 , is an optional flow chart of the energy consumption calculation method of the deep pulse neural network training architecture provided in the embodiment of the present application, Figure 2 The method may include but is not limited to steps 201 to 204. It can also be understood that this embodiment Figure 2 The order of steps 201 to 204 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or increased according to actual needs. The energy consumption calculation method of the deep pulse neural network training architecture provided in the embodiment of the present application can be applied to the computing processor in the deep pulse neural network training architecture.
[0077] Step 201: Obtain the number of operations of logical discrimination, floating-point addition, and floating-point multiplication in the pulse convolution, membrane potential gradient convolution, and weight gradient of the deep pulse neural network training task.
[0078] The following is a detailed description of step 201.
[0079] In some embodiments, during the calculation process of the pulse neural network, its energy consumption is mainly due to the read and write operations of the variable parameter data in the memory, and the parameter calculation (including logical judgment, accumulation operation and multiplication operation). Therefore, in order to accurately calculate the energy consumption of the deep pulse neural network training architecture for any deep pulse neural network training task during the training process, it is first necessary to determine the number of operations of logical discrimination, floating-point addition and floating-point multiplication in the pulse convolution, membrane potential gradient convolution and weight gradient in the deep pulse neural network training task, including the number of logical discrimination corresponding to the logical discrimination, the number of accumulation operations corresponding to the floating-point addition and the number of accumulation operations corresponding to the floating-point multiplication.
[0080] In this embodiment, a deep pulse neural network training task with L layers of neurons is taken as an example, and its variables include Each layer L l They are all composed of LIF neuron models with T time steps. The membrane potential, pulse, pulse convolution, weight and gradient of the l-layer neurons are: The reverse membrane potential gradient, pulse gradient, weight transposition and membrane potential gradient convolution of the l-layer neurons are: and in, is a set of real numbers, C l , H l and W l are the number of channels, length and width of the Feature Map (FM) layer l, M l , R l and S l They are the convolution kernel w l The number, length and width of the dataset, and B is the BatchSize for one training.
[0081] The following will further describe how to obtain the number of logical judgments and the number of cumulative operations for the deep pulse neural network training task.
[0082] Reference Figure 3 , obtaining the number of logical discrimination operations corresponding to the logical discrimination operations and the number of accumulation operations corresponding to the accumulation operations of multiple variables in the deep pulse neural network training task, including the following steps 301 to 303.
[0083] Step 301: Generate the number of forward pass discriminations and the number of forward pass accumulation operations according to the convolution operation in the forward pass update function corresponding to the pulse convolution in the deep pulse neural network training task.
[0084] Step 302: Generate the number of back-propagation accumulation operations and the number of back-propagation accumulation operations according to the convolution operation and the multiplication operation in the back-propagation update function corresponding to the membrane potential gradient convolution in the deep spike neural network training task.
[0085] Step 303: Generate the number of weight gradient discriminations and the number of weight gradient accumulation operations according to the convolution operation in the weight gradient update function corresponding to the weight gradient in the deep spike neural network training task.
[0086] Steps 301 to 303 are described in detail below.
[0087] Based on the above-mentioned deep pulse neural network training task of L-layer neurons, the forward transfer update function corresponding to the pulse convolution in the forward transfer (FP) process of the deep pulse neural network training task can be shown as follows: Formula (1) to Formula (3).
[0088]
[0089] Among them, ⊙ represents the element-by-element multiplication of two matrices of the same type, Represents a convolution operation. The potential update includes time and space parts. The time part is determined by the potential, pulse and leakage factor α at the previous moment, while the space part is determined by the weighted accumulation of pulses of the previous layer of neurons. When the potential crosses the threshold th f When , the neuron will trigger a pulse electric potential zero. Where f(x) is a step function. If x≥th f , f(x)=1; otherwise, f(x)=0. The main computational effort of the forward pass process is concentrated on the pulse convolution of formula (2). The basic computational operations are 1-bit pulse signal logic discrimination (Mux) and FP16 accumulation (Add) operations. The Add operation is performed only when the pulse signal is 1.
[0090] Reference Figure 4 , is a schematic diagram of the changes in convolution calculation in the forward transmission process provided by an embodiment of the present application. Figure 4 As shown in , the basic correspondence between variables is the pulse of the bth FM at the tth time step in the l-1th layer. and the mth weight of the l-1th layer The convolution of the lth layer, the tth time step, the bth FM, and the mth band are obtained. Right now The other operations in the forward pass process are element-wise calculations, which are several orders of magnitude lower than the pulse convolution operation and can be ignored.
[0091] Based on this, let the sparsity rate of the l-1 layer of pulse data after convolution be Spar l∈[0,1], according to the convolution operation in the forward pass update function (1-3) corresponding to the pulse convolution in the deep pulse neural network training task The number of forward pass discrimination operations (i.e., the number of Mux operations) and the number of forward pass accumulation operations (i.e., the number of Add operations) required for the l-th layer of pulse convolution can be further generated as shown in the following formulas (4) and (5), respectively.
[0092]
[0093] Among them, according to the relationship between the convolution calculation dimensions, M l-1 =C l .
[0094] Based on the above-mentioned deep spiking neural network training task of L-layer neurons, the potential gradient in the back propagation (BP) of the deep spiking neural network training task The update definition is as shown in the following formula (6).
[0095]
[0096] The derivative of the step function f′(x) is approximated by the pulse curve. If th l ≤x≤th r , f′(x)=1, otherwise f′(x)=0. Based on this, the back propagation update function corresponding to the membrane potential gradient convolution in the deep spike neural network training task, namely the spike gradient It is defined as shown in the following formula (7) and formula (8).
[0097]
[0098] The gradient of the pulse It is also composed of time and space parts. The time part is determined by the potential gradient at the next moment and the potential at the current moment, and the space part is determined by the weighted accumulation of the potential gradient of the next layer.
[0099] Reference Figure 5 , is a schematic diagram of the changes in convolution calculation during the back propagation process provided by an embodiment of the present application. Figure 5 As shown in , the basic correspondence between variables is the membrane potential gradient of the bth FM (b∈{1,…,B}) at the tth time step in the l+1th layer. and the cth transposed weight of the lth layer The convolution of the lth layer, the tth time step, the bth FM, and the cth band are obtained. Right now According to the corresponding relationship between the convolution calculation dimensions, M l =C l+l .
[0100] Since the amount of calculation in the back propagation process is mainly concentrated in formula (8), and since the membrane potential gradient and weight are both FP16, the number of back propagation cumulative operations (i.e., the number of FP16 Add operations) and the number of back propagation cumulative multiplication operations (i.e., the number of FP16 Mul operations) of the lth layer of membrane potential gradient convolution are generated according to the convolution operation and multiplication operation in the back propagation update function corresponding to the membrane potential gradient convolution in the deep spike neural network training task as shown in the following formula (9).
[0101]
[0102] Among them, Figure 5 As shown in , according to the relationship between the convolution calculation dimensions, M 1 =C l+1 .
[0103] Based on the above-mentioned deep spiking neural network training task of L layers of neurons, the weight gradient update function corresponding to the weight gradient in the back propagation (BP) of the deep spiking neural network training task is the weight gradient (WG) As shown in the following formula (10).
[0104]
[0105] Reference Figure 6 , is a schematic diagram of a change in convolution kernel gradient convolution calculation provided in an embodiment of the present application. Figure 6 As shown in , the basic correspondence between variables is: the l+1th layer, the tth time step, the bth FM, the cth band (c∈{1,…,C l +1}) of the membrane potential gradient and the pulse of the bth FM at the tth time step of the lth layer Convolution band by band obtains the mth weight gradient of the lth layer The partial sum of B×C l+1 The final weight gradient can be obtained by summing the parts
[0106] As shown in formula (10), the basic calculation operation for weight gradient solution is also 1-bit pulse signal logic discrimination (Mux) and FP16 accumulation (Add). Let the sparsity rate of the l-th layer of pulse data after convolution be Spar l According to the convolution operation in the weight gradient update function corresponding to the weight gradient in the deep spike neural network training task, the number of weight gradient discriminations (i.e., the number of Mux operations) and the number of weight gradient accumulation operations (i.e., the number of Add operations) of the lth layer are generated as shown in the following formulas (11) and (12), respectively.
[0107]
[0108] Through the above steps 301 to 304, for the convolution operations and multiplication operations required in the forward transfer, error back propagation and weight gradient related update functions in the deep spiking neural network training task, the number of logical judgment operations, the number of accumulation operations and the number of multiplication operations corresponding to the logical judgment operations, accumulation operations and multiplication operations performed in the training process of each layer of neurons in the deep spiking neural network training task are accurately obtained, so as to facilitate the subsequent more accurate calculation of the energy consumption of the deep spiking neural network training task.
[0109] Step 202: Obtain reuse factors of a plurality of variables for read and write operations in a memory of a deep spiking neural network training architecture, respectively.
[0110] Step 202 is described in detail below.
[0111] In some embodiments, in order to effectively reduce the energy consumption of a deep pulse neural network training task during the training process in a deep pulse neural network training architecture, it is necessary to generate a reuse factor in advance based on repeated data of read and write operations performed in the memory of the deep pulse neural network training architecture based on multiple variables of the deep pulse neural network training task, so as to utilize the reuse factor generated by the read and write characteristics of the memory of the deep pulse neural network training architecture to reduce the number of read and write operations on the same data.
[0112] Reference Figure 7 , is a schematic diagram of a memory read and write operation provided by an embodiment of the present application. Figure 7 As shown in , the memory of the deep pulse neural network training architecture includes registers Regs, static memory SRAM (i.e. Figure 1 The SRAM used to store variables in the back propagation component and the forward pass component shown in FIG) and the dynamic memory DRAM (i.e., as shown in FIG). Figure 1 ). Figure 1 The computing units shown in (including weight gradient engine, back propagation engine and forward pass engine) drive the data in Data flows between the three levels of memory to form a data flow. Therefore, the data flow describes the read and write dependencies and data volume of each operator variable on each level of memory. A good data flow can significantly reduce the amount of read and write data by improving data reuse on each level of memory, thereby reducing the computing power consumption of the architecture. Regs refers to the set of all Regs in the computing unit Array, and Reg directly provides data to each computing unit.
[0113] According to the read-write relationship between memories, the following actions are defined. For Regs, Figure 7 As shown in , its actions include writing data from SRAM (Write in from SRAM, W2S) and reading data from SRAM (Read out form SRAM, R2S). For SRAM, Figure 7 As shown, its actions include reading data out to Regs (Read out to Regs, R2R), writing data from Regs (Write in from Regs, W2R), writing data from DRAM (Write in from DRAM, W2D) and reading data out to DRAM (Read out to DRAM, R2D). For DRAM, Figure 7 As shown, its actions include reading data to SRAM (Read out to SRAM, R2S) and writing data from SRAM (Write in from SRAM, W2S).
[0114] Based on Figure 7 The schematic diagram of the memory read and write operation is shown in FIG. 1 . The following further describes how to determine the reuse factors of multiple variables.
[0115] Reference Figure 8 , obtaining a reuse factor of multiple variables for read and write operations in a memory of a deep pulse neural network training architecture, including the following steps 801 to 802.
[0116] Step 801: Take each variable as the target variable one by one.
[0117] Step 802: Generate a reuse factor corresponding to the target variable based on the read and write operations of the target variable in the first data transmission process or the second data transmission process.
[0118] Steps 801 to 802 are described in detail below.
[0119] Based on the above described memory read and write action diagrams, it can be determined that the data amounts of a pair of read and write actions between adjacent memories are consistent, such as the amount of data written to Regs by the W2S action is equal to the amount of data read from SRAM by the R2R action.
[0120] Therefore, based on Figure 7 The defined read and write actions and the calling paths of each variable, such as in the forward convolution process, s l-1 and w l-1 As input parameters, data is sent down from DRAM level by level. As output parameter data, Regs are uploaded level by level. Data reuse occurs on the three levels of storage: Regs, SRAM, and DRAM, defining the reuse factor of each variable on each level of storage.
[0121] Furthermore, each variable is used as a target variable one by one, and then based on the read and write operations of the target variable in the first data transmission process or the second data transmission process, a reuse factor corresponding to the target variable is generated. The first data transmission process is the data transmission process between the register Regs and the static memory SRAM, and the second data transmission process is the data transmission process between the static memory SRAM and the dynamic memory DRAM.
[0122] Reference Fig. 9 , is a schematic diagram of the reuse factor of each variable at each level of storage provided by an embodiment of the present application. Fig. 9 As shown in , the reuse factor of each variable in the deep spike neural network training task (such as RU1, RU2, etc.) is listed, with variable s l-1 For example, it needs to be read from SRAM and transferred to Regs (ie, R2R action) and written by Regs (ie, W2S action) in one read and write operation. These two actions are actually an action group for the same variable data, so they have the same reuse factor RU1.
[0123] Through the above steps 801 to 802, by utilizing the read and write actions defined in the memory of the deep pulse neural network training architecture and the calling path of each variable, combined with the reuse factor generated by the same data in the same read and write action process, the same operation data can be effectively utilized to reduce the energy consumption during the deep pulse neural network training task training process.
[0124] In some embodiments, in order to accurately obtain the energy consumption during the deep pulse neural network training task, it is also necessary to pre-acquire the unit reading and writing energy consumption of each variable during the reading and writing process and the unit calculation energy consumption during the calculation processing (such as logical judgment, floating-point addition and floating-point multiplication).
[0125] Based on Figure 1 The deep pulse neural network training architecture shown in the figure has different unit read and write energy consumption for different hardware devices. Fig.10 , is a schematic diagram of the unit read and write energy consumption of each level of storage provided by an embodiment of the present application. Fig.10 As shown in , the unit read and write energy consumption of hardware with different variables is shown, which can be obtained through the public hardware parameters.
[0126] Reference Fig.11 , is a schematic diagram of the unit read and write energy consumption of each variable at each level of storage provided by an embodiment of the present application. Fig.11 As shown in Fig.10 The unit read and write energy consumption of each level of storage as shown in Fig. 9 The reuse factors corresponding to the variables shown generate the unit read and write energy consumption of each variable at each level of storage.
[0127] Based on Figure 1 The deep pulse neural network training architecture shown in the figure has different unit computing energy consumption required for different computing processes (such as logical judgment, floating point addition, and floating point multiplication). Fig.12 , is a schematic diagram of power consumption of an operator provided in an embodiment of the present application. Fig.12 As shown in , the unit computing energy consumption required for different computing processes (such as logical determination, floating-point addition, and floating-point multiplication) is shown, which can be obtained through public hardware parameters.
[0128] Step 203: Calculate the task read and write energy consumption based on the number of logical determinations, the reuse factor, and the unit read and write energy consumption of the memory.
[0129] Step 203 is described in detail below.
[0130] In some embodiments, based on the number of logical judgments performed in each layer of neurons in the acquired deep pulse neural network training task, the reuse factor of each variable and the unit read and write energy consumption of the memory, the task read and write energy consumption required for performing variable read and write operations in the memory (including registers Regs, static memory SRAM and dynamic memory DRAM) in the deep pulse neural network training task can be further calculated, as described below.
[0131] Reference Fig.13 , based on the number of logical judgments, the reuse factor and the unit read and write energy consumption of the memory, the task read and write energy consumption is calculated, including the following steps 1301 to 1305.
[0132] Step 1301: Obtain the forward pass discrimination quantity corresponding to the forward pass and the weight gradient discrimination quantity corresponding to the weight gradient update from the logical discrimination quantity.
[0133] Step 1302: Obtain from the reuse factors a forward pass reuse factor corresponding to the forward pass, a back propagation reuse factor corresponding to the error back propagation, and a weight gradient reuse factor corresponding to the weight gradient update.
[0134] Step 1303: Based on the forward transfer judgment quantity, the forward transfer reuse factor, and the unit read and write energy consumption, the forward transfer read and write energy consumption is calculated.
[0135] Steps 1301 to 1303 are described in detail below.
[0136] In some embodiments, after obtaining the number of logical judgments, the number of forward transfer judgments corresponding to the forward transfer in each layer of neurons (i.e., the above formula (4)) and the number of weight gradient judgments corresponding to the weight gradient update (i.e., the above formula (11)) are determined one by one.
[0137] Then, from Fig. 9 The variables corresponding to the forward pass (including s l-1 、w l-1 、ConvFP l ) corresponding to the forward transfer reuse factor (including RU1, RU2, RU3, RU4, RU5, RU6), and the variables corresponding to the error back propagation (including w′ l , ConvBP l ) corresponding to the back propagation reuse factor (including RU7, RU8, RU9, RU 10 , R.U. 11 , R.U. 12 ) and the variables corresponding to the weight gradient updates ( s l , ) corresponding to the weight gradient reuse factor (including RU 13 , R.U. 14 , R.U. 15 , R.U. 16 , R.U. 17 , R.U. 18 ).
[0138] Next, based on the corresponding forward pass, the number of discriminants The forward transfer reuse factor (including RU1, RU2, RU3, RU4, RU5, RU6) and the unit read and write energy consumption are used to calculate the forward transfer read and write energy consumption. The details are described as follows.
[0139] Reference Fig.14 , based on the forward transfer judgment quantity, the forward transfer reuse factor and the unit read and write energy consumption, the forward transfer read and write energy consumption is calculated, including the following steps 1401 to 1403.
[0140] Step 1401: for each variable, obtain the variable read / write energy consumption based on the ratio of the corresponding unit read / write energy consumption and the forward transfer reuse factor, and accumulate all variable read / write energy consumptions to obtain the forward variable read / write energy consumption.
[0141] Step 1402: Accumulate the forward propagation discrimination quantities of all neurons to obtain the model forward discrimination quantity.
[0142] Step 1403: Multiply the model forward discrimination quantity and the forward variable read and write energy consumption to obtain the forward transfer read and write energy consumption.
[0143] Steps 1401 to 1403 are described in detail below.
[0144] In some embodiments, first for each variable corresponding to the forward pass (including s l-1 、w l-1 、ConvFP l ), based on Fig.11 The variable read and write energy consumption is obtained by the ratio of the unit read and write energy consumption corresponding to each variable shown and the forward transfer reuse factor (including RU1, RU2, RU3, RU4, RU5, and RU6), and the forward variable read and write energy consumption is obtained by accumulating all variable read and write energy consumptions as shown below.
[0145]
[0146] Then, the forward propagation discriminant number of all layers of neurons is accumulated to obtain the forward discriminant number of the model. Furthermore, the forward discriminant quantity of the model and the forward variable read and write energy consumption are multiplied to obtain the forward transfer read and write energy consumption as shown in the following formula (13).
[0147]
[0148] Step 1304: Calculate the back propagation read and write energy consumption based on the number of back propagation cumulative multiplication operations, the back propagation reuse factor, and the unit read and write energy consumption.
[0149] Step 1305: Based on the weight gradient discrimination quantity, the weight gradient reuse factor and the unit read and write energy consumption, the weight gradient read and write energy consumption is calculated, and the forward pass read and write energy consumption, the back propagation read and write energy consumption and the weight gradient read and write energy consumption are accumulated to obtain the task read and write energy consumption.
[0150] Steps 1304 to 1305 are described in detail below.
[0151] In some embodiments, similar to step 1401 to step 1403, based on the number of back propagation accumulation operations corresponding to the back propagation in each layer of neurons, The back propagation reuse factor corresponding to the back propagation (including RU7, RU8, RU9, RU 10 , R.U. 11 , R.U. 12 ), and the variables corresponding to the back propagation (including w′ l , ConvBP l ) corresponding to the unit read and write energy consumption, and the back propagation read and write energy consumption is calculated As shown in the following formula (14).
[0152]
[0153] Similar to steps 1401 to 1403, the weight gradient corresponding to the weight gradient update in each layer of neurons is determined. The weight gradient reuse factor corresponding to the weight gradient update (including RU 13 , R.U. 14 , R.U. 15 , R.U. 16 , R.U. 17 , R.U. 18 ), and the variables corresponding to the weight gradient update ( s l , ) corresponding to the unit read and write energy consumption, and the weighted gradient read and write energy consumption is calculated As shown in the following formula (15).
[0154]
[0155] Furthermore, the energy consumption of forward pass reading and writing is accumulated Back propagation read and write energy consumption And the energy consumption of reading and writing weight gradients Get the task reading and writing energy consumption E required for the deep pulse neural network training task to read and write during the training process m As shown in the following formula (16).
[0156]
[0157] Through the above steps 1301 to 1305, and steps 1401 to 1403, the common factors corresponding to the variables corresponding to the forward pass, back propagation and weight gradient update are used one by one, and the number of operations required for the read and write operations corresponding to each forward pass, back propagation and weight gradient update is accurately obtained in advance, so that the task read and write energy consumption required for the deep pulse neural network training task to read and write during the training process can be accurately obtained, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task.
[0158] Step 204: based on the number of accumulated operations, the number of logical determinations and the unit calculation energy consumption of the memory, the task calculation energy consumption is calculated.
[0159] Step 204 is described in detail below.
[0160] In some embodiments, based on the number of logical judgments, the number of accumulation operations, the number of multiplication operations corresponding to the calculation processing (including logical judgments, accumulation operations and multiplication operations) performed in each layer of neurons in the acquired deep pulse neural network training task, the reuse factor of each variable and the unit calculation energy consumption of the memory, the task calculation energy consumption required for the deep pulse neural network training task to perform variable calculation operations in the register can be further calculated, as described below.
[0161] Reference Fig.15 , based on the number of accumulated operations, the number of logical judgments and the unit calculation energy consumption of the memory, the task calculation energy consumption is calculated, including the following steps 1501 to 1505.
[0162] Step 1501: Obtain the number of forward pass accumulation operations corresponding to the forward pass, the number of back propagation accumulation operations corresponding to the error back propagation, and the number of weight gradient accumulation operations corresponding to the weight gradient update from the number of accumulation operations, and obtain the number of back propagation accumulation operations corresponding to the error back propagation from the number of multiplication operations.
[0163] Step 1502: Accumulate all forward pass judgment numbers and multiply by the judgment unit calculation energy consumption, and add the product of the forward pass accumulation operation number and the accumulation unit calculation energy consumption to obtain the forward pass calculation energy consumption.
[0164] Step 1503: Accumulate the number of all back-propagation accumulation operations, multiply by the accumulation unit calculation energy consumption, and add the product of the number of back-propagation accumulation multiplication operations and the multiplication unit calculation energy consumption to obtain the back-propagation calculation energy consumption.
[0165] Step 1504: Accumulate all weight gradient judgment numbers and multiply by the judgment unit calculation energy consumption, and then add the product of the weight gradient accumulation operation number and the accumulation unit calculation energy consumption to obtain the weight gradient calculation energy consumption.
[0166] Step 1505: Accumulate the forward pass computing energy consumption, the back propagation computing energy consumption and the weight gradient computing energy consumption to obtain the task computing energy consumption.
[0167] Steps 1501 to 1505 are described in detail below.
[0168] In some embodiments, after obtaining the number of accumulation operations, the number of forward transfer accumulation operations corresponding to the forward transfer in each layer of neurons (i.e., the above formula (5)), the number of back propagation accumulation operations corresponding to the error back propagation (i.e., the above formula (9)), and the number of weight gradient accumulation operations corresponding to the weight gradient update (i.e., the above formula (12)) are determined one by one, and the number of back propagation accumulation operations corresponding to the error back propagation is obtained from the number of multiplication operations (i.e., the above formula (9)).
[0169] Then, the forward propagation discriminant number of all layers of neurons is accumulated And multiply it by the discriminant unit to calculate the energy consumption o0, plus the number of cumulative operations in the forward pass The product of the accumulated unit computing energy consumption o1 is obtained to obtain the forward transfer computing energy consumption required in the forward transfer process as shown in the following formula (17).
[0170]
[0171] Similarly, the number of back propagation accumulation operations of all layers of neurons is accumulated And multiply it by the cumulative unit to calculate the energy consumption o1, plus the number of back propagation cumulative multiplication operations The product of the multiplication unit calculation energy consumption o2 is obtained by the back propagation calculation energy consumption required in the back propagation process as shown in the following formula (18).
[0172]
[0173] Similarly, the weight gradient discriminant quantity of all layers of neurons is accumulated And multiply it by the discriminant unit to calculate the energy consumption o0, plus the number of weight gradient accumulation operations The product of the accumulated unit calculation energy consumption o1 is the weight gradient calculation energy consumption required in the weight gradient update process as shown in the following formula (19).
[0174]
[0175] Finally, the forward pass computation energy consumption is accumulated Back propagation calculation energy consumption And the energy consumption of weight gradient calculation The task computing energy consumption required for variable calculation during the training process of the deep pulse neural network training task is obtained as shown in the following formula (20).
[0176]
[0177] Through the above steps 1501 to 1505, the number of computing operations required for the computing operations corresponding to the variables corresponding to the forward pass, back propagation and weight gradient update, and the corresponding unit computing energy consumption are used one by one, so that the task computing energy consumption required for the variable calculation of the deep pulse neural network training task during the training process can be accurately obtained, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task.
[0178] Step 205: Accumulate the task reading and writing energy consumption and the task computing energy consumption to obtain the task energy consumption of the deep pulse neural network training task.
[0179] Step 205 is described in detail below.
[0180] In some embodiments, after obtaining the task reading and writing energy consumption E m And task computing energy consumption E c Afterwards, the task reading and writing energy consumption and the task computing energy consumption are accumulated to obtain the task energy consumption E required for the deep pulse neural network training task to perform network training in the deep pulse neural network training architecture as shown in the following formula (21).
[0181] E=E m +E c (twenty one)
[0182] The energy consumption calculation method and related equipment of the deep pulse neural network training architecture proposed in the embodiment of the present application include: first, according to the convolution operation in the forward transfer update function corresponding to the pulse convolution in the deep pulse neural network training task, the forward transfer discrimination number and the forward transfer accumulation operation number are generated; according to the convolution operation and multiplication operation in the back propagation update function corresponding to the membrane potential gradient convolution in the deep pulse neural network training task, the back propagation accumulation operation number and the back propagation accumulation operation number are generated; according to the convolution operation in the weight gradient update function corresponding to the weight gradient in the deep pulse neural network training task, the weight gradient discrimination number and the weight gradient accumulation operation number are generated; secondly, each variable is used as the target variable one by one, and based on the read and write operation of the target variable in the first data transmission process or the second data transmission process, the reuse factor corresponding to the target variable is generated, the first data transmission process is the data transmission process between the register Regs and the static memory SRAM, and the second data transmission process is the data transmission process between the static memory SRAM and the dynamic memory DRAM; next, From the logical discriminant quantity, the forward pass discriminant quantity corresponding to the forward pass and the weight gradient discriminant quantity corresponding to the weight gradient update are obtained. From the reuse factor, the forward pass reuse factor corresponding to the forward pass, the back propagation reuse factor corresponding to the error back propagation, and the weight gradient reuse factor corresponding to the weight gradient update are obtained. For each variable, the variable read and write energy consumption is obtained based on the ratio of the corresponding unit read and write energy consumption and the forward pass reuse factor, and the forward variable read and write energy consumption is obtained by accumulating all variable read and write energy consumptions. The forward pass discriminant quantity of all neurons is accumulated. Quantity, get the model forward discrimination quantity, accumulate the model forward discrimination quantity and the forward variable read-write energy consumption to get the forward transfer read-write energy consumption, based on the back propagation cumulative multiplication operation number, the back propagation reuse factor and the unit read-write energy consumption, calculate the back propagation read-write energy consumption, the back propagation cumulative multiplication operation number corresponds to the error back propagation, based on the weight gradient discrimination quantity, the weight gradient reuse factor and the unit read-write energy consumption, calculate the weight gradient read-write energy consumption, and accumulate the forward transfer read-write energy consumption, the back propagation read-write energy consumption and the weight gradient read-write energy consumption to get the task read-write energy consumption;Then, the number of forward pass cumulative operations corresponding to the forward pass, the number of back propagation cumulative operations corresponding to the error back propagation, and the number of weight gradient cumulative operations corresponding to the weight gradient update are obtained from the number of cumulative operations. The number of back propagation cumulative multiplication operations corresponding to the error back propagation is obtained from the number of cumulative operations. All forward pass discrimination numbers are accumulated and multiplied by the discrimination unit calculation energy consumption, and the product of the forward pass cumulative operation number and the cumulative unit calculation energy consumption is added to obtain the forward pass calculation energy consumption. All back propagation cumulative operations are accumulated and multiplied. The energy consumption is calculated by accumulating the unit, adding the product of the number of back propagation cumulative multiplication operations and the multiplication unit calculation energy consumption to obtain the back propagation calculation energy consumption, accumulating all weight gradient discrimination numbers and multiplying them by the discrimination unit calculation energy consumption, adding the product of the number of weight gradient accumulation operations and the accumulation unit calculation energy consumption to obtain the weight gradient calculation energy consumption, accumulating the forward pass calculation energy consumption, the back propagation calculation energy consumption and the weight gradient calculation energy consumption to obtain the task calculation energy consumption; finally, accumulating the task read and write energy consumption and the task calculation energy consumption to obtain the task energy consumption of the deep pulse neural network training task. ;
[0183] The embodiment of the present application is directed to the convolution operations and multiplication operations required in the forward transfer, error back propagation and weight gradient related update functions in the deep pulse neural network training task, and accurately obtains the number of logical judgments, the number of accumulation operations and the number of cumulative multiplication operations corresponding to the logical judgment operations, the accumulation operations and the multiplication operations performed in the training process of each layer of neurons in the deep pulse neural network training task, so as to facilitate the subsequent more accurate calculation of the energy consumption of the deep pulse neural network training task; and, by utilizing the read and write actions defined in the memory of the deep pulse neural network training architecture and the calling path of each variable, combined with the reuse factor generated by the same data in the same read and write action process, the same operation data can be effectively utilized to reduce the energy consumption in the training process of the deep pulse neural network training task; and, by utilizing the common factors corresponding to the variables corresponding to the forward transfer, back propagation and weight gradient update one by one, and accurately obtaining the number of operations required for the read and write operations corresponding to each forward transfer, back propagation and weight gradient update in advance, it is possible to accurately obtain The task reading and writing energy consumption required for reading and writing of the deep pulse neural network training task during the training process is calculated, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task; secondly, the number of computing operations required for the computing operations corresponding to the variables corresponding to the forward transfer, back propagation and weight gradient update, and the corresponding unit computing energy consumption are used one by one, so as to accurately obtain the task computing energy consumption required for the variable calculation of the deep pulse neural network training task during the training process, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task; in short, for the number of logical judgments corresponding to the logical judgment operations and the number of accumulation operations corresponding to the accumulation operations for multiple variables in the deep pulse neural network training task, the reuse factor generated by the read and write characteristics of the memory of the deep pulse neural network training architecture is used to reduce the number of read and write operations of the same data, and further combined with the unit read and write energy consumption and the unit computing energy consumption, the task energy consumption corresponding to the neural network computing task can be accurately calculated while reducing the task energy consumption corresponding to the deep pulse neural network training task.
[0184] The present application also provides an energy consumption calculation device for a deep pulse neural network training architecture, which can implement the energy consumption calculation method for the deep pulse neural network training architecture, referring to Fig.16 , the device 1600 comprises:
[0185] A calculation quantity acquisition module 1610 is used to obtain the number of operations of logical discrimination, floating-point addition and floating-point multiplication in the pulse convolution, membrane potential gradient convolution and weight gradient of the deep pulse neural network training task, wherein the number of operations includes the number of logical discrimination corresponding to the logical discrimination, the number of accumulation operations corresponding to the floating-point addition and the number of accumulation operations corresponding to the floating-point multiplication;
[0186] A reuse factor acquisition module 1620, for respectively acquiring reuse factors of a plurality of the variables for read and write operations in a memory of the deep pulse neural network training architecture, wherein the memory includes DRAM, SRAM, and registers;
[0187] The read / write energy consumption calculation module 1630 is used to calculate the task read / write energy consumption based on the logic determination quantity, the reuse factor and the unit read / write energy consumption of the memory;
[0188] A computing energy consumption calculation module 1640 is used to calculate the task computing energy consumption based on the number of accumulation operations, the number of multiplication operations, the number of logic determinations and the corresponding unit computing energy consumption;
[0189] The task energy consumption calculation module 1650 is used to accumulate the task reading and writing energy consumption and the task calculation energy consumption to obtain the task energy consumption of the deep pulse neural network training task.
[0190] In some embodiments, the read / write energy consumption calculation module 1630 is further used to:
[0191] Obtaining from the logical discriminant quantity the forward pass discriminant quantity corresponding to the forward pass and the weight gradient discriminant quantity corresponding to the weight gradient update;
[0192] Obtaining from the reuse factors a forward pass reuse factor corresponding to the forward pass, a back propagation reuse factor corresponding to the error back propagation, and a weight gradient reuse factor corresponding to the weight gradient update;
[0193] Based on the number of forward pass discriminations, the forward pass reuse factor, and the unit read and write energy consumption, the forward pass read and write energy consumption is calculated;
[0194] The back propagation read and write energy consumption is calculated based on the number of back propagation cumulative multiplication operations, the back propagation reuse factor, and the unit read and write energy consumption. The number of back propagation cumulative multiplication operations corresponds to the error back propagation.
[0195] Based on the number of weight gradient discriminations, the weight gradient reuse factor, and the unit read and write energy consumption, the weight gradient read and write energy consumption is calculated, and the forward pass read and write energy consumption, the back propagation read and write energy consumption, and the weight gradient read and write energy consumption are accumulated to obtain the task read and write energy consumption.
[0196] In some embodiments, the read / write energy consumption calculation module 1630 is further used to:
[0197] For each variable, the variable read / write energy consumption is obtained based on the ratio of the corresponding unit read / write energy consumption and the forward transfer reuse factor, and the forward variable read / write energy consumption is obtained by summing up all variable read / write energy consumptions.
[0198] Accumulate the forward propagation discrimination number of all neurons to obtain the forward discrimination number of the model;
[0199] The forward transmission read and write energy consumption is obtained by multiplying the model forward discriminant quantity and the forward variable read and write energy consumption.
[0200] In some embodiments, the energy consumption calculation module 1640 is further used to:
[0201] The number of forward pass accumulation operations corresponding to the forward pass, the number of back propagation accumulation operations corresponding to the error back propagation, and the number of weight gradient accumulation operations corresponding to the weight gradient update are obtained from the number of accumulation operations, and the number of back propagation accumulation operations corresponding to the error back propagation is obtained from the number of accumulation operations;
[0202] Accumulate all forward pass judgment numbers and multiply by the judgment unit calculation energy consumption, and then add the product of the forward pass accumulation operation number and the accumulation unit calculation energy consumption to obtain the forward pass calculation energy consumption;
[0203] Accumulate the number of all back-propagation accumulation operations and multiply it by the accumulation unit calculation energy consumption, and then add the product of the number of back-propagation accumulation operations and the multiplication unit calculation energy consumption to get the back-propagation calculation energy consumption;
[0204] Accumulate all weight gradient discriminant numbers and multiply them by the discriminant unit calculation energy consumption, and then add the product of the weight gradient accumulation operation number and the accumulation unit calculation energy consumption to obtain the weight gradient calculation energy consumption;
[0205] The forward pass computing energy consumption, the back propagation computing energy consumption, and the weight gradient computing energy consumption are accumulated to obtain the task computing energy consumption.
[0206] In some embodiments, the reuse factor acquisition module 1620 is further used to:
[0207] Take each variable as the target variable one by one;
[0208] Based on the read and write operations of the target variable in the first data transmission process or the second data transmission process, a reuse factor corresponding to the target variable is generated. The first data transmission process is the data transmission process between the register and the SRAM, and the second data transmission process is the data transmission process between the SRAM and the DRAM.
[0209] In some embodiments, the calculation quantity acquisition module 1610 is further used to:
[0210] Generate the number of forward pass discriminations and the number of forward pass accumulation operations according to the convolution operation in the forward pass update function corresponding to the pulse convolution in the deep pulse neural network training task;
[0211] According to the convolution operation and multiplication operation in the back propagation update function corresponding to the membrane potential gradient convolution in the deep spike neural network training task, the number of back propagation accumulation operations and the number of back propagation accumulation multiplication operations are generated;
[0212] According to the convolution operation in the weight gradient update function corresponding to the weight gradient in the deep spiking neural network training task, the number of weight gradient discriminations and the number of weight gradient accumulation operations are generated.
[0213] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, the specific implementation method of the energy consumption calculation device of the deep pulse neural network training architecture is basically the same as the specific implementation method of the energy consumption calculation method of the above-mentioned deep pulse neural network training architecture, and will not be repeated here.
[0214] In the embodiment of the present application, the energy consumption calculation device of the deep pulse neural network training architecture accurately obtains the number of logical discrimination operations, the number of accumulation operations and the number of cumulative multiplication operations corresponding to the logical discrimination operations, the number of accumulation operations and the number of cumulative multiplication operations corresponding to the logical discrimination operations, the accumulation operations and the multiplication operations performed in the training process of each layer of neurons in the deep pulse neural network training task, so as to facilitate the subsequent more accurate calculation of the energy consumption of the deep pulse neural network training task; and, by using the read and write actions defined in the memory of the deep pulse neural network training architecture and the calling path of each variable, combined with the reuse factor generated by the same data in the same read and write action process, the same operation data can be effectively utilized to reduce the energy consumption in the training process of the deep pulse neural network training task; and, by using the common factors corresponding to the variables corresponding to the forward pass, back propagation and weight gradient update one by one, and obtaining the number of operations required for the read and write operations corresponding to each forward pass, back propagation and weight gradient update in advance. The amount can accurately obtain the task reading and writing energy consumption required for reading and writing of the deep pulse neural network training task during the training process, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task; secondly, the number of computing operations required for the computing operations corresponding to the variables corresponding to the forward transfer, back propagation and weight gradient update, and the corresponding unit computing energy consumption are used one by one, so that the task computing energy consumption required for the deep pulse neural network training task to perform variable calculations during the training process can be accurately obtained, thereby improving the accuracy of the task energy consumption corresponding to the neural network computing task; in short, for the number of logical judgments corresponding to the logical judgment operations and the number of accumulation operations corresponding to the accumulation operations for multiple variables in the deep pulse neural network training task, the reuse factor generated by the read and write characteristics of the memory of the deep pulse neural network training architecture is used to reduce the number of read and write operations of the same data, and further combined with the unit read and write energy consumption and the unit computing energy consumption, the task energy consumption corresponding to the neural network computing task can be accurately calculated while reducing the task energy consumption corresponding to the deep pulse neural network training task.
[0215] The present application also provides an electronic device, including:
[0216] at least one memory;
[0217] at least one processor;
[0218] at least one program;
[0219] The program is stored in the memory, and the processor executes at least one program to implement the energy consumption calculation method of the deep pulse neural network training architecture implemented in this application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0220] See also Fig.17 , Fig.17 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0221] The processor 1701 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0222] The memory 1702 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory 1702 can store operating systems and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1702, and the processor 1701 calls and executes the energy consumption calculation method of the deep pulse neural network training architecture of the embodiment of this application;
[0223] Input / output interface 1703, used to implement information input and output;
[0224] Communication interface 1704, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0225] A bus 1705 that transmits information between the various components of the device (e.g., the processor 1701, the memory 1702, the input / output interface 1703, and the communication interface 1704);
[0226] The processor 1701 , the memory 1702 , the input / output interface 1703 and the communication interface 1704 are connected to each other in communication within the device via the bus 1705 .
[0227] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the energy consumption calculation method of the above-mentioned deep pulse neural network training architecture.
[0228] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0229] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0230] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0231] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0232] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0233] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0234] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0235] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0236] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0237] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0238] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0239] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.
Claims
1. A method for calculating energy consumption of a deep pulse neural network training architecture, characterized in that: The method comprises: Obtain the number of operations of logical discrimination, floating-point addition and floating-point multiplication in the pulse convolution, membrane potential gradient convolution and weight gradient of the deep pulse neural network training task, wherein the number of operations includes the number of logical discrimination corresponding to the logical discrimination, the number of accumulation operations corresponding to the floating-point addition and the number of accumulation operations corresponding to the floating-point multiplication; Respectively obtaining reuse factors of a plurality of variables for read and write operations in a memory of the deep spiking neural network training architecture, the memory comprising DRAM, SRAM, and registers; Calculating the task read and write energy consumption based on the number of logical determinations, the reuse factor and the unit read and write energy consumption of the memory; Calculate the task computing energy consumption based on the number of accumulation operations, the number of multiplication operations, the number of logic determinations and the corresponding unit computing energy consumption; The task energy consumption of the deep pulse neural network training task is obtained by accumulating the task reading and writing energy consumption and the task computing energy consumption.
2. The energy consumption calculation method of the deep pulse neural network training architecture according to claim 1 is characterized in that: The calculating the task read / write energy consumption based on the number of logical determinations, the reuse factor and the unit read / write energy consumption of the memory includes: Obtaining from the logical discrimination quantity a forward pass discrimination quantity corresponding to the forward pass and a weight gradient discrimination quantity corresponding to the weight gradient update; Obtaining from the reuse factors a forward transfer reuse factor corresponding to the forward transfer, a back propagation reuse factor corresponding to error back propagation, and a weight gradient reuse factor corresponding to the weight gradient update; Based on the forward transfer discrimination quantity, the forward transfer reuse factor and the unit read and write energy consumption, the forward transfer read and write energy consumption is calculated; The back propagation read and write energy consumption is calculated based on the number of back propagation cumulative multiplication operations, the back propagation reuse factor, and the unit read and write energy consumption, wherein the number of back propagation cumulative multiplication operations corresponds to the error back propagation; Based on the weight gradient discrimination quantity, the weight gradient reuse factor and the unit read-write energy consumption, the weight gradient read-write energy consumption is calculated, and the forward pass read-write energy consumption, the back propagation read-write energy consumption and the weight gradient read-write energy consumption are accumulated to obtain the task read-write energy consumption.
3. The energy consumption calculation method of the deep pulse neural network training architecture according to claim 2 is characterized in that: The deep pulse neural network training task includes multiple layers of neurons, and the forward transfer read and write energy consumption is calculated based on the forward transfer discrimination quantity, the forward transfer reuse factor and the unit read and write energy consumption, including: For each of the variables, the variable read / write energy consumption is obtained based on the ratio of the corresponding unit read / write energy consumption and the forward transfer reuse factor, and the forward variable read / write energy consumption is obtained by accumulating all the variable read / write energy consumptions; Accumulating the forward transmission discrimination quantity of all the neurons to obtain the model forward discrimination quantity; The forward transfer read-write energy consumption is obtained by multiplying the model forward discrimination quantity and the forward variable read-write energy consumption.
4. The energy consumption calculation method of the deep pulse neural network training architecture according to claim 2 is characterized in that: The unit calculation energy consumption includes determination unit calculation energy consumption, accumulation unit calculation energy consumption and multiplication unit calculation energy consumption. The task calculation energy consumption is calculated based on the number of accumulation operations, the number of multiplication operations, the number of logic determinations and the corresponding unit calculation energy consumption, including: Obtaining from the number of accumulation operations the number of forward transfer accumulation operations corresponding to the forward transfer, the number of back propagation accumulation operations corresponding to the error back propagation, and the number of weight gradient accumulation operations corresponding to the weight gradient update, and obtaining from the number of accumulation operations the number of back propagation accumulation operations corresponding to the error back propagation; Accumulate all the forward transfer determination numbers, multiply by the determination unit calculation energy consumption, and add the product of the forward transfer accumulation operation number and the accumulation unit calculation energy consumption to obtain the forward transfer calculation energy consumption; Accumulate all the back-propagation accumulation operation numbers, multiply by the accumulation unit calculation energy consumption, and add the product of the back-propagation accumulation multiplication operation number and the multiplication unit calculation energy consumption to obtain the back-propagation calculation energy consumption; Accumulate all the weight gradient discrimination quantities, multiply by the discrimination unit calculation energy consumption, and add the product of the weight gradient accumulation operation quantity and the accumulation unit calculation energy consumption to obtain the weight gradient calculation energy consumption; The forward pass computing energy consumption, the back propagation computing energy consumption and the weight gradient computing energy consumption are accumulated to obtain the task computing energy consumption.
5. The energy consumption calculation method of the deep pulse neural network training architecture according to claim 1 is characterized in that: The obtaining of reuse factors of the plurality of variables for reading and writing in the memory of the deep pulse neural network training architecture respectively comprises: Taking each of the variables as the target variable one by one; The reuse factor corresponding to the target variable is generated based on the read and write operations of the target variable in the first data transmission process or the second data transmission process, wherein the first data transmission process is a data transmission process between the register and the SRAM, and the second data transmission process is a data transmission process between the SRAM and the DRAM.
6. The energy consumption calculation method of the deep pulse neural network training architecture according to claim 1 is characterized in that: The number of logical judgments includes the number of forward transfer judgments and the number of weight gradient judgments, the number of accumulation operations includes the number of forward transfer accumulation operations, the number of back propagation accumulation operations and the number of weight gradient accumulation operations, the number of multiplication operations includes the number of back propagation accumulation operations, and the number of logical judgments, floating-point additions and floating-point multiplications in the pulse convolution, membrane potential gradient convolution and weight gradient of the deep pulse neural network training task includes: Generate the forward transfer discrimination quantity and the forward transfer accumulation operation quantity according to the convolution operation in the forward transfer update function corresponding to the pulse convolution in the deep pulse neural network training task; Generate the number of back-propagation accumulation operations and the number of back-propagation multiplication operations according to the convolution operation and the multiplication operation in the back-propagation update function corresponding to the membrane potential gradient convolution in the deep spike neural network training task; The weight gradient discrimination quantity and the weight gradient accumulation operation quantity are generated according to the convolution operation in the weight gradient update function corresponding to the weight gradient in the deep pulse neural network training task.
7. A deep spiking neural network training architecture, characterized in that: The system includes a forward transmission component, a reverse propagation component, a unified buffer area and a computing processor; The forward transfer component includes a forward transfer engine and a first direct memory access module connected to each other, and the first direct memory access module is connected to the unified cache area; The back propagation component includes a back propagation engine, a weight gradient engine and a second direct memory access module, the back propagation engine and the weight gradient engine are both connected to the second direct memory access module, and the second direct memory access module is connected to the unified cache area; The computing processor is used to execute the energy consumption calculation method of the deep pulse neural network training architecture as described in any one of claims 1 to 6.
8. The deep spiking neural network training architecture according to claim 7, characterized in that: include: The forward transfer component is used to perform forward transfer processing in a deep spiking neural network training task; The back propagation component is used to perform error back propagation processing and weight gradient update processing in deep pulse neural network training tasks.
9. An energy consumption calculation device for a deep pulse neural network training architecture, characterized in that: The device comprises: A calculation quantity acquisition module is used to obtain the number of operations of logical discrimination, floating-point addition and floating-point multiplication in pulse convolution, membrane potential gradient convolution and weight gradient of deep pulse neural network training tasks, wherein the number of operations includes the number of logical discrimination corresponding to logical discrimination, the number of accumulation operations corresponding to floating-point addition and the number of accumulation operations corresponding to floating-point multiplication; A reuse factor acquisition module, used to respectively acquire reuse factors of a plurality of variables for read and write operations in a memory of the deep pulse neural network training architecture, wherein the memory includes DRAM, SRAM and registers; A read / write energy consumption calculation module, used to calculate the task read / write energy consumption based on the logic determination quantity, the reuse factor and the unit read / write energy consumption of the memory; A computing energy consumption calculation module, used to calculate the task computing energy consumption based on the number of accumulation operations, the number of multiplication operations, the number of logic judgments and the corresponding unit computing energy consumption; The task energy consumption calculation module is used to accumulate the task reading and writing energy consumption and the task computing energy consumption to obtain the task energy consumption of the deep pulse neural network training task.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the energy consumption calculation method of the deep pulse neural network training architecture described in any one of claims 1 to 6 is implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the energy consumption calculation method of the deep pulse neural network training architecture as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Dynamic generalized user NOMA packet CCHN-MEC network unloading decision optimization method
CN116193546A
Structural dynamic response calculation method based on Transform and graph convolutional neural network
CN118194714A
Pulse convolutional neural network algorithm, integrated circuit, computing apparatus, and storage medium
WO2021115262A1
Digital neuromorphic computing processor and computing method
WO2024216859A1