Analog or hybrid MAC neural network with reduced power consumption

By introducing activation function detection and predictors into the neural processor and dynamically controlling the analog-to-digital converter, the problem of high power consumption of the multiply-accumulate module in the neural network is solved, and significant energy efficiency improvements are achieved.

CN118541702APending Publication Date: 2024-08-23MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280088459.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-01-31
Filing Date
2022-11-08
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When existing neural processors implement artificial intelligence neural network models, they use digital hybrid or analog multiply-accumulate modules that consume a lot of power, resulting in low energy efficiency.

Method used

By introducing activation function type detection and predictors in the neural processor, dynamically controlling the operation of the analog-to-digital converter, selectively terminating negative value calculations, using hybrid or analog MAC circuits to configure look-ahead symbol detectors, reducing power consumption.

Benefits of technology

A significant reduction in power consumption and improvement in energy efficiency are achieved in the neural processor, especially in the rectified linear unit activation layer, by dynamically stopping calculations and converting negative values ​​to zero, reducing the number of operations of the analog-to-digital converter and reducing the total cost. power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118541702A
    Figure CN118541702A
Patent Text Reader

Abstract

Energy saving performance may be achieved in a hardware accelerator (e.g., a neural processor) that includes hybrid or analog multiply-accumulate (MAC) processing elements (PEs). For example, power consumption may be reduced in a neural network having a rectified linear unit (ReLU) active layer. A hybrid or analog MAC circuit may be configured with a look-ahead symbol detector to dynamically stop computation prior to completion, e.g., based on detection of a negative value, a ReLU activation layer may (e.g., subsequently) convert the negative value to zero. A sign of a value may be indicated by a most significant bit (MSB). The controller may provide power and / or clock cycles to an analog-to-digital converter (ADC) to determine a sign of a value being calculated. The symbols may be used to selectively complete calculation of positive values and selectively terminate calculation of negative values, thereby reducing power consumption of the MAC circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Neural processors may implement artificial intelligence (AI) neural network (NN) models using hardware accelerators with digital hybrid or analog multiply-accumulate (MAC) modules / circuits, which consume a lot of power. Summary of the invention

[0002] This Summary is provided to introduce a selection of concepts in a simplified form that are also described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0003] Methods, systems, and computer program products are provided to achieve energy-efficient performance of a hardware accelerator (e.g., a neural processing unit (NPU)) that includes a hybrid or analog multiply-accumulate (MAC) processing element (PE). Power efficiency can be achieved based on the type of activation function (AF) implemented by the activation layer and the detection of one or more AF predictors that predict AF outputs for AF inputs. For example, power consumption can be reduced in a neural network with a rectified linear unit (ReLU) activation layer. The hybrid or analog MAC circuit can be configured with a look-ahead sign detector to dynamically stop calculations before completion, for example, based on the detection of a negative value, the ReLU activation layer can (e.g., subsequently) convert the negative value to zero. A controller can provide power and / or clock cycles to an analog-to-digital converter (ADC) to determine the sign of the value being calculated. The sign of the value can be indicated by the most significant bit (MSB). The sign can be used to selectively complete the calculation of positive values ​​and selectively terminate the calculation of negative values, thereby reducing the power consumption of the MAC circuit.

[0004] Selectively completing and terminating calculations through the MAC PE array can reduce the power consumption of the neural processor. Power can be saved by dynamically controlling the operation of one or more components in the MAC circuit (e.g., enable signals, power supplies, and / or ADC clocks). In some examples, power consumption can be reduced by selectively avoiding unnecessary ADC cycles for known results of some calculations (e.g., converting negative values ​​to zero through a ReLU activation layer). The AF detector can detect the AF type and one or more AF predictors for indicating or predicting the AF output for a given AF input. The known output can be used to control the ADC operation. The AF predictor can indicate a predictable AF output. For example, for a ReLU activation layer, the AF predictor can be the sign of the value. The look-ahead sign detector can be used to detect the sign of the digital value being calculated before the calculation is completed. The ADC controller can stop the calculation using the detected sign of the value being calculated. Other types of activation layers and circuits that determine one or more AF predictors of the activation layer can be implemented to provide information to one or more MAC circuit controllers (e.g., ADC controllers).

[0005] Further features and advantages of the subject matter disclosed herein (e.g., examples) and the structure and operation of various embodiments will be described in detail below with reference to the accompanying drawings. Note that the subject matter is not limited to the specific examples described herein. These embodiments are presented herein for illustrative purposes only. Based on the teachings contained herein, additional embodiments will be apparent to those skilled in the relevant art. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] The accompanying drawings, which are incorporated herein and constitute a part of the specification, illustrate various embodiments of the present application and, together with the description, further serve to explain the principles of the various embodiments and enable those skilled in the relevant art to make and use the embodiments.

[0007] Figure 1 A block diagram of a neural network (NN) training and inference computing environment is shown according to an example embodiment.

[0008] Figure 2 A block diagram of a neural processing unit (NPU) with a systolic array architecture and row-stationary data movement is shown according to an example embodiment.

[0009] Figure 3 A block diagram of a processing array with energy-efficient hybrid multiply-accumulate (MAC) processing elements (PEs) is shown according to an example embodiment.

[0010] Figure 4 A flow chart of a method for model training, detecting, and storing neural network topology, weights, and precision information according to an example embodiment is shown.

[0011] Figure 5 A flow chart of a method of using a trained model during inference to improve the performance of a hardware accelerator including power-efficient hybrid or analog MAC circuits is shown according to an example embodiment.

[0012] Figure 6 A flow chart of a method of using a trained model during inference to improve the performance of a hardware accelerator including power-efficient hybrid or analog MAC circuits is shown according to an example embodiment.

[0013] Figure 7 A block diagram is shown of an example computing device that may be used to implement the example embodiments.

[0014] Features and advantages of the disclosed examples will become more apparent from the following detailed description when set forth in conjunction with the accompanying drawings, in which like reference numerals identify corresponding elements throughout the specification. In the drawings, the same reference numerals generally indicate identical, functionally similar, and / or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference numeral. DETAILED DESCRIPTION

[0015] I. Introduction

[0016] This specification and the accompanying drawings disclose one or more embodiments of various features including various examples. The scope of the present subject matter is not limited to the disclosed embodiments. The disclosed embodiments merely illustrate various examples, and modified versions of the disclosed embodiments are also covered by the present subject matter. The various embodiments of the present subject matter are defined by the attached claims.

[0017] References in the specification to "one embodiment," "an embodiment," "an example embodiment," etc. indicate that the described embodiment may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Furthermore, these phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in conjunction with an example embodiment, whether or not explicitly described, it is considered to be within the knowledge of those skilled in the art to implement the feature, structure, or characteristic in conjunction with other embodiments.

[0018] In the discussion, unless otherwise stated, adjectives such as "substantially" and "approximately" that modify conditions or relationship characteristics of one or more features of the example embodiments of the present disclosure should be understood to mean that the conditions or characteristics are limited to within a tolerance of the operation of the embodiment that is acceptable for the intended application of the embodiment.

[0019] A number of exemplary embodiments are described below. It should be noted that any section / subsection titles provided herein are not intended to be limiting. Various embodiments are described in this document, and any type of embodiment may be included under any section / subsection. In addition, the various embodiments disclosed in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0020] II. Example Implementation

[0021] Methods, systems, and computer program products are provided to achieve energy-efficient performance of a hardware accelerator (e.g., a neural processing unit (NPU)) that includes a hybrid or analog multiply-accumulate (MAC) processing element (PE). Power efficiency can be achieved based on the type of activation function (AF) implemented by the activation layer and the detection of one or more AF predictors that predict AF outputs for AF inputs. For example, power consumption can be reduced in a neural network with a rectified linear unit (ReLU) activation layer. The hybrid or analog MAC circuit can be configured with a look-ahead sign detector to dynamically stop calculations before completion, for example, based on the detection of negative values, the ReLU activation layer can (e.g., subsequently) convert negative values ​​to zero. The sign of the value can be indicated by the most significant bit (MSB). A controller can provide power and / or clock cycles to an analog-to-digital converter (ADC) to determine the sign of the value being calculated. The sign can be used to selectively complete calculations of positive values ​​and selectively terminate calculations of negative values, thereby reducing power consumption of the MAC circuit.

[0022] Such embodiments may be implemented in various configurations. For example, Figure 1 A block diagram of an example neural network (NN) training and inference computing environment (referred to herein as a "NN computing environment") 100 is shown for improving the performance (e.g., reducing power consumption) of a hardware accelerator (e.g., a neural processor) according to an example embodiment. The example NN computing environment 100 may include, for example, one or more computing devices 104, one or more networks 114, and one or more servers 116. The example NN computing environment 100 presents one of many possible computing environment examples. The example system 100 may include any number of computing devices and / or servers, such as Figure 1 The example components shown in the figure and other additional or alternative devices not explicitly described.

[0023] The network(s) 114 may include, for example, a local area network (LAN), a wide area network (WAN), a personal area network (PAN), a combination of communication networks such as the Internet, and / or one or more of a virtual network. In an example implementation, the computing device 104 and the server 116 may be communicatively coupled via the network 114. In an implementation, any one or more of the server 116 and the computing device 104 may communicate via one or more application programming interfaces (APIs) and / or according to other interfaces and / or technologies. The server 116 and / or the computing device 104 may include one or more network interfaces that enable communication between devices. Examples of such wired or wireless network interfaces may include an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like. Further examples of network interfaces are described elsewhere herein.

[0024] Computing device 104 may include computing devices used by one or more users (generally referred to as user 102) (e.g., personal users, home users, enterprise users, government users, administrators, hackers, etc.). Computing device 104 may include one or more applications, operating systems, virtual machines (VMs), storage devices, etc., which may be executed, hosted, and / or stored therein, or executed, hosted, and / or stored therein via one or more other computing devices via network 114. In an example, computing device 104 may access one or more server devices (such as server 116) to provide information, request one or more services (e.g., content, models, model training), and / or receive one or more results (e.g., trained models). Computing device 104 may represent any number of computing devices and any number and type of groups (e.g., various users in multiple cloud service tenants). User 102 may represent any number of persons authorized to access one or more computing resources. Computing device(s) 104 may each be any type of fixed or mobile computing device, including a mobile computer or a mobile computing device (e.g., devices, personal digital assistants (PDAs), laptops, notebook computers, such as the Apple iPad TMThe computing device(s) 104 may be a tablet computer, a netbook, etc., a mobile phone, a wearable computing device, or other type of mobile device, or a fixed computing device such as a desktop computer or a PC (personal computer), or a server. The computing device(s) 104 are not limited to physical machines, but may also include other types of machines or nodes (such as virtual machines) executed in a physical machine. The computing device(s) 104 may interact with the server 116, for example, through an API and / or other mechanism. Any number of program interfaces may coexist on the computing device 104. Figure 7 An example computing device having example features is presented.

[0025] The computing device(s) 104 have respective computing environments. The computing device(s) 104 may execute one or more processes in their respective computing environments. A process is any type of executable file (e.g., binary file, program, application) being executed by a computing device. The computing environment may be any computing environment (e.g., any combination of hardware, software, and firmware). For example, the computing device(s) 104 may include a central processing unit (CPU) 106 that executes instructions, a neural processing unit (NPU) 108 that implements a neural network (NN) model, a NN application 110 that utilizes one or more NN models, and the like.

[0026] The server 116 may include one or more computing devices, servers, services, local processes, remote machines, web services, etc., for providing NN training, models, and / or content to the computing device(s) 104. In an example, the server 116 may include a server located at an organization's premises and / or coupled to an organization's local network, a remote server, a cloud-based server (e.g., one or more servers organized in a distributed manner), or any other device or service that can host, manage, and / or provide NN training, models, and / or content. The server(s) 116 may be implemented as multiple programs executed by one or more computing devices. Server programs and content may be distinguished by logic or functionality (e.g., as Figure 1 ).

[0027] The server(s) 116 may each include one or more model trainers 118, one or more NN models 120, and / or content 122. In some examples, the computing device(s) 104 may include the model trainer(s) 118, the NN model(s) 120, and / or content 122, which may be developed on the computing device 104, downloaded from the server 116, etc.

[0028] The example NN computing environment 100 may operate in the edge or edge domain, referring to the edge or boundary of one or more networks in the network 114. The edge domain may include end-user devices (e.g., computing devices 104) such as laptops, mobile phones, and / or any IoT devices (e.g., security cameras).

[0029] Artificial intelligence (AI) neural network (NN) models (e.g., NN model 120) can be used in many applications (e.g., NN application 110), such as image classification and speech recognition applications. AI NN models (also referred to herein as models) can represent algorithms learned by machines (e.g., machine learning (ML)). The algorithms / models can be trained. Model training can refer to one or more parameters of a machine learning algorithm / model, for example, to improve the performance of the algorithm / model. The trained models (e.g., NN model 120) can be used for reasoning. For example, the NN application 110 can use the trained model (e.g., NN model 120) to reason about classification (e.g., classifying an image in content 122 as a person or a vehicle).

[0030] There may be one or more user experience (UX) scenarios on computing device(s) 104 that may rely on AI. An experience driven by AI may involve creating and / or running an algorithm without a human writer (e.g., a machine may train the algorithm itself). A human may (e.g., alternatively and / or in conjunction with AI) manually write a program or algorithm in software (e.g., C code) to perform a task.

[0031] NN applications 110 may involve a variety of AI applications, such as audio applications (e.g., noise suppression, spatial audio, speaker separation to differentiate between speakers), video applications (e.g., enhanced compression), voice applications (e.g., dictation, NTTS, voice access, translation), system health applications (e.g., security applications such as antivirus, battery usage, power usage, etc.), etc.

[0032] The user 102 may use the computing device 104 to run the NN application 110, for example, which may allow the user 102 to browse files on the server 116 and / or select content 122. The user 102 may use the computing device 104 to process the content 122 (e.g., using the NN model 120). The NN application 110 may use a trained model (e.g., in the NN model 120) to process the (e.g., selected) content 122. An example of a NN application 110 may be a pattern recognition application for identifying objects (e.g., people, animals, plants) in an image frame. The user 102 may use the computing device 104 to run the NN application 110, for example, to select, train, or implement the model 120 (e.g., use the model to infer the classification of the content 122).

[0033] The model trainer 118 can train and evaluate (e.g., generate) one or more models (e.g., NN model 120) to improve the performance of a hardware accelerator (e.g., a neural processor) that includes a hybrid or analog multiply-accumulate (MAC) processing element (PE). The model trainer 118 can receive as input an original or modified form of content 122 generated by one or more computing devices (e.g., computing device 104, server 116). The model trainer 118 can provide (e.g., manual and / or automatic) labeling (e.g., pre-classification) of features (e.g., Ifmap (input feature map)) for the training content 122, for example, to generate a feature-based training data set with known labels. The training data set can be divided into a training data set and a test data set. The training process can use the training data set to train the model. The trained model can be retrained (e.g., using an expanded training data set and / or Ifmap), for example, as needed or periodically.

[0034] Multiple models with multiple (e.g., different) feature sets can be trained (and evaluated). Various neural network models, such as convolutional neural network (CNN) models and recurrent neural network (RNN) models, can be trained and evaluated. The training process can utilize different settings to determine optimal hyperparameter values. In the example of a neural network, parameter values ​​can be determined for the activation type, the number of neurons in each layer, and the number of layers.

[0035] The trained NN model 120 may include, for example, a feature extractor, a feature transformer, and a classifier. The feature extractor may extract features from the content 122. The feature transformer may convert the extracted features into a format desired by the classifier. The feature transformer may, for example, convert the output of the feature extractor into a feature vector desired by the classifier. The classifier may classify the extracted features into one or more classes. The classifier may generate an associated confidence for (e.g., each) classification (e.g., prediction).

[0036] The trained NN model 120 may receive as input an original or modified form of content 122 generated by one or more computing devices (e.g., computing device 104 or server 116). The NN model 120 may generate a classification based on the input (e.g., Ifmap) based on the training received from the model trainer 120. The classification may include, for example, binary classification or multi-classification. The classification may include or be accompanied by a confidence level, which may be based on similarity to labels of one or more training set Ifmaps.

[0037] The trained NN model 120 can be saved in a file (e.g., by the model trainer 118). The file can be loaded into one or more devices (e.g., the computing device 104) to use the model (e.g., to perform inference). The NN model 120 can interface with the network 114 to obtain input (e.g., content 122) to generate results (e.g., the content 122 is processed by the trained NN model 120). In an example, the NN model 120 can be trained to detect four categories based on training frames associated with training labels. For example, a deep neural network (DNN) can be asked to understand which visual objects (e.g., cats, dogs, people, cars) appear in the content 122.

[0038] The NN model 120 may be a DNN model. A CNN may be a type of DNN. The NN model 120 may be implemented (e.g., partially) by hardware (HW). For example, a HW accelerator may accelerate the computation of one or more CNN layers. The HW (e.g., HW accelerator) used to implement the AI ​​model may have a (e.g., significant) impact on the power efficiency of the AI ​​model during reasoning on an edge device (e.g., a personal computer (PC)). Power efficiency and / or model accuracy may play a (e.g., significant) role in the performance of the AI ​​model.

[0039] An example of a hardware accelerator that can be used to implement one or more models is the NPU(s) 108. For example, the NN application(s) 110 (e.g., and / or operating system) executed by the CPU(s) 106 can utilize the NPU(s) 108 to implement the NN model(s) 120. The computing device 104 can be a battery-powered device, such as a mobile phone. It may be important for the NPU 108 to implement the NN model 120 with less power to save energy stored in the device battery and / or to save energy overall. Energy conservation may depend on the implementation of the NPU 108. For example, the NPU 108 may include digital and / or hybrid or analog multiply-accumulate (MAC) processing elements (PEs).

[0040] Given that AI computing requirements are likely to grow exponentially year over year, computing power efficiency may be important. For example, by reducing data movement, energy costs and / or memory accesses can be reduced.

[0041] In some examples, a DNN (e.g., a CNN) can be implemented with a (e.g., highly) parallel computing architecture (such as single instruction, multiple data (SIMD)) to provide high throughput convolutions. Convolutions may dominate CNN runtime (e.g., convolutions may account for more than 90% of CNN operations). Memory bandwidth may affect power efficiency and / or may cause memory access bottlenecks. For example, (e.g., each) MAC operation may involve four memory accesses, which may result in high energy consumption.

[0042] Figure 2 FIG. 2 is a block diagram of an example NPU 200 with a systolic array architecture and weight-stationary data movement according to an embodiment. The example NPU 200 presents Figure 1 108. The example NPU 200 may be a DNN accelerator. The example NPU 200 shows an implemented HW (hardware) accelerator (e.g., NPU 108) having a MAC / AMAC circuit 218. The NPU 200 may include, for example, a MAC / AMAC circuit 218 (which includes a plurality of unit elements (UEs) 202a-n), one or more SRAM buffers 206, a processor 210, and / or an activation function (AF) 212.

[0043] like Figure 2 As shown, the MAC / AMAC circuit 218 may include a systolic array of MAC PEs including UEs 202a-n. In some examples, the systolic array of MAC PEs may perform trillions of operations per second (TOPS). In one of many example implementations, the systolic array of PEs is organized in clusters in a DNN hardware accelerator, for example, utilizing weight-fixed data flows. The DNN HW accelerator may be configured and / or implemented to reduce energy costs and / or memory accesses. Data movement is closely related to the convolutions performed by the PEs in the systolic array. The data flow may be weight-fixed (WS). The WS data flow may improve (e.g., reduce) data movement, for example, by (e.g., maximizing) use of a storage hierarchy, which may include, for example, a low-cost register file (RF) and a global buffer. (E.g., each) PE may include or may be associated with (e.g., coupled to) an RF).

[0044] The example NPU 200 may implement a model with a digital, hybrid or analog MAC (AMAC) module (such as a digital, analog or hybrid MAC circuit). The hybrid MAC circuit may include, for example, digital multiplication and analog accumulation. AMAC (e.g., referring to analog and hybrid MAC) may be more energy efficient than a digital MAC (DMAC) circuit.

[0045] One or more enhancements may be implemented to improve AMAC performance (e.g., accuracy, energy efficiency, or power consumption). The AMAC may include an analog-to-digital converter, for example, to convert an analog accumulation signal into a digital signal. In some examples, the AMAC may be implemented using a successive approximation register (SAR) ADC. In some examples, the AMAC may be implemented using charge sharing. One or more enhancements described herein may be implemented to improve AMAC performance, such as the performance of an AMAC implemented using charge sharing and / or a SAR-based ADC.

[0046] UE 202a-n may include MAC / AMAC units 214a-n, local buffers 208a-N, and multiplexer (MUX) logic 209a-n. UE 202a-n may perform (e.g., a large number of) multiply-accumulate (MAC) operations in parallel. A memory hierarchy that exploits data reuse opportunities, for example, may be used in each operation cycle to feed new operands to arithmetic operations. In some examples, there may be three levels of memory: external SDRAM 204, global SRAM buffer 206 (e.g., an SRAM global buffer or a dual buffer), and local buffers 208a-n (e.g., a local buffer within each UE).

[0047] For example, during operation, as the filter slides across the input feature map, the filter can be temporarily "cached" in the SRAM buffer 206 or in the UE local buffer 208a-n (e.g., in a register file or flip-flop), thereby avoiding reloading from the external memory (e.g., SDRAM) 204 for each operation. Data reuse can support efficient power consumption because accessing memory consumes much more energy than arithmetic operations.

[0048] like Figure 2 As shown, a first UE local buffer (e.g., local buffer 208a) may be fed with input X and weight W from an SRAM (e.g., global) buffer 206, while input X and / or weight W of other UEs 202a-n may be shifted from neighboring UE local buffers 208a-n.

[0049] In some examples, the output of UE 202a-n can be fed through an activation function and then stored in SRAM buffer 206 (e.g., for subsequent use as input for the next processing cycle). In some examples, the output of UE 202a-n can be stored in a global buffer (e.g., without passing through an output activation function), for example, for processing by processor 210. Processor 210 may include, for example, a microcontroller (uC), a central processing unit (CPU), a digital signal processor (DSP), and / or other types of processing circuits.

[0050] In some examples, data can flow between SDRAM 204, SRAM (e.g., global) buffer 206, and UE local buffers 208a-n. In some examples, data can flow between UE local buffers 208a-n. For example, data flows can be dynamically configured or statically pre-routed within MUX logic (e.g., SRAM buffer MUX logic 209a, 209b and / or local buffer logic 208a-n) to reduce power consumption, where data reuse occurs.

[0051] In some examples (e.g., weights are fixed), only the input (X) may be moved between UE local buffers 208a-n. For example, after the weights are loaded to each UE 202a-n, the weights may remain fixed (e.g., until tensor processing is complete).

[0052] DNN can use a vector of weights (e.g., W i j,k ) represents the filter input activation (IA) vector (e.g., IA x,y,z ) (e.g., from the previous layer) performs the operation, where i can range from 1 to N, resulting in an output activation (OA) vector (e.g., OA x,y,n ). For example, (for example, each) PE can generate output according to formula (1):

[0053] PE(i) = Xi*Wi Formula (1)

[0054] The OA vector may be the sum of multiple (e.g., all) PEs (e.g., PE[0] to PE[N-1]). The OA vector may be provided to the next layer (e.g., for other operations). The OA vector may be expressed, for example, according to equation (2):

[0055]

[0056] A digital MAC (DMAC) may perform operations to generate inner products (e.g., interim values) and accumulate multiple multiplication results using an OR gate or half adder, which may consume a significant amount of power. Performing MAC operations with less power can significantly reduce overall NPU power consumption based on the number of MACs and MAC operations. For example, a hybrid MAC with digital multiplication and analog accumulation can reduce MAC power consumption. In some examples, the interim values ​​of the IA vector and weight vector can be calculated digitally, and the interim values ​​can be accumulated (and summed) using analog charge sharing.

[0057] A (e.g., battery-powered) device (e.g., a smartphone) can run one or more models (e.g., a DNN). Analog computing can support low-energy model inference computing. In some examples, a hybrid or analog MAC can perform (e.g., binary) multiplication using an AND gate (e.g., to generate multiple intermediate products). The intermediate products at the output of the AND gate can be referred to as intermediate values. The sum of the products can be performed by charge sharing. Multiple intermediate values ​​with the same weight can charge a capacitor. The capacitor can be coupled to a corresponding line in a charge collection bus according to the bit position in the binary multiplication represented by the output of the AND gate. The lines in the charge collection bus (e.g., and the charge accumulated on the lines) can be associated with weights relative to other lines based on the bit position (e.g., LSB to MSB). The accumulated charge on the wire (e.g., from one or more charge capacitors in each of one or more PEs) can be combined (e.g., based on their respective weights) into a (e.g., single) charge representing an analog value (e.g., a signal) of the multiplication. The sum of the products from multiple PEs (e.g., shared weighted charge lines) can be referred to as a dot product. Convolution can be simplified to dot product.

[0058] ADC power may consume a large portion of the power consumed by the MAC / AMAC circuit. ADC power (e.g., in a SAR ADC) may be proportional to the number of ADC output bits. Each clock cycle of the SAR ADC may generate one bit. The first cycle may output the MSB, while subsequent cycles may generate less significant bits. Training and / or observation may determine that not all bits are used for one or more inputs or operations (e.g., not all bits are valid bits). A model (e.g., a DNN) may have many (e.g., millions) of parameters, coefficients, or weights that may be trained to specific values. A computational graph or DNN may have many (e.g., millions) of nodes or multipliers, and many (e.g., tens of thousands) of dot products. In some examples, the level of accuracy may be fixed, while in other examples, the accuracy may be variable. The dynamic range (e.g., the maximum number of valid bits) of a particular node of a computational graph in a DNN may be determined. For example, the dynamic range of some nodes may be smaller than that of other nodes. The accuracy required to maintain the overall accuracy of a model (e.g., an algorithm) may vary at various nodes. For example, one or more specific bits in a particular node may be observed to be always zero.

[0059] like Figure 2 As shown, precision 224 can represent accuracy information developed during model training. Accuracy information (such as expected intermediate quantization (e.g., the number of useful bits at the ADC output)) can be saved, for example, in a model file, which can be loaded into the NPU for AI model operation.

[0060] The accuracy rate 224 can be used to control the NPU operation to save power. The NPU power efficiency can be improved by controlling the operation of the analog circuit system (e.g., by controlling the ADC operation). For example, the MAC power consumption (e.g., by the ADC component) can be improved by dynamically controlling (e.g., reducing) the ADC clock cycle to avoid the ADC cycle power consumption exceeding the accuracy of the ADC output. The accuracy information can be obtained during training or reasoning (e.g., by observation). The accuracy rate 208 can be an input to the control logic (e.g., a controller) to dynamically adjust the output. For example, the controller can dynamically adjust the number of clock cycles of the ADC to dynamically control the accuracy output of the ADC (e.g., a SAR ADC).

[0061] Figure 3 A block diagram of a processing array with energy-efficient hybrid multiply-accumulate (MAC) processing elements (PEs) is shown in accordance with an example embodiment. Example MAC circuit 300 presents Figure 2 One of many possible example configurations for MAC circuit 218 is shown.

[0062] The example MAC circuit 300 includes N processing elements (eg, PE[0] through PE[N-1]) coupled to a (eg, weighted) charge collection bus 302. The PEs may include a plurality of UEs 320 (eg, Figure 2 UE 202a-n shown in FIG. Figure 3 The charge sharing hybrid (digital analog) MAC architecture shown in can (e.g., significantly) reduce MAC power consumption by splitting multiply-accumulate operations between the digital and analog domains. For example (e.g., for a 12nm Fin-Fet process), an approximately 10TMAC NPU 4-bit analog MAC architecture can increase the area by approximately two (2) square millimeters while reducing power consumption by nearly one (1) watt compared to an approximately 10TMAC NPU 4-bit digital MAC architecture.

[0063] like Figure 3 As shown in the example in , the interim value can be calculated by digital circuitry (e.g., an AND gate) configured to multiply the input Xi[2:0] by the weight Wi[2:0]. The interim value can be accumulated by analog circuitry. For example, the interim value output of the digital circuitry can charge a (e.g., relatively small) charge accumulation capacitor C coupled to a charge collection line in the charge collection bus 302. The charge accumulation capacitor C can have a (e.g., significantly) reduced C load (capacitive load). In an example implementation, the value of the charge accumulation capacitor C may be 0.5 femtofarad (fF) (eg, for a 12 nm Fin-Fet process).

[0064] The sum of interim values ​​can be calculated based on the concept of charge sharing. The charge of each interim value result can be transferred from the digital multiplication to a (e.g., global) charge collection line (e.g., a metal bit line). Interim values ​​with the same "weight" can be coupled to the same charge collection line. The accumulation of multiple interim values ​​with the same "weight" can be performed by accumulating their charges on the same metal bit line (e.g., passively). Passive accumulation can save energy because passive accumulation does not consume energy. Interim values ​​on charge collection lines representing smaller weights (e.g., the least significant (LS) charge collection line) may have smaller values ​​than intermediate values ​​on charge collection lines representing higher weights (e.g., the most significant (MS) charge collection line).

[0065] Combiner 304 may be coupled to charge collection bus 302 and ADC 306. The charge on charge collection bus 302 may be used as an input to combiner 304. Combiner 304 may generate an analog output (e.g., analog Psum), which may be provided as an input to ADC 306 for conversion into a digital value. Combiner 304 may be controlled or calibrated by a bias input (e.g., at least in part). The bias may be fixed or variable. The input may be normalized, for example, to keep the value within the dynamic range of ADC 306.

[0066] Combiner 304 can combine the charge on the charge collection lines in charge collection bus 302. The charge on the bit lines can be weighted (e.g., by circuitry in combiner 304). For example, the weights can be implemented in the charge lines, capacitor values, and / or combiner 304. Combiner 304 can include passive and / or active circuitry. In some examples, combiner 304 can perform weighted charge summation. The charge on each bit line can be accumulated with the charge on other bit lines through one or more voltage dividers (e.g., resistors or capacitors). For example, the charge on each bit line can be accumulated with the charge on other bit lines through a capacitance value corresponding to the weight of the bit line (e.g., each charge collection line can be coupled to a capacitor with a different value). For example, the MSB line on the charge collection bus 302 may have no resistor, while other lines may have increased resistor values ​​to reduce their relative weights through resistors or capacitors.

[0067] The charge collection bus 302 may be shared by UE 320 in multiple PEs (eg, PE[0] to PE[N-1]). Figure 3As shown, charge collection bus 304 can be coupled to each UE 320 in multiple UEs 320 (e.g., and can accumulate charge from each UE 320). Each of the multiple UEs 320 (e.g., in PE[0] to PE[N-1]) can couple the multiplication product charge to shared charge collection bus 302. In some examples, combiner 304 can perform charge summation on a (e.g., single) multiplication result from a (e.g., single) PE. In some examples, combiner 304 can perform charge summation on multiple multiplication results from each of multiple MACPEs coupled to the same bit line. The combined analog value can be an analog Psum (e.g., such as Figure 3 ).

[0068] ADC 306 may be, for example, a successive approximation register (SAR) ADC. ADC 306 may receive a combined analog value (e.g., analog Psum) generated by combiner 304. ADC 306 may be coupled to an activation function (AF) (e.g., AF 212) (e.g., and may provide a digital output value thereto). ADC 306 may (e.g., be configured to) convert the total combined or summed charge (e.g., analog Psum) generated by combiner 304 into a digital representation (e.g., Y[4:0]). In some examples, ADC 306 may perform digital conversion on a (e.g., single) multiplication result from a (e.g., single) PE. In some examples, ADC 306 may perform digital conversion on multiple multiplication results from each of multiple MAC PEs coupled to the same bit line. The combined analog value may be an analog Psum. The digital representation (e.g., Y[4:0]) may represent the sum of one or more PE products. The digital representation (e.g., Y[4:0]) may be referred to as a dot product. In some examples, Y[4:0] may represent a digital Psum. ADC 306 may or may not be used to convert the partial sum (Psum) result. In some examples, ADC 306 may convert (e.g., the entire) dot product operation (e.g., using relevant inputs (such as pixels) and channels of input data and using filters (e.g., weights) that may be used to calculate output pixels).

[0069] In one example (e.g., Figure 30] and W[2:0], which can be multiplied (e.g., through an AND gate) and accumulated (e.g., using a capacitor C coupled to the charge collection bus 302). The multiplication result can be indicated by an interim value. The interim value can be accumulated on weighted charge lines (e.g., five charge lines of the charge collection bus 302). The accumulated interim value charge can be accumulated into a single charge by the combiner 304. The ADC 306 can convert the single charge (e.g., analog Psum) (e.g., partially or fully) into a digital value (e.g., one or more bits). The least significant (LS) charge line can have a weight of 1, while the second charge line can have a weight of 2, the third charge line can have a weight of 4, the fourth charge line can have a weight of 8, the fifth charge line (e.g., the most significant (MS) line) can have a weight of 16, and so on. Examples of digital multiplication and weighted analog accumulation are shown below:

[0070] 1*(IA[0]*W[0])+

[0071] 2*(IA[1]*W[0]+IA[0]*W[1])+

[0072] 4*(IA[2]*W[0]+IA[1]*W[1]+IA[0]*W[2])+

[0073] 8*(IA[2]*W[1]+IA[1]*W[2])+

[0074] 16*(IA[2]*W[2])

[0075] Combiner 304 can combine the charges on the charge lines according to these weights. Many other weights can be implemented, for example, LS line is 1 / 32, second line is 1 / 16, third line is 1 / 8, fourth line is 1 / 4, fifth line (e.g., MS line) is 1 / 2, etc. ADC 306 can (e.g., be configured to) convert the combined charge into output Y[4:0].

[0076] like Figure 3As shown in the example in, NPU power efficiency can be improved by controlling the operation of MAC circuitry (e.g., by controlling the operation of ADC 306). The performance improvements described herein can be applicable to MAC architectures and / or other analog computing circuitry. The power consumption of ADC 306 can be proportional to the number of cycles used by ADC 306 (e.g., SAR ADC) to convert analog values ​​into digital values. MAC control logic (e.g., ADC control logic) can reduce MAC power consumption and thereby reduce NPU power consumption. One or more operating characteristics of the NPU (e.g., AF type) can be used to improve the performance of the MAC circuitry (e.g., reduce power consumption). The NPU can have one or more activation layers with one or more activation functions (AF). The AF can have one or more outputs that can be predicted (e.g., known) for one or more inputs. Determining one or more AF predictors can allow one or more performance improvements, such as reducing the energy consumption of the NPU.

[0077] For example, the ReLU AF may convert negative values ​​generated by the ADC 306 to zero. The sign of the value (e.g., a negative sign) may be referred to as an AF predictor. The sign of the value of the digital output Y[4:0] may be indicated by the MSB (e.g., Y[4]). The MSB indicating the sign may be referred to as an AF predictor (e.g., for the ReLU AF). Determining the MSB before converting other bits may support early termination of analog-to-digital conversion (e.g., after converting the MSB), for example, based on determining that the sign of the value is negative, thereby saving energy. Such energy savings may occur in one or more operations of one or more (e.g., many) MAC PEs (e.g., hundreds, thousands, millions) of one or more layers (e.g., 50 layers), thereby (e.g., significantly) reducing the power consumption of the NPU implementing the model operation.

[0078] like Figure 3As shown in the example of , the ADC controller 308 may (e.g., be configured to) control the ADC 306 to save power, for example, during inference operations. The ADC controller 308 may save power by dynamically controlling the operation of the ADC 306 (e.g., by controlling an enable signal, a clock, and / or a power supply provided to the ADC 306). The ADC controller 308 may control the ADC 306 to selectively terminate the conversion of an analog value (e.g., analog Psum) before completing the conversion of all bits in the digital output Y. The ADC controller 308 may (e.g., be configured to) selectively stop the ADC 306 (e.g., pause or terminate the operation of the ADC 306) before one or more AF predictors based on the AF type deployed (e.g., being used) completely convert the analog output (e.g., analog Psum) into the digital output Y. The AF type may be known or may also be detected. In some examples, ADC controller 308 can control ADC 306, for example, based on a determination of an AF type (e.g., AF212) and one or more AF predictors (e.g., the sign of digital output Y) applied to digital output Y (e.g., ReLU AF).

[0079] ADC controller 308 may be coupled to activation function detector 310 and look-ahead symbol detector 312. ADC controller 308 may receive as input, for example, an AF type indication (e.g., signal) generated by activation function detector 310 and an AF predictor (e.g., Y value sign) indication (e.g., signal) generated by look-ahead symbol detector 312. In some examples, the AF type may be known, in which case activation function detector 310 may not detect the AF type or signal the AF type to ADC controller 308. In some examples, the AF type and one or more AF predictors may be related to each other. Figure 3 The difference is shown in the example.

[0080] An activation function (AF) detector 310 may be coupled to an input of the ADC controller 308 and to a memory 314, which may store a DNN topology (e.g., including the type of AF). The AF detector 310 may access the memory 314 to determine the AF type. For example, the DNN topology in the memory 314 may indicate that the AF 212 is a ReLU AF or another type of AF. The AF detector 310 may provide the determined AF type to the ADC controller 308.

[0081] The look-ahead sign detector 312 may be coupled to the output of the ADC 306 and to the input of the ADC controller 308. During analog-to-digital conversion of an analog value (e.g., analog Psum) by the ADC 306, the look-ahead sign detector 312 may read the MSB of the digital output Y (e.g., Y[4], depending on a fixed or variable precision rate of the digital output Y). The look-ahead sign detector 312 may determine whether the sign of the digital output Y is positive or negative based on the MSB of the digital output Y. The look-ahead sign detector 312 may provide an indication of the sign of the digital output Y to the ADC controller 308.

[0082] The ADC controller 308 may (e.g., configured to) selectively stop the operation of the ADC 306 based on the determination of the AF predictor of the determined AF type. The ADC controller 308 may be configured with logic for one or more AF types. In an example, the ADC controller 308 may (e.g., configured to) selectively terminate the operation of the ADC 306 during the conversion based on at least determining a negative sign of the digital output Y (e.g., for a known or determined ReLU AF type), thereby reducing power consumption of the MAC circuit.

[0083] The ADC controller 308 may selectively terminate the operation of the ADC 306, for example, by interrupting the power supply to the ADC 306, interrupting the clock provided to the ADC 306, negating the enable signal of the ADC 306, etc. The ADC controller 308 may (e.g., be configured to) selectively stop the ADC 306 (e.g., the SAR ADC) to reduce the number of cycles of a particular conversion operation of the ADC 306, thereby saving power. For example, the ADC controller 308 may terminate the conversion operation of the ADC 306 after one cycle based on the determination of the negative sign of the digital output Y, thereby avoiding four cycles (e.g., for unnecessary bits Y[3:0]). The ADC controller 308 may reduce the number of clock cycles of the ADC 306 to one clock cycle, thereby avoiding the energy consumption of four additional clock cycles of the ADC 306. This energy saving may occur in one or more operations of one or more (e.g., many) MACPEs (e.g., hundreds, thousands, millions) of one or more layers (e.g., 50 layers), thereby (e.g., substantially) reducing the power consumption of the NPU implementation model operation.

[0084] Figure 4A flowchart of an example of a method 400 for model training, detecting, and storing DNN topology and other information according to an example embodiment is shown. The example training method 400 presents one of many possible example methods for the model trainer 118 to train the NN model 120. The various embodiments disclosed herein and other embodiments may operate according to the example training method 400. The example training method 400 includes steps 402-420. However, other embodiments may operate according to other methods. Based on the foregoing discussion of the various embodiments, other structural and operational embodiments will be apparent to those skilled in the relevant art. Unless explicitly stated or inherently required, the order of steps is not required. It is not required that the method embodiments be implemented. Figure 4 Embodiments may implement fewer, more, or different steps.

[0085] like Figure 4 As shown, in step 402, a model architecture and hyperparameters may be selected and / or updated for a (e.g., DNN) model. Figure 1 As shown, the user 102 and / or the model trainer 118 can select or update the model architecture and hyperparameters of the (e.g., DNN) model (e.g., NN model 120). The model architecture can be selected by selecting the topology of the neural network. The topology can be a computational graph of multiplication, summation, and connectivity.

[0086] In step 404, the weights (eg, X, W input bit widths) and MAC accuracy may be initialized. Figure 1-3 As shown, the user 102 and / or the model trainer 118 may initialize the weights 220 and the MAC accuracy 224 for the (e.g., DNN) model (e.g., NN model 120). For example, the AMAC node accuracy may be initialized using a maximum accuracy value, a mixed accuracy value, a random accuracy value, etc.

[0088] In step 406, the model (e.g., with initialized values) can be run in a feed-forward path to (e.g., iteratively) develop model weights, precision, etc. based on the training data, including determining precision information. Figure 1-3 As shown, the model trainer 118 can use the training data input as Ifmap 222 to train the NN model 120, and modify the weights 220 and precision 224 accordingly to improve the accuracy of the NN model 120 based on the labels in Ifmap 222.

[0089] In step 408, the error, loss and / or cost function may be evaluated. For example, Figure 1-3 As shown, the model trainer 118 can evaluate error, loss, and / or cost functions to understand the performance of possible configurations of the NN model 120 at a certain stage of training.

[0090] In step 410, it may be determined whether the model being trained has reached convergence. Figure 1-3 As shown, the model trainer 118 can determine (e.g., based on the error, loss, and / or cost function evaluations) whether additional training can improve the NN model 120. For example, when the weights converge with accurate target labels, the model (e.g., DNN) can be trained. For example, if the error, loss, and / or cost function stabilizes within an (e.g., predetermined) range of acceptable final values, convergence can be achieved through model training.

[0091] In step 412, if the trained model has converged, it can be determined whether the model in training has reached the target. Figure 1-3 As shown, the model trainer 118 may determine whether the trained model has reached or achieved one or more objectives (eg, accuracy) (eg, if the model has converged).

[0092] In step 414, if the model achieves one or more goals, the model can be considered trained. Figure 1-3 As shown, the model trainer 118 can determine whether the NN model 120 has been fully trained based on a determination that the NN model 120 has converged and achieved one or more (e.g., specified) objectives.

[0093] In step 416, the DNN topology, weight values, and accuracy information (e.g., Y accuracy) may be stored. Figure 1-3 As shown, the model trainer 118 can store the topology, weights 220, and accuracy 224 of the NN model 120 in one or more files (e.g., for subsequent loading and use when the NN application 110 utilizes the NN model 120 for inference).

[0094] The precision can be fixed or monitored, determined, and / or saved throughout the training of multiple training input frames (e.g., training Ifmap) to capture the dynamic range of multiple frame inputs (e.g., over the entire training dataset). The precision information can be applied to a large number of frames processed by the trained model during inference to provide dynamic control of the ADC cycle, for example, by monitoring and storing the precision (e.g., effective number of bits) for many frames.

[0095] In step 418, if it is determined in step 410 that the trained model has not converged, backpropagation (backprop) may be performed and after backpropagation, the process returns to step 406. Figure 1-3As shown, if it is determined at step 410 that the trained model has not converged, the model trainer 118 may perform backpropagation on the NN model 120 and return to step 406. Backpropagation may reduce the error, loss, and / or cost function in an attempt to converge (e.g., while maintaining model accuracy). For example, images in a data set may be run through a computational graph (e.g., a DNN). The results may be compared to ground truth (e.g., labels). Error may be measured or calculated based on the difference between the results and the labels. If the error is not satisfactory, backpropagation may be performed to propagate the error backward (e.g., backpropagate on the computational graph) to determine (e.g., learn) how the error is generated or affected by the weight values. One or more weight values ​​in the DNN may be adjusted to reduce (e.g., minimize) the error.

[0096] In step 420, if the model is determined to have converged in step 410 but is determined in step 412 to have failed to achieve one or more goals, a network architecture search (NAS) improvement cycle may be initiated. Figure 1-3 As shown, if it is determined at step 410 that the model has converged but it is determined at step 412 that the model has failed to achieve one or more goals, the model trainer 118 may perform a NAS improvement loop on the NN model 120. The model trainer 118 may return to step 402. For example, if the NN model 120 has converged but has not achieved the goals, then adjustments to the topology and / or hyperparameters, such as the number of layers, the number of neurons, activation functions, enhancers (e.g., improvers, optimizers), learning rates, batch sizes, epochs, the number of processing elements N (e.g., 64, 128, 512 based on vector length) added together per MAC circuit, and the like may be attempted.

[0097] Figure 5 A flow chart of a method 500 for improving the performance (e.g., reducing power consumption) of a hardware accelerator (e.g., a neural processor) including an energy-efficient hybrid or analog MAC circuit using a trained model during inference according to an example embodiment is shown. The various embodiments disclosed herein and other embodiments may operate according to the example method 500. The method 500 includes steps 502-512. However, other embodiments may operate according to other methods. Based on the foregoing discussion of the various embodiments, other structural and operational embodiments will be apparent to those skilled in the relevant art. Unless explicitly stated or inherently required, no order of steps is required. It is not required that the method embodiments be implemented Figure 5 Follow all the steps shown in . Figure 5 This is just one of many possible embodiments. Embodiments may implement fewer, more, or different steps.

[0098] like Figure 5 As shown, in step 502, the DNN topology, weights (W), Y accuracy, features or intermediate layer outputs (X) may be received and configured. Figure 1-3 As shown, the computing device 104 may receive the NN model 120 from the server 116 (e.g., based on a request from the NN application 110) in the form of a DNN topology, weights (W), Y accuracy, features, or intermediate layer outputs (X). The NN application 110 may configure the DNN model according to the received DNN topology, weights (W), Y accuracy, features, or intermediate layer outputs (X). For example, a topology file having parameters (e.g., convergence weights) in the file may be loaded and executed to infer object labels for a new image frame having one or more objects.

[0099] In step 504, the activation function type of the MAC circuit operation may be determined. Figure 1-3 As shown, the MAC / AMAC circuit 218 (eg, the activation function detector 310 ) may determine the type of activation function (AF) 212 used by the ADC controller 308 .

[0100] In step 506, the MAC circuit may perform a vector / matrix multiplication and accumulation operation. Figure 1-3 As shown, the MAC circuit 300 can perform vector / matrix multiplication and accumulation operations. Each UE 320 in each PE in PE[0]-PE[N-1] can multiply the input Xi[2:0] with the weight Wi[2:0] to generate an interim value coupled to the charge collection bus 302 through the capacitor C. The combiner 304 can generate an analog Psum value for each column of UEs 320 in PE PE[0]-PE[N-1] from the charge collection bus 302.

[0101] In step 508, an AF predictor (eg, one or more AF predictors) may be determined. For example, Figure 1-3 As shown, ADC 306 may begin digitizing the analog Psum accumulated by combiner 304. The first bit determined may be the MSB (e.g., Y[4]). Look-ahead sign detector 312 may determine the sign of the digitized Psum value based on the MSB. The MSB or the sign determined based on the MSB may be an AF predictor (e.g., a parameter indicating or predicting an output of an AF function). For example, the MSB or the sign determined based on the MSB may indicate an output to be generated by a ReLU AF layer. In an example, the ReLU AF layer may convert a negative signed Psum value to zero.

[0102] In step 510, the partial sum (Psum) may be digitized based on an AF type determination and an AF predictor determination, such as a determination based on a ReLU type AF determination and a determination of the MSB or sign of the Psum value. Figure 1-3As shown, the ADC controller 308 may control the operation of the ADC 306 based on the AF type determined by the activation function detector 310 and the sign of the Psum value determined by the look-ahead sign detector 312. In an example, the ADC controller 308 may allow the ADC 306 to convert the analog Psum value generated by the combiner 304 based on the determination that the AF type is not ReLU and / or based on the determination that the sign of the Psum value is positive. The ADC controller 308 may stop the ADC 306 from converting the analog Psum value generated by the combiner 304 based on the determination that the AF type is ReLU and the sign of the Psum value is negative. The ADC controller 308 may stop the operation of the ADC 306, for example, by interrupting power to the ADC 306, by negating an enable signal of the ADC 306, by interrupting a clock to the ADC 306, etc.

[0103] In step 512, Psum may be collected and an output activation function (e.g., ReLU) may be applied to Psum. Figure 1-3 As shown, the MAC circuit 218 may generate Psum, the Psum processor may collect and store the Psum in an output Fmap and Psum memory (not shown), and the NN model 120 may apply the output activation function 212 to the (e.g., stored) Psum. Positive Psum may be indicated by the full digital value Y[4:0], while negative Psum may be indicated by the MSB Y[4]. The ReLU AF may convert negative Psum to zero.

[0104] Figure 6 A flow chart of a method 600 for improving the performance (e.g., reducing power consumption) of a hardware accelerator (e.g., a neural processor) including energy-efficient hybrid or analog MAC circuits using a trained model during inference according to an example embodiment is shown. Various embodiments disclosed herein and other embodiments may operate according to the example method 600. Figure 6 An example implementation is shown relating to a ReLU AF layer and an associated ReLU AF predictor (e.g., the sign of a MAC circuit output value). Method 600 includes steps 602-612. However, other embodiments may operate according to other methods. Based on the foregoing discussion of the various embodiments, other structural and operational embodiments will be apparent to those skilled in the relevant art. Unless explicitly stated or inherently required, no order of steps is required. No method embodiment is required to implement Figure 6 Follow all the steps shown in . Figure 6 This is just one of many possible embodiments. Embodiments may implement fewer, more, or different steps.

[0105] like Figure 6 As shown, in step 602, a MAC operation may be performed on the input and weight provided to the MAC circuit. Figure 1-3 As shown, the MAC circuit 218 or 300 can perform a multiplication-accumulation operation on the corresponding input Ifmap (X) and weight (W). Each UE 320 in each PE in PE[0]-PE[N-1] can multiply the input Xi[2:0] with the weight Wi[2:0] to generate an interim value coupled to the charge collection bus 302 through the capacitor C. The combiner 304 can generate an analog Psum value for each column of UEs 320 in each PE PE[0]-PE[N-1] from the charge collection bus 302.

[0106] In step 604, analog outputs may be generated from the MAC operation. For example, Figure 1-3 As shown, charge collection bus 302 may accumulate charge from the products, and combiner 304 may combine the charges weighted based on their importance into an analog output (eg, an analog Psum value) that is provided to ADC 306 .

[0107] In step 606, the ADC may convert part of the analog output into a digital output. Figure 1-3 As shown, ADC 306 may convert the analog output received from combiner 304 into the MSB Y[4]. ADC 306 may begin digitizing the analog Psum accumulated by combiner 304. The first bit determined may be the MSB (eg, Y[4]).

[0108] In step 608, it may be determined whether the AF layer is a ReLU AF layer and whether MSB Y[4] indicates a negative value. If both are true, step 610 may be performed. If either is false, step 612 may be performed. For example, if Figure 1-3 As shown, the activation function detector 310 may determine the type of activation function (AF) 212. The look-ahead sign detector 312 may determine the sign of the digitized Psum value based on the MSB Y[4].

[0109] In step 610, the power consumption of the MAC circuit can be reduced by stopping the operation of the ADC. Figure 1-3 As shown, ADC controller 308 may determine that the AF type is ReLU and the sign is negative. If the negative sign indicates or predicts that the ReLU AF layer will convert the negative digital output to zero, ADC controller 308 may stop the operation of ADC 306 (e.g., after generating MSB Y[4]).

[0110] In step 612, the MAC circuit may be allowed to complete the conversion of the analog output to the digital output. Figure 1-3As shown, the ADC controller 308 may determine that the AF type is not ReLU and / or the sign is positive. The ADC controller 308 may allow the operation of the ADC 306 to continue to complete the conversion of the digital output Y[4:0].

[0111] III. Example Computing Device Embodiments

[0112] As mentioned herein, the described embodiments, together with any circuits, components and / or subcomponents thereof, and the flowcharts / flowcharts (including portions thereof) and / or other embodiments described herein, may be implemented in hardware or hardware with any combination of software and / or firmware, including implemented as computer program code configured to be executed in one or more processors and stored in a computer-readable storage medium, or implemented as hardware logic / circuitry, such as implemented together in a system on a chip (SoC), a field programmable gate array (FPGA), or an application-specific integrated circuit (ASIC). A SoC may include an integrated circuit chip that includes one or more of the following: a processor (such as a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or further circuits and / or embedded firmware for performing its functions.

[0113] Figure 7 An exemplary implementation of a computing device 700 in which various example embodiments may be implemented is shown. Consistent with all other descriptions provided herein, the description of computing device 700 is a non-limiting example for purposes of illustration. Various example embodiments may also be implemented in other types of computer systems known to those skilled in the relevant art.

[0114] like Figure 7As shown, the computing device 700 includes one or more processors (referred to as processor circuits 702), a system memory 704, and a bus 706 that couples various system components including the system memory 704 to the processor circuit 702. The processor circuit 702 is an electronic and / or optical circuit implemented as a central processing unit (CPU), a microcontroller, a microprocessor, and / or other physical hardware processor circuits using one or more physical hardware electronic circuit device elements and / or integrated circuit devices (semiconductor material chips or dies). The processor circuit 702 can execute program codes stored in a computer-readable medium, such as program codes of an operating system 730, an application 732, other programs 734, etc. The bus 706 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or a local bus using any of a variety of bus architectures. The system memory 704 includes a read-only memory (ROM) 708 and a random access memory (RAM) 710. The basic input / output system 712 (BIOS) is stored in the ROM 708.

[0115] The computing device 700 also has one or more of the following drives: a hard disk drive 714 for reading and writing a hard disk, a disk drive 718 for reading or writing a removable disk 716, and an optical drive 720 for reading or writing a removable optical disk 722 such as a CD ROM, DVD ROM or other optical media. The hard disk drive 714, the disk drive 716, and the optical drive 720 are connected to the bus 706 via a hard disk drive interface 724, a disk drive interface 726, and an optical drive interface 728, respectively. These drives and their associated computer-readable media provide non-volatile storage of computer-readable instructions, data structures, program modules and other data for the computer. Although a hard disk, a removable disk and a removable optical disk are described, other types of hardware-based computer-readable storage media such as flash memory cards, digital video disks, RAM, ROM and other hardware storage media may also be used to store data.

[0116] Several program modules may be stored on a hard disk, a magnetic disk, an optical disk, a ROM, or a RAM. These programs include an operating system 730, one or more application programs 732, other programs 734, and program data 736. Application programs 732 or other programs 734 may include, for example, computer program logic (e.g., computer program code or instructions) for implementing the example embodiments described herein.

[0117] A user may enter commands and information into the computing device 700 through input devices such as a keyboard 738 and a pointing device 740. Other input devices (not shown) may include a microphone, a joystick, a game controller, a satellite dish, a scanner, a touch screen and / or touch pad, a voice recognition system for receiving voice input, a gesture recognition system for receiving gesture input, and the like. These and other input devices are typically connected to the processor circuit 706 through a serial port interface 742 coupled to the bus 702, but may be connected through other interfaces such as a parallel port, a game port, or a universal serial bus (USB).

[0118] Display screen 744 is also connected to bus 706 via an interface, such as video adapter 746. Display screen 744 can be external to or incorporated into computing device 700. Display screen 744 can display information, as well as serve as a user interface for receiving user commands and / or other information (e.g., by touch, finger gestures, a virtual keyboard, etc.). In addition to display screen 744, computing device 700 may also include other peripheral output devices (not shown), such as speakers and printers.

[0119] The computing device 700 is connected to a network 748 (e.g., the Internet) through an adapter or network interface 750, a modem 752, or other means for establishing communications over the network. The modem 752, which may be internal or external, may be connected to the bus 706 via the serial port interface 742, such as a serial bus. Figure 7 As shown, or another interface type including a parallel interface may be used to connect to bus 706.

[0120] As used herein, the terms "computer program medium", "computer readable medium" and "computer readable storage medium" are used to refer to physical hardware media, such as a hard disk associated with hard disk drive 714, removable disk 718, removable optical disk 722, other physical hardware media (such as RAM, ROM), flash memory cards, digital video disks, zip disks, MEMs, nano-based storage devices, and other types of physical / tangible hardware storage media. Such computer readable storage media are distinguished from and do not overlap with communication media (excluding communication media). Communication media carry computer readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves. The term "modulated data signal" means a signal in which one or more characteristics are set or changed in a manner that encodes information in the signal. As an example and not limitation, communication media include wireless media (such as acoustic, RF, infrared and other wireless media) and wired media. Each example embodiment also relates to such communication media that are separate and do not overlap with the embodiments for computer readable storage media.

[0121] As noted above, computer programs and modules (including application programs 732 and other programs 734) may be stored on a hard disk, disk, optical disk, ROM, RAM, or other hardware storage medium. Such computer programs may also be received via network interface 750, serial port interface 742, or any other interface type. These computer programs, when executed or loaded by an application, enable computer 700 to implement the features of the example embodiments described herein. Accordingly, such computer programs represent controllers of computer system 700.

[0122] The exemplary embodiments also relate to computer program products including computer codes or instructions stored on any computer readable medium. Such computer program products include hard drives, optical drives, memory device packages, portable memory sticks, memory cards, and other types of physical storage hardware.

[0123] IV. Example Embodiments

[0124] Energy-saving performance can be achieved in a hardware accelerator (e.g., a neural processor) that includes a hybrid or analog multiply-accumulate (MAC) processing element (PE). For example, power consumption can be reduced in a neural network with a rectified linear unit (ReLU) activation layer. The hybrid or analog MAC circuit can be configured with a look-ahead sign detector to dynamically stop calculations before completion, for example, based on the detection of negative values, the ReLU activation layer can (e.g., subsequently) convert negative values ​​to zero. The sign of the value can be indicated by the most significant bit (MSB). A controller can provide power and / or clock cycles to an analog-to-digital converter (ADC) to determine the sign of the value being calculated. The sign can be used to selectively complete the calculation of positive values ​​and selectively terminate the calculation of negative values, thereby reducing the power consumption of the MAC circuit.

[0125] In an example, the NPU may be configured to implement an AI NN model. The NPU may include at least one MAC circuit. The MAC circuit may include a plurality of MAC PEs. The MAC PE may include a multiplier (e.g., configured to perform a multiplication operation on an input and a weight to generate an interim value) and an accumulator configured to accumulate the interim value into an analog output. The MAC circuit may include an ADC configured to convert the analog output into a digital output. The MAC circuit may include an ADC (e.g., power) controller configured to selectively stop (e.g., suspend operation) the ADC before the analog output is fully converted into the digital output based at least on the sign of the digital output, thereby reducing power consumption of the MAC circuit.

[0126] In an example, the sign of the digital output may be indicated by the most significant bit (MSB) of the digital output.

[0127] In an example, the ADC controller may be configured to selectively stop the ADC by selectively interrupting power to the ADC.

[0128] In an example, the ADC may include a successive approximation register (SAR) ADC. The ADC controller may be configured to selectively stop the SAR ADC to reduce the number of cycles of the SAR ADC.

[0129] In an example, the ADC controller may be configured to selectively disable the ADC based on an indication of a type of activation function applied to the digital output and based on the sign of the digital output.

[0130] In an example, the ADC controller may be configured to selectively disable the ADC based on an indication that the activation function applied to the digital output comprises a rectified linear unit (ReLU) activation function and the sign of the digital output is negative.

[0131] In an example, the MAC circuit may (eg, further) include an activation function detector configured to determine an activation function type.

[0132] In an example, the MAC circuit may (eg, further) include a look-ahead symbol detector configured to determine a sign of the digital output.

[0133] In an example, a method can improve an implementation of an artificial intelligence (AI) neural network (NN) model. The method can include, for example, performing a multiply-accumulate (MAC) operation on an input and a weight provided to a MAC circuit; generating an analog output from the MAC operation; partially converting the analog output to a digital output through an analog-to-digital converter (ADC); determining a sign of the digital output based on the partial conversion; in response to at least determining that the symbol is a first symbol, completing conversion of the analog output to the digital output by the ADC; and in response to at least determining that the symbol is a second symbol, reducing power consumption of the MAC circuit by stopping conversion of the analog output to the digital output by the ADC, wherein the second symbol is different from the first symbol.

[0134] In an example, the partial conversion may include converting the analog output to a most significant bit (MSB) of the digital output. The sign of the digital output may be indicated by the MSB.

[0135] In an example, stopping conversion of the analog output to the digital output by the ADC may include interrupting power to the ADC.

[0136] In an example, the ADC may include a successive approximation register (SAR) ADC. Stopping the ADC from converting analog outputs to digital outputs may reduce power consumption of the MAC circuit by reducing the number of cycles of the SAR ADC.

[0137] In an example, stopping converting the analog output to the digital output by the ADC in response to at least determining that the symbol is the second symbol may include stopping converting the analog output to the digital output by the ADC in response to an indication of a first activation function type corresponding to the digital output and in response to determining that the symbol is the second symbol.

[0138] In an example, the first activation function type may be a rectified linear unit (ReLU) activation function, the second sign of the digital output may be negative, and the first sign of the digital output may be positive.

[0139] In an example, the method may (eg, further) include: determining that the activation function type is one of a first activation function type or a second activation function type.

[0140] In an example, a system may include one or more memory devices storing a deep neural network (DNN) topology. The system may include a neural processing unit (NPU). The NPU may include a multiply-accumulate (MAC) circuit. The MAC circuit may include a plurality of MAC processing elements (PEs) configured to generate analog outputs from multiplication and addition operations performed on inputs and weights; an analog-to-digital converter (ADC) configured to convert the analog outputs into digital outputs; and an ADC (e.g., power) controller configured to selectively stop (e.g., suspend operation) the ADC before the analog output is fully converted into the digital output based at least on a sign of the digital output, thereby reducing power consumption of the MAC circuit.

[0141] In an example, the ADC controller may be configured to selectively disable the ADC based on an indication of a type of activation function applied to the digital output and based on the sign of the digital output.

[0142] In an example, the ADC controller may be configured to selectively disable the ADC based on an indication that the activation function comprises a rectified linear unit (ReLU) activation function and the sign of the digital output is negative.

[0143] In an example, the MAC circuit may (eg, further) include an activation function detector configured to determine an activation function type.

[0144] In an example, the MAC circuit may (eg, further) include a look-ahead symbol detector configured to determine a sign of the digital output.

[0145] V. Conclusion

[0146] Although various examples are described above, it should be understood that they are presented as examples only and not as limitations. (All) those skilled in the relevant art will understand that various modifications can be made in form and details without departing from the spirit and scope of the subject matter as defined by the appended claims. Accordingly, the scope of the subject matter should not be limited by any of the examples described above, but should only be limited according to the following claims and their equivalents.

Claims

1. A neural processing unit (NPU) configured to implement an artificial intelligence (AI) neural network (NN) model, the NPU comprising: Multiply-accumulate (MAC) circuitry, including: a plurality of MAC processing elements (PEs) configured to perform multiplication operations on inputs and weights to generate interim values ​​and accumulate the interim values ​​into analog outputs; an analog-to-digital converter (ADC) configured to convert the analog output into a digital output; and An ADC controller is configured to selectively stop the ADC based on at least a sign of the digital output before the analog output is fully converted to the digital output, thereby reducing power consumption of the MAC circuit.

2. The NPU according to claim 1, wherein: The MAC circuit includes an analog MAC circuit or a hybrid MAC circuit.

3. The NPU according to claim 1, wherein: The ADC controller is configured to selectively disable the ADC by selectively interrupting power to the ADC.

4. The NPU according to claim 1, wherein: The ADC includes a successive approximation register (SAR) ADC, and wherein the ADC controller is configured to selectively stop the SAR ADC to reduce a number of cycles of the SAR ADC.

5. The NPU according to claim 1, wherein: The ADC controller is configured to selectively disable the ADC based on an indication of a type of activation function applied to the digital output and based on a sign of the digital output.

6. The NPU according to claim 5, wherein: The ADC controller is configured to selectively disable the ADC based on an indication that the activation function applied to the digital output comprises a rectified linear unit (ReLU) activation function and the sign of the digital output is negative.

7. The NPU according to claim 5, wherein: The MAC circuit further includes: An activation function detector is configured to determine the activation function type.

8. The NPU according to claim 1, wherein: The MAC circuit further includes: A look-ahead symbol detector is configured to determine the sign of the digital output.

9. A method for improving the implementation of an artificial intelligence (AI) neural network (NN) model, the method comprising: performing a multiply-accumulate (MAC) operation on the input and weights provided to the MAC circuit; generating an analog output from the MAC operation; Converting the analog output portion into a digital output via an analog-to-digital converter (ADC); determining a sign of the digital output based on the partial conversion; In response to at least determining that the symbol is the first symbol, converting the analog output to the digital output by the ADC; as well as Responsive to at least determining that the symbol is a second symbol that is different from the first symbol, power consumption of the MAC circuit is reduced by ceasing conversion of the analog output to the digital output by the ADC.

10. The method according to claim 9, wherein The partial conversion includes converting the analog output into a most significant bit (MSB) of the digital output, and wherein the sign of the digital output is indicated by the MSB.

11. The method according to claim 9, wherein Ceasing conversion of the analog output into the digital output by the ADC includes interrupting power to the ADC.

12. The method according to claim 9, wherein The ADC comprises a successive approximation register (SAR) ADC, and wherein ceasing conversion of the analog output to the digital output by the ADC reduces power consumption of the MAC circuit by reducing a number of cycles of the SAR ADC.

13. The method according to claim 9, wherein In response to at least determining that the symbol is the second symbol, ceasing, by the ADC, converting the analog output into the digital output includes: Conversion of the analog output to the digital output by the ADC is ceased in response to an indication of a first activation function type applied to the digital output and in response to determining that the symbol is the second symbol.

14. The method according to claim 13, wherein The first activation function type is a rectified linear unit (ReLU) activation function, the second sign of the digital output is negative, and the first sign of the digital output is positive.

15. The method according to claim 13, wherein Also includes: The activation function type is determined to be one of a first activation function type or a second activation function type.