EP4136584A1 - Modifying structure of artificial neural networks by collocating parameters - Google Patents
Modifying structure of artificial neural networks by collocating parametersInfo
- Publication number
- EP4136584A1 EP4136584A1 EP20727700.5A EP20727700A EP4136584A1 EP 4136584 A1 EP4136584 A1 EP 4136584A1 EP 20727700 A EP20727700 A EP 20727700A EP 4136584 A1 EP4136584 A1 EP 4136584A1
- Authority
- EP
- European Patent Office
- Prior art keywords
- weights
- arrays
- ann
- neurons
- array
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/082—Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
Definitions
- ANNs Artificial Neural Networks
- the human brain contains 10-20 billion neurons connected through synapses. Electrical and chemical messages are passed from neurons to neurons based on input information and their resistance to passing information.
- a neuron can be represented by a node performing a simple operation of addition coupled with a saturation function.
- a synapse can be represented by a connection between two nodes.
- Each of the connections can be associated with an operation of multiplication by a constant.
- the ANNs are particularly useful for solving problems that cannot be easily solved by classical computer programs. [0003] While forms of the ANNs may vary, they all have the same basic elements similar to the human brain. A typical ANN can be organized into layers, and each of the layers may include many neurons sharing similar functionality. The inputs of a layer may come from a previous layer, multiple previous layers, any other layers, or even the layer itself.
- Major architectures of ANNs include Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), and Long Term Short Memory (LTSM) network, but other architectures of ANN can be developed for specific applications.
- CNN Convolutional Neural Network
- RNN Recurrent Neural Network
- LTSM Long Term Short Memory
- ANNs can then be computed in parallel on many different computing elements similar to neurons of the brain.
- a single ANN may have hundreds of layers. Each of the layers can involve millions of connections. Thus, a single ANN may potentially require billions of simple operations like multiplications and additions. [0004] Because of the larger number of operations and their parallel nature, ANNs can result in a very heavy load for processing units (e.g., CPU), even ones running at high rates.
- processing units e.g., CPU
- GPUs graphics processing units
- GPUs graphics processing units
- GPUs appear to be more efficient in the computations of ANNs than the CPUs.
- GPUs are not well suited to the computations of ANNs because the GPUs have been specifically designed to compute graphical images.
- the GPUs may provide a certain level of parallelism in computations.
- the GPUs are constraining the computations in long pipes implying latency and lack of reactivity.
- very large GPUs can be used, which may involve excessive power consumption, which is a typical issue of GPUs. Since the GPUs may require more power consumption for the computations of ANNs, the deployment of GPUs can be difficult.
- CPUs provide a very generic engine that can execute very few sequences of instructions with a minimum effort in terms of programming, but lack the power of computing for ANN.
- the GPUs are slightly more parallel and require a larger effort of programming than CPUs, which can be hidden behind libraries with some performance costs but are not very suitable for ANNs.
- Field Programmable Gate Arrays FPGAs are professional components that can be programmed at the hardware level after they are manufactured. The FPGAs can be configured to perform computations in parallel. Therefore, FPGAs can be well suited to compute ANNs.
- One of the challenges of FPGAs is the programming, which requires a much larger effort than programming CPUs and GPUs.
- Adaption of FPGAs to perform ANN computations can be more challenging than for CPUs and GPUs.
- Most attempts in programming FPGAs to compute ANNs have been focusing on a specific ANN or a subset of ANNs requiring modification of the ANN structure to fit into a specific limited accelerator or providing a basic functionality without solving the problem of computing ANN on FPGAs globally.
- the computation scale is typically not considered for existing FPGA solutions, with much of the research being limited to a single or few computation engines, which could be replicated.
- the existing FPGA solutions do not solve the problem of massive data movement required at large scale for the actual ANN involved in real industrial applications.
- the inputs to be computed with an ANN are typically provided by an artificial intelligence (AI) framework.
- AI artificial intelligence
- a system for modifying structure of an ANN by collocating parameters may include one or more processing units.
- the processing units may receive a plurality of arrays of weights associated with the ANN.
- the processing units can modify the plurality of arrays of weights to generate a further plurality of further arrays of weights.
- the modification includes changing locations of weights in the arrays.
- the weights with changed locations may satisfy criteria for reducing the amount of operations involving the weights in computations of the ANN.
- Reducing the amount of computation of the ANN can include skipping operations involving the weights.
- Reducing the amount of computation of the ANN includes positioning the weights at the same position in the arrays to allow performance of operations involving the weights in a single computational cycle.
- an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights can be less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN computed using the further plurality of further arrays of weights.
- the processing units can receive a plurality of input values for the ANN.
- the processing units perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
- the further plurality of the further arrays of weights include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; and 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight in the computation of the ANN.
- Reducing the operations can include grouping multiple operations together during the computation of the ANN. Reduction of the operations may include skipping operations in the computations of the ANN.
- the processing units can determine that the weight satisfies the criteria by comparing the weight to one or more pre-determined reference value. For determining that an operation involving the weights can be skipped, the pre- determined reference values may be set to zero.
- the operations may include a multiplication or an addition.
- the modification of the plurality of arrays of weights may include changing an order of arrays in the plurality of arrays of weights.
- the modification of the plurality of arrays of weights may include inserting at least one additional array of values between two arrays in the plurality of arrays of weights.
- the modification of the plurality of arrays of weights may include splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and wherein the further plurality of further arrays of weights includes the first array.
- the modification of the plurality of arrays of weights may include determining that each of the plurality of arrays of weights includes a subset of weights, wherein each of the subset of weights satisfies a criterion for skipping the weights from computation of the neurons of the ANN.
- Modifying each of the plurality of arrays of weights may include removing the subset of weights and realigning the rest of the weights in all the plurality of arrays.
- the plurality of arrays of weights can be modified to decrease lengths of one of the following: sequences of zero weights located at a same position in subsequent arrays of weights in the plurality of arrays of weights or sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights.
- the processing units can generate an identifier related to an array of weights of the plurality of arrays of weights and associate the identifier with a weight from an array of weights in the further plurality of further arrays of weights.
- the processing units can identify, based on the identifier, an accumulator for accumulating a result of a multiplication between an input value and the weight of the array of the weights in the further plurality of arrays of weights.
- the plurality of arrays may include kernels for calculating feature maps in a convolution.
- a method for modifying structure of an ANN is provided. The method may include receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN. The method may allow modifying, by the one or more processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification includes changing locations of weights in arrays.
- the weights with changed locations satisfy criteria for reducing the amount of operations involving the weights in computation of ANN.
- Reducing the amount of computations of the ANN may include skipping operations involving the weight.
- the following conditions are satisfied: 1) an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights can be less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights.
- the method may include receiving, by the one or more processing units, a plurality of input values for the ANN and performing, by the one or more processing units, computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
- FIG.1 is a block diagram showing an example system wherein a method for modifying structure of ANNs by collocating parameters can be implemented, according to some example embodiments.
- FIG.2 shows an ANN, neuron, and transfer function, according to an example embodiment.
- FIG.3 is a flow chart showing training and inference of an ANN, according to some example embodiments.
- FIG.4 is a block diagram showing an example system for calculating neurons of ANNs, according to an example embodiment.
- FIG.5 is a block diagram showing an example structure of a convolutional neural network, according to some example embodiments.
- FIG.6 is a block diagram showing an example modification of an ANN by reordering of kernels, according to an example embodiment.
- FIG.7 is a block diagram showing an example modification of an ANN by splitting kernels, according to an example embodiment.
- FIG.8 is a block diagram showing an example complex modification of an ANN, according to an example embodiment.
- FIG.9 is a block diagram showing an example modification of an ANN by inserting kernels, according to an example embodiment.
- FIG.10 is a block diagram showing time of computations of neurons of an ANN, according to an example embodiment.
- FIG.11 is a block diagram showing an example modification of an ANN by reducing size of kernels, according to an example embodiment.
- FIG.12 is a block diagram showing an example modification of an ANN by aggregating kernels, according to an example embodiment.
- FIG.13 is a flow chart showing steps of a method for modifying structure of an ANN, according to some example embodiments.
- FIG.14 shows a computing system that can be used to implement embodiments of the disclosed technology.
- the terms “or” and “and” shall mean “and/or” unless stated otherwise or clearly intended otherwise by the context of their use.
- the term “a” shall mean “one or more” unless stated otherwise or where the use of “one or more” is clearly inappropriate.
- the terms “comprise,” “comprising,” “include,” and “including” are interchangeable and not intended to be limiting.
- the term “including” shall be interpreted to mean “including, but not limited to.”
- Embodiments of the present disclosure can be implemented using integrated circuits, for example, CPU, GPU, application-specific integrated circuits (ASICs) or FPGAs.
- the present technology may be also practiced with programmable logic devices, transistor-based circuits, or various combinations thereof.
- the methods described herein can be also implemented by hardware modules, software modules, or combinations of both.
- the methods can also be embodied in computer-readable instructions stored on computer-readable media.
- module shall be construed to mean a hardware device, software, or a combination of both.
- a hardware-based module can use one or more microprocessors, FPGAs, ASICs, programmable logic devices, transistor-based circuits, or various combinations thereof.
- Software-based modules can constitute computer programs, computer program procedures, computer program functions, and the like.
- a module of a system can be implemented by a computer or server, or by multiple computers or servers interconnected into a network.
- module may also refer to a subpart of a computer system, a hardware device, an integrated circuit, or a computer program.
- a system for performing multiple ANN computations may include one or more processing units.
- the processing units may receive a plurality of arrays of weights associated with the ANN.
- the processing units may modify the plurality of arrays of weights to generate a further plurality of further arrays of weights.
- the modification includes changing locations of weights in the array.
- the weights with changed locations can satisfy criteria for reducing the amount of operations involving the weights in computations of the ANN.
- reducing the amount of computation of the ANN includes skipping operations involving the weights in computation of the ANN.
- reducing the amount of computations of the ANN includes locating the weights at the same position in the further arrays.
- the processing units may receive a plurality of input values for the ANN and perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
- the further plurality of the further arrays of weights may include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight from the computation of ANN.
- Technical effects of certain embodiments of the present disclosure can include configuring integrated circuits, ASICs, CPUs, GPUs, FPGAs, or computer systems to perform ANN computations without execution of redundant and unnecessary operations or allowing an increase in a number of operations to be performed in parallel, thereby accelerating the ANN computations.
- FIG.1 is a block diagram showing an example system 100 for modifying structure of ANNs, according to some example embodiments.
- the system 100 can be part of a computing system, such as a personal computer, a server, a cloud-based computing recourse, and the like.
- the system 100 may include one or more processing unit(s) 110 and a memory 120.
- the memory 120 may include computer-readable instructions for execution by the processing unit(s) 110.
- the processing unit(s) 110 may include a programmable processor, such as a microcontroller, central processing unit (CPU), and so forth.
- the processing unit(s) 110 may include an application-specific integrated circuit(s), such as a CPU or a GPU, or programmable logic array(s), such as an FPGA(s), designed to implement the functions performed by the system 100.
- the system 100 may be installed on a remote server or may be provided via a cloud service residing in a cloud storage.
- the processing unit(s) 110 may be configured to receive a plurality of arrays of weights associated with the ANN.
- the processing unit(s) 110 may modify the plurality of arrays of weights to generate a further plurality of further arrays of weights. After the modification, an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing the same neurons of the ANN using the plurality of arrays of weights.
- outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN computed using the further plurality of further arrays of weights.
- the amount of operations refers to a total computational complexity of evaluation of neurons of the ANN.
- the computational complexity of the ANN may depend on a number of mathematical operations required to compute the neurons, computational complexity of the mathematical operations required to compute the neurons, a degree of parallelism that can be achieved in performing the operations of the neurons, and other computational complexity metrics.
- FIG.2 shows ANN 210, neuron 220, and transfer function 230, according to some example embodiments.
- the ANN 210 may include one or more input layers 240, one or more hidden layers 250, and one or more output layers 260.
- Each of the input layers 240, hidden layers 250, and output layers 260 may include one or more (artificial) neurons 220. The number of neurons can be different for different layers.
- Each of neurons 220 may represent a calculation of a mathematical function [0049] wherein V[i] are neuron input values to a neuron, W[i] are weights assigned to input values to the neuron, and F(X) is a transfer function 230 (also referred as to an activation function 230). Typically, the transfer function 230 F(X) is selected to be zero for X ⁇ 0 and have a limit of zero as X approaches zero.
- the transfer function F(X) can be linear, in the form of a sigmoid, binary step function, or other activation function used in ANN computations.
- the result of calculation of a neuron propagates as an input value of further neurons in the ANN.
- the further neurons can belong to either the next layer, previous layer, or the same layer.
- FIG.3 is a flow chart 300 showing training 310 and inference 325 of an ANN, according to some example embodiments.
- the training 310 (also known as learning) is a process of teaching ANN 305 to output a proper result based on a given set of training data 315.
- the process of training may include determining weights 320 of neurons of the ANN 305 based on training data 315.
- the training data 315 may include samples. Each of the samples may be represented as a pair of input values and an expected output.
- the training data 315 may include hundreds to millions of samples. While the training 310 is required to be performed only once, it may require a significant amount of computations and take a considerable time.
- the ANNs can be configured to solve different tasks including, for example, image recognition, speech recognition, handwriting recognition, machine translation, social network filtering, video games, medical diagnosis, and so forth.
- the inference 325 is a process of computation of an ANN.
- the inference 325 uses the trained ANN weights 320 and new data 330 including new sets of input values. For each new set of input values, the computation of the ANN provides a new output which answers the problem that the ANN is supposed to solve.
- an ANN can be trained to recognize various animals in images.
- the ANN can be trained on millions of images of animals. Submitting a new image to the ANN would provide the information for animals in the new image (this process being known as image tagging). While the inference for each image takes less computations than training, a number of inferences can be large because new images can be received from billions of sources.
- the inference 325 includes multiple computations of sum of products: [0054] wherein the V[i] are new input values to a neuron of ANN and W[i] are weights associated with the input values to the neuron.
- Some previous approaches for performing inference include inspection of the weights W[i] and replacing some of the weights W[i] with zero values if a value of the weight is relatively small when compared to other weights of the ANN. In FIG.3, this process is shown as pruning 335.
- the pruning 335 generates new weights 340 that then can be used in inference 325 instead of the weights 320. Replacing the weights with zero values may allow decreasing the number of computations of the ANN, since multiplications by zero can be avoided in computations.
- FIG.4 is a block diagram showing an example system 400 for calculating neurons of ANNs, according to an example embodiment.
- the system 400 is carried out as a hardware unit.
- the modifications of arrays of weights described herein involve changing locations of weights within the arrays, changing an order of arrays of weights, extracting common parts in the arrays, and truncating arrays. However, modifications of the arrays described herein do not require changing values of the weights, for example, setting some of the weights to zeros.
- the modifications of array of weights described herein do not require knowledge of input values for neurons and training sets for ANN.
- W 1k , W 2k , ... , W Nk the multiplication W 1k ⁇ V l can be omitted, and, hence, only accumulation is needed.
- the reduction of operations required for computations of the ANN can be also achieved by reducing an amount of “read” operations performed with the memories including memory 120.
- the modifications of arrays of weights, generating identifiers for arrays of weights, and assigning the identifiers to weights in the modified arrays of weights, and selecting, based on the identifiers, accumulators, can be carried out by one or more processing units 110.
- the system 400 can be integrated into the system 100 as one of the processing units 110.
- FIG.5 is a block diagram showing a structure 500 of a single convolution 505 of a CNN, according to some example embodiments.
- the structure 500 may include input channels 510 and kernels 520.
- the input channels include input values V ij to neurons of the CNN.
- the kernels 520 include weight W lk for the input values.
- the kernels 520 can be less in size than the input channels 510.
- the results of multiplications of the weights in kernels 520 and the input values in input channels 510 are stored in feature maps 530.
- Each result F rs is a sum of products of weights of one of kernels 520 and input values in a sliding window within one of the input channels 510, wherein the dimensions of the sliding window correspond to dimensions of the kernels 520.
- the kernels 520 may include both zero and non-zero weights W lk .
- the structure of the kernels 520 (which are two- dimensional arrays of weights) can be modified to balance number of zero weights W lk and number of the non-zero weights W lk across the series of the kernels 520.
- the balancing may allow to arrange some of weights W' kl across the series of the kernels in a such way, that the weights W' kl can be multiplied with corresponding input values V ij in a single computational cycle of a system for performing neuron computations, for example the system 400 shown in FIG.4.
- FIG.6 is a block diagram showing an example modification of an ANN 600 by reordering of kernels, according to an example embodiment.
- the ANN 600 include kernels 1, 2, 3, 4, 5, and 6.
- the kernel 5 and kernel 2 can be changed in order to balance number of zero weights across the series of the kernels.
- changing order in the kernels 1, 2, 3, 4, 5, and 6 can be carried out to decrease lengths of sequences of non-zero weights located at a same position in subsequent kernels in kernels 810.
- FIG.7 is a block diagram showing an example modification of an ANN 600 by splitting kernels, according to an example embodiment.
- each the kernels 520 has Y rows and X columns.
- Each of the kernels 520 includes submatrices of Y-B rows and X-A columns (A>0, B>0), wherein the submatrices include non-zero weights W lk .
- Each of the kernels 520 includes submatrix of Y-B columns and A rows, wherein all weight W lk are zero.
- the kernels 520 can be split in kernels 710-1, kernels 710-2, and kernels 710-K.
- the kernels 710-1 has Y-B rows and X-A columns and include corresponding weights located in first Y-B rows and X-A columns of original kernels 520.
- the kernel 710-2 has B rows and first X-A columns and include corresponding weights located in the last B rows and the first X-A columns of original kernels 520.
- the kernels 710-K have B rows and A columns and include corresponding weights located in the last B rows and the last A columns of the original kernels 520.
- the weights located in the first Y-B rows and the last A columns of the original kernels 520 can be excluded from computations of ANN 700.
- the computations of ANN can further proceed with the kernels 710-1, 710-2, and 710-K only.
- FIG.8 is a block diagram showing an example complex modification of an ANN 800, according to an example embodiment.
- the ANN 800 includes kernels 520.
- the kernels 520 includes a series of kernels 1, 2, 3, 4, 5, and 6.
- the modification of the kernels may start with dividing the kernels 520 in the kernels 810 and the kernels 820.
- the kernels 810 may include a series of kernels 1, 2, 4, and 6 of the original kernels 520.
- the kernels 820 may include a series of kernels 3 and 5 of the original kernels 520. [0068]
- the separation of the kernels 520 into kernels 810 and kernels 820 can be performed, for example, to collocate zero elements at the same positions in subsequent kernels.
- the kernels 810 can be then reduced in size to obtain kernels 830.
- the kernels 830 may include a series of kernels 1’, 2’, 4’, and 6’.
- the kernels 820 can be then split into kernels 840 and kernels 850.
- the kernels 840 may include series of kernels 3’ and 5’.
- the kernels 840 may include series of kernels 3'' and 5''.
- the kernels 3’, 5’, 3'', and 5'' are smaller in size than the kernels 3 and 5.
- the kernels 3’, 5’, 3’’, and 5’’ can include submatrices of the kernels 3 and 5. Some of zero weights of the kernels 3 and 5 may not be included in the kernels 3’, 5’, 3’’, and 5’’.
- FIG.9 is a block diagram showing an example modification of an ANN 900 by inserting kernels, according to an example embodiment.
- the ANN 800 includes a series of kernels 520.
- the kernels 520 include kernels 1, 2, 3, 4, 5, and 6.
- the series of kernels 520 are modified to insert kernel 2’ between original kernels 2 and 3 and kernel 4’ between original kernels 4 and 5.
- the kernels 2’ and 4’ may include only zero weights.
- the kernels 2 and 2’ resulting from inserting kernel 2’ can be equivalent to the original kernel 2.
- the resulting kernels 910 may include a series of kernels 1, 2, 2’, 3, 4, 4’, 5, and 6, wherein number of zero weights and number of non- zero weights are balanced across the series. Balancing numbers of zero and non-zero weights across the kernels may increase times needed for processing of some streams formed by weights of kernels 520. However, the balancing numbers of the zero and non-zero weights across the kernels 910 may reduce total time for processing of all streams of weights of the kernels 520 in ANN.
- FIG.10 is a block diagram 1000 showing time of computations of neurons of the ANN 900, according to an example embodiment.
- FIG.11 is a block diagram showing an example modification of an ANN 1100 by reducing size of kernels, according to an example embodiment.
- the ANN 1100 may include kernels 1110.
- the kernels 1110 may include a series of kernels 1, 2, 3, and 4.
- the kernels 1110 can be modified to collocate columns and/or rows including zero weights.
- the results of modification of kernels 1110 are kernels 1120 including a series of kernels 1’, 2’, 3’, and 4’.
- the kernels 1120 can be reduced in size by truncating rows and/or columns including only zero weights.
- the results of modification of the kernels 1120 are kernels 1130.
- the kernels 1130 include kernel 1'', 2'', 3'', and 4''.
- the kernel 3'' and 4'' can be further reduced in size by truncated columns including only zero weights.
- computations of ANN 1100 using the kernels 1130 may require less multiplications than computation of ANN 1100 using the original kernels 1110.
- FIG.12 is a block diagram showing an example modification of an ANN 1200 by aggregating kernels, according to an example embodiment.
- the ANN 1200 includes kernels 1210.
- the kernels 1210 includes a series of kernels 1, 2, 3, 4, 5, and 6.
- the kernels 1210 can be aggregated to for a single kernel 1220.
- the kernel 1220 incudes sequences of weights 1230, 1240, and 1250.
- the sequence 1230 includes zero weights of original kernels 1 and 2.
- the sequence 1240 includes zero weights of the original kernel 2 and 3.
- the sequence 1250 includes zero weights of the original kernel 4 and 5.
- FIG.13 is a flow chart showing steps of a method for modifying structure of artificial neural networks, according to some example embodiments.
- the method 1300 may be implemented by system 100.
- the method 1300 may commence in block 1305 with receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN. [0078] In block 1310, the method 1300 may include modifying, by the one or more processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification may change locations of weights. The weights with the changed locations may satisfy criteria for reducing operations required for computation of ANN.
- an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights.
- the further plurality of the further arrays of weights include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; and 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight in the computation of ANN.
- the plurality of arrays of weights is modified to decrease lengths of sequences of zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights.
- the plurality of arrays of weights is modified sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights.
- the modification of the plurality of arrays of weights may changing an order of arrays in the plurality of arrays of weights.
- the modification of the plurality of arrays of weights may include splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and wherein the further plurality of further arrays of weights includes the first array.
- the modification of the plurality of arrays of weights may include inserting at least one additional array of values between two arrays in the plurality of arrays of weights.
- the method 1300 may include receiving, by the one or more processing units, a plurality of input values for the ANN.
- the method 1300 may include performing, by the one or more processing units, computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
- FIG.14 illustrates an example computing system 1400 that may be used to implement embodiments described herein.
- the example computing system 1400 of FIG. 14 may include one or more processors 1410 and memory 1420.
- Memory 1420 may store, in part, instructions and data for execution by the one or more processors 1410.
- Memory 1420 can store the executable code when the exemplary computing system 1400 is in operation.
- the processor 1410 may include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein.
- the memory 1420 may include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein.
- the example computing system 1400 of FIG. 14 may further include a mass storage 1430, portable storage 1440, one or more output devices 1450, one or more input devices 1460, a network interface 1470, and one or more peripheral devices 1480. [0085]
- the components shown in FIG.14 are depicted as being connected via a single bus 1490. The components may be connected through one or more data transport means.
- Mass storage 1430 which may be implemented with a magnetic disk drive, an optical disk drive, or a solid state drive (SSD), is a non-volatile storage device for storing data and instructions for use by a magnetic disk, an optical disk drive, or SSD, which in turn may be used by one or more processors 1410. Mass storage 1430 can store the system software for implementing embodiments described herein for purposes of loading that software into memory 1420.
- the mass storage 1430 may also include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein.
- Portable storage 1440 may operate in conjunction with a portable non-volatile storage medium, such as a compact disk (CD) or digital video disc (DVD), to input and output data and code to and from the computing system 1400 of FIG. 14.
- the system software for implementing embodiments described herein may be stored on such a portable medium and input to the computing system 1400 via the portable storage 1440.
- One or more input devices 1460 provide a portion of a user interface.
- the one or more input devices 1460 may include an alphanumeric keypad, such as a keyboard, for inputting alphanumeric and other information, or a pointing device, such as a mouse, a trackball, a stylus, or cursor direction keys. Additionally, the computing system 1400 as shown in FIG.14 includes one or more output devices 1450. Suitable one or more output devices 1450 include speakers, printers, network interfaces, and monitors.
- Network interface 1470 can be utilized to communicate with external devices, external computing devices, servers, and networked systems via one or more communications networks such as one or more wired, wireless, or optical networks including, for example, the Internet, intranet, LAN, WAN, cellular phone networks (e.g., Global System for Mobile communications network, packet switching communications network, circuit switching communications network), Bluetooth radio, and an IEEE 802.11-based radio frequency network, among others.
- Network interface 1470 may be a network interface card, such as an Ethernet card, optical transceiver, radio frequency transceiver, or any other type of device that can send and receive information.
- Other examples of such network interfaces may include Bluetooth ® , 3G, 4G, and WiFi ® radios in mobile computing devices as well as a USB.
- One or more peripheral devices 1480 may include any type of computer support device to add additional functionality to the computing system.
- the one or more peripheral devices 1480 may include a modem or a router.
- the example computing system 1400 of FIG.14 may also include one or more accelerator devices 1485.
- the accelerator devices 1485 may include PCIe-form-factor boards or storage-form-factor boards, or any electronic board equipped with a specific electronic component like a GPU, a Neural Processing Unit, a Multi-CPU component, a FPGA component, or similar accelerating electronic or photonic components, that may be suitable for use with embodiments described herein.
- the exemplary computing system 1400 of FIG.14 can be a personal computer, handheld computing device, telephone, mobile computing device, workstation, server, minicomputer, mainframe computer, or any other computing device.
- the computer can also include different bus configurations, networked platforms, multi-processor platforms, and so forth.
- Various operating systems (OS) can be used including UNIX, Linux, Windows, Macintosh OS, Palm OS, and other suitable operating systems.
- OS operating systems
- Some of the above-described functions may be composed of instructions that are stored on storage media (e.g., computer-readable medium).
- the instructions may be retrieved and executed by the processor.
- Some examples of storage media are memory devices, tapes, disks, and the like.
- the instructions are operational when executed by the processor to direct the processor to operate in accord with the example embodiments.
- Those skilled in the art are familiar with instructions, processor(s), and storage media.
- any hardware platform suitable for performing the processing described herein is suitable for use with the example embodiments.
- the terms “computer-readable storage medium” and “computer-readable storage media” as used herein refer to any medium or media that participate in providing instructions to a CPU for execution. Such media can take many forms, including, but not limited to, non- volatile media, volatile media, and transmission media.
- Non-volatile media include, for example, optical or magnetic disks, such as a fixed disk.
- Volatile media include dynamic memory, such as RAM.
- Transmission media include coaxial cables, copper wire, and fiber optics, among others, including the wires that include one embodiment of a bus. Transmission media can also take the form of acoustic or light waves, such as those generated during radio frequency and infrared data communications.
- Computer-readable media include, for example, a floppy disk, a flexible disk, a hard disk, magnetic tape, any other magnetic medium, SSD, a CD-read-only memory (ROM) disk, DVD, any other optical medium, any other physical medium with patterns of marks or holes, a RAM, a PROM, an EPROM, an EEPROM, a FLASHEPROM, any other memory chip or cartridge, a carrier wave, or any other medium from which a computer can read.
- Various forms of computer-readable media may be involved in carrying one or more sequences of one or more instructions to a CPU for execution.
- a bus carries the data to system RAM, from which a CPU retrieves and executes the instructions.
- system RAM can optionally be stored on a fixed disk either before or after execution by a CPU.
- the instructions or data may not be used by the CPU but be accessed in writing or reading from the other devices without having the CPU directing them.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- General Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Neurology (AREA)
- Complex Calculations (AREA)
Abstract
Systems and methods for modifying structure of an artificial neural network (ANN) are provided. An example method comprises receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN, modifying, by the processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights, wherein after the modification the following conditions are satisfied: an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights.
Description
MODIFYING STRUCTURE OF ARTIFICIAL NEURAL NETWORKS BY COLLOCATING PARAMETERS TECHNICAL FIELD [0001] The present disclosure relates generally to data processing and, more particularly, to a system and method for modifying structure of artificial neural networks. BACKGROUND [0002] Artificial Neural Networks (ANNs) are simplified and reduced models reproducing the behavior of human brain. The human brain contains 10-20 billion neurons connected through synapses. Electrical and chemical messages are passed from neurons to neurons based on input information and their resistance to passing information. In the ANNs, a neuron can be represented by a node performing a simple operation of addition coupled with a saturation function. A synapse can be represented by a connection between two nodes. Each of the connections can be associated with an operation of multiplication by a constant. The ANNs are particularly useful for solving problems that cannot be easily solved by classical computer programs. [0003] While forms of the ANNs may vary, they all have the same basic elements similar to the human brain. A typical ANN can be organized into layers, and each of the layers may include many neurons sharing similar functionality. The inputs of a layer may come from a previous layer, multiple previous layers, any other layers, or even the layer itself. Major architectures of ANNs include Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), and Long Term Short Memory (LTSM) network, but other architectures of ANN can be developed for specific applications. While some operations have a natural sequence, for example a layer depending on previous layers, most operations can be carried out in parallel within the same layer.
The ANNs can then be computed in parallel on many different computing elements similar to neurons of the brain. A single ANN may have hundreds of layers. Each of the layers can involve millions of connections. Thus, a single ANN may potentially require billions of simple operations like multiplications and additions. [0004] Because of the larger number of operations and their parallel nature, ANNs can result in a very heavy load for processing units (e.g., CPU), even ones running at high rates. Sometimes, to overcome limitations of CPUs, graphics processing units (GPUs) can be used to process large ANNs because GPUs have a much higher throughput capacity of operations in comparison to CPUs. Because this approach solves, at least partially, the throughput limitation problem, GPUs appear to be more efficient in the computations of ANNs than the CPUs. However, GPUs are not well suited to the computations of ANNs because the GPUs have been specifically designed to compute graphical images. [0005] The GPUs may provide a certain level of parallelism in computations. However, the GPUs are constraining the computations in long pipes implying latency and lack of reactivity. To deliver the maximum throughput, very large GPUs can be used, which may involve excessive power consumption, which is a typical issue of GPUs. Since the GPUs may require more power consumption for the computations of ANNs, the deployment of GPUs can be difficult. [0006] To summarize, CPUs provide a very generic engine that can execute very few sequences of instructions with a minimum effort in terms of programming, but lack the power of computing for ANN. The GPUs are slightly more parallel and require a larger effort of programming than CPUs, which can be hidden behind libraries with some performance costs but are not very suitable for ANNs. [0007] Field Programmable Gate Arrays (FPGAs) are professional components that can be programmed at the hardware level after they are manufactured. The FPGAs can be configured to perform computations in parallel. Therefore, FPGAs can be well suited
to compute ANNs. One of the challenges of FPGAs is the programming, which requires a much larger effort than programming CPUs and GPUs. Adaption of FPGAs to perform ANN computations can be more challenging than for CPUs and GPUs. [0008] Most attempts in programming FPGAs to compute ANNs have been focusing on a specific ANN or a subset of ANNs requiring modification of the ANN structure to fit into a specific limited accelerator or providing a basic functionality without solving the problem of computing ANN on FPGAs globally. The computation scale is typically not considered for existing FPGA solutions, with much of the research being limited to a single or few computation engines, which could be replicated. The existing FPGA solutions do not solve the problem of massive data movement required at large scale for the actual ANN involved in real industrial applications. The inputs to be computed with an ANN are typically provided by an artificial intelligence (AI) framework. Those programs are used by the AI community to develop new ANN or global solutions based on ANN. Furthermore, the FPGAs lack integration in those software environments. SUMMARY [0009] This summary is provided to introduce a selection of concepts in a simplified form that are further 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 as an aid in determining the scope of the claimed subject matter. [0010] According to an example embodiment, a system for modifying structure of an ANN by collocating parameters is provided. The system may include one or more processing units. The processing units may receive a plurality of arrays of weights associated with the ANN. The processing units can modify the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification includes changing locations of weights in the arrays. The weights with changed locations may satisfy criteria for reducing the amount of operations involving the
weights in computations of the ANN. Reducing the amount of computation of the ANN can include skipping operations involving the weights. Reducing the amount of computation of the ANN includes positioning the weights at the same position in the arrays to allow performance of operations involving the weights in a single computational cycle. After the modification, the following conditions are satisfied: 1) an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights can be less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN computed using the further plurality of further arrays of weights. [0011] The processing units can receive a plurality of input values for the ANN. The processing units perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN. [0012] The further plurality of the further arrays of weights include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; and 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight in the computation of the ANN. Reducing the operations can include grouping multiple operations together during the computation of the ANN. Reduction of the operations may include skipping operations in the computations of the ANN. The processing units can determine that the weight satisfies the criteria by comparing the weight to one or more pre-determined reference value. For determining that an operation involving the weights can be skipped, the pre- determined reference values may be set to zero. The operations may include a multiplication or an addition.
[0013] The modification of the plurality of arrays of weights may include changing an order of arrays in the plurality of arrays of weights. The modification of the plurality of arrays of weights may include inserting at least one additional array of values between two arrays in the plurality of arrays of weights. [0014] The modification of the plurality of arrays of weights may include splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and wherein the further plurality of further arrays of weights includes the first array. [0015] The modification of the plurality of arrays of weights may include determining that each of the plurality of arrays of weights includes a subset of weights, wherein each of the subset of weights satisfies a criterion for skipping the weights from computation of the neurons of the ANN. Modifying each of the plurality of arrays of weights may include removing the subset of weights and realigning the rest of the weights in all the plurality of arrays. [0016] The plurality of arrays of weights can be modified to decrease lengths of one of the following: sequences of zero weights located at a same position in subsequent arrays of weights in the plurality of arrays of weights or sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights. [0017] The processing units can generate an identifier related to an array of weights of the plurality of arrays of weights and associate the identifier with a weight from an array of weights in the further plurality of further arrays of weights. The processing units can identify, based on the identifier, an accumulator for accumulating a result of a multiplication between an input value and the weight of the array of the weights in the further plurality of arrays of weights. [0018] The plurality of arrays may include kernels for calculating feature maps in a convolution.
[0019] According to another example embodiments, a method for modifying structure of an ANN is provided. The method may include receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN. The method may allow modifying, by the one or more processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification includes changing locations of weights in arrays. The weights with changed locations satisfy criteria for reducing the amount of operations involving the weights in computation of ANN. Reducing the amount of computations of the ANN may include skipping operations involving the weight. After the modification, the following conditions are satisfied: 1) an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights can be less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights. [0020] The method may include receiving, by the one or more processing units, a plurality of input values for the ANN and performing, by the one or more processing units, computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN. [0021] Additional objects, advantages, and novel features will be set forth in part in the detailed description section of this disclosure, which follows, and in part will become apparent to those skilled in the art upon examination of this specification and the accompanying drawings or may be learned by production or operation of the example embodiments. The objects and advantages of the concepts may be realized and attained by means of the methodologies, instrumentalities, and combinations particularly pointed out in the appended claims.
BRIEF DESCRIPTION OF THE DRAWINGS [0022] Embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements and, in which: [0023] FIG.1 is a block diagram showing an example system wherein a method for modifying structure of ANNs by collocating parameters can be implemented, according to some example embodiments. [0024] FIG.2 shows an ANN, neuron, and transfer function, according to an example embodiment. [0025] FIG.3 is a flow chart showing training and inference of an ANN, according to some example embodiments. [0026] FIG.4 is a block diagram showing an example system for calculating neurons of ANNs, according to an example embodiment. [0027] FIG.5 is a block diagram showing an example structure of a convolutional neural network, according to some example embodiments. [0028] FIG.6 is a block diagram showing an example modification of an ANN by reordering of kernels, according to an example embodiment. [0029] FIG.7 is a block diagram showing an example modification of an ANN by splitting kernels, according to an example embodiment. [0030] FIG.8 is a block diagram showing an example complex modification of an ANN, according to an example embodiment. [0031] FIG.9 is a block diagram showing an example modification of an ANN by inserting kernels, according to an example embodiment. [0032] FIG.10 is a block diagram showing time of computations of neurons of an ANN, according to an example embodiment. [0033] FIG.11 is a block diagram showing an example modification of an ANN by reducing size of kernels, according to an example embodiment.
[0034] FIG.12 is a block diagram showing an example modification of an ANN by aggregating kernels, according to an example embodiment. [0035] FIG.13 is a flow chart showing steps of a method for modifying structure of an ANN, according to some example embodiments. [0036] FIG.14 shows a computing system that can be used to implement embodiments of the disclosed technology.
DETAILED DESCRIPTION [0037] The following detailed description includes references to the accompanying drawings, which form a part of the detailed description. The drawings show illustrations in accordance with exemplary embodiments. These exemplary embodiments, which are also referred to herein as “examples,” are described in enough detail to enable those skilled in the art to practice the present subject matter. The embodiments can be combined, other embodiments can be utilized, or structural, logical, and electrical changes can be made without departing from the scope of what is claimed. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope is defined by the appended claims and their equivalents. [0038] For purposes of this document, the terms “or” and “and” shall mean “and/or” unless stated otherwise or clearly intended otherwise by the context of their use. The term “a” shall mean “one or more” unless stated otherwise or where the use of “one or more” is clearly inappropriate. The terms “comprise,” “comprising,” “include,” and “including” are interchangeable and not intended to be limiting. For example, the term “including” shall be interpreted to mean “including, but not limited to.” [0039] Embodiments of the present disclosure can be implemented using integrated circuits, for example, CPU, GPU, application-specific integrated circuits (ASICs) or FPGAs. The present technology may be also practiced with programmable logic devices, transistor-based circuits, or various combinations thereof. The methods described herein can be also implemented by hardware modules, software modules, or combinations of both. The methods can also be embodied in computer-readable instructions stored on computer-readable media. [0040] The term “module” shall be construed to mean a hardware device, software, or a combination of both. For example, a hardware-based module can use one or more microprocessors, FPGAs, ASICs, programmable logic devices, transistor-based circuits, or various combinations thereof. Software-based modules can constitute computer
programs, computer program procedures, computer program functions, and the like. In addition, a module of a system can be implemented by a computer or server, or by multiple computers or servers interconnected into a network. Alternatively, module may also refer to a subpart of a computer system, a hardware device, an integrated circuit, or a computer program. [0041] Embodiments of this disclosure are concerned with methods and systems for modifying structure of ANNs. According to some example embodiments, a system for performing multiple ANN computations may include one or more processing units. The processing units may receive a plurality of arrays of weights associated with the ANN. The processing units may modify the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification includes changing locations of weights in the array. The weights with changed locations can satisfy criteria for reducing the amount of operations involving the weights in computations of the ANN. In one embodiment, reducing the amount of computation of the ANN includes skipping operations involving the weights in computation of the ANN. In another embodiment, reducing the amount of computations of the ANN includes locating the weights at the same position in the further arrays. After the modification the following conditions are satisfied: 1) an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing the same neurons of the ANN using the plurality of arrays of weights; and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights. [0042] The processing units may receive a plurality of input values for the ANN and perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN. The further plurality of the further arrays of weights may
include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight from the computation of ANN. [0043] Technical effects of certain embodiments of the present disclosure can include configuring integrated circuits, ASICs, CPUs, GPUs, FPGAs, or computer systems to perform ANN computations without execution of redundant and unnecessary operations or allowing an increase in a number of operations to be performed in parallel, thereby accelerating the ANN computations. Further technical effects of some embodiments of the present disclosure can facilitate configuration of integrated circuits, ASICs, CPUs, GPUs, FPGAs, or computer systems to dynamically qualify data on which operations are to be performed in the ANN computations. [0044] Referring now to the drawings, exemplary embodiments are described. The drawings are schematic illustrations of idealized example embodiments. Thus, the example embodiments discussed herein should not be construed as limited to the particular illustrations presented herein, rather these example embodiments can include deviations and differ from the illustrations presented herein. [0045] FIG.1 is a block diagram showing an example system 100 for modifying structure of ANNs, according to some example embodiments. The system 100 can be part of a computing system, such as a personal computer, a server, a cloud-based computing recourse, and the like. The system 100 may include one or more processing unit(s) 110 and a memory 120. The memory 120 may include computer-readable instructions for execution by the processing unit(s) 110. The processing unit(s) 110 may include a programmable processor, such as a microcontroller, central processing unit (CPU), and so forth. In other embodiments, the processing unit(s) 110 may include an application-specific integrated circuit(s), such as a CPU or a GPU, or programmable logic array(s), such as an FPGA(s), designed to implement the functions performed by
the system 100. In various embodiments, the system 100 may be installed on a remote server or may be provided via a cloud service residing in a cloud storage. [0046] The processing unit(s) 110 may be configured to receive a plurality of arrays of weights associated with the ANN. The processing unit(s) 110 may modify the plurality of arrays of weights to generate a further plurality of further arrays of weights. After the modification, an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing the same neurons of the ANN using the plurality of arrays of weights. Additionally, after modification, outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN computed using the further plurality of further arrays of weights. The amount of operations refers to a total computational complexity of evaluation of neurons of the ANN. The computational complexity of the ANN may depend on a number of mathematical operations required to compute the neurons, computational complexity of the mathematical operations required to compute the neurons, a degree of parallelism that can be achieved in performing the operations of the neurons, and other computational complexity metrics. [0047] FIG.2 shows ANN 210, neuron 220, and transfer function 230, according to some example embodiments. The ANN 210 may include one or more input layers 240, one or more hidden layers 250, and one or more output layers 260. Each of the input layers 240, hidden layers 250, and output layers 260 may include one or more (artificial) neurons 220. The number of neurons can be different for different layers. [0048] Each of neurons 220 may represent a calculation of a mathematical function
[0049] wherein V[i] are neuron input values to a neuron, W[i] are weights assigned to input values to the neuron, and F(X) is a transfer function 230 (also referred as to an
activation function 230). Typically, the transfer function 230 F(X) is selected to be zero for X < 0 and have a limit of zero as X approaches zero. The transfer function F(X) can be linear, in the form of a sigmoid, binary step function, or other activation function used in ANN computations. The result of calculation of a neuron propagates as an input value of further neurons in the ANN. The further neurons can belong to either the next layer, previous layer, or the same layer. [0050] It should be noted that while the ANN 210 illustrated in FIG.2 can be referred to as a feedforward neural network, embodiments of the present disclosure can be also used in computations of CNNs, recurrent neural networks, long short-term memory networks, and other types of ANNs. [0051] FIG.3 is a flow chart 300 showing training 310 and inference 325 of an ANN, according to some example embodiments. The training 310 (also known as learning) is a process of teaching ANN 305 to output a proper result based on a given set of training data 315. The process of training may include determining weights 320 of neurons of the ANN 305 based on training data 315. The training data 315 may include samples. Each of the samples may be represented as a pair of input values and an expected output. The training data 315 may include hundreds to millions of samples. While the training 310 is required to be performed only once, it may require a significant amount of computations and take a considerable time. The ANNs can be configured to solve different tasks including, for example, image recognition, speech recognition, handwriting recognition, machine translation, social network filtering, video games, medical diagnosis, and so forth. [0052] The inference 325 is a process of computation of an ANN. The inference 325 uses the trained ANN weights 320 and new data 330 including new sets of input values. For each new set of input values, the computation of the ANN provides a new output which answers the problem that the ANN is supposed to solve. For example, an ANN can be trained to recognize various animals in images. Correspondingly, the ANN can
be trained on millions of images of animals. Submitting a new image to the ANN would provide the information for animals in the new image (this process being known as image tagging). While the inference for each image takes less computations than training, a number of inferences can be large because new images can be received from billions of sources. [0053] The inference 325 includes multiple computations of sum of products:
[0054] wherein the V[i] are new input values to a neuron of ANN and W[i] are weights associated with the input values to the neuron. Some previous approaches for performing inference include inspection of the weights W[i] and replacing some of the weights W[i] with zero values if a value of the weight is relatively small when compared to other weights of the ANN. In FIG.3, this process is shown as pruning 335. The pruning 335 generates new weights 340 that then can be used in inference 325 instead of the weights 320. Replacing the weights with zero values may allow decreasing the number of computations of the ANN, since multiplications by zero can be avoided in computations. [0055] FIG.4 is a block diagram showing an example system 400 for calculating neurons of ANNs, according to an example embodiment. The system 400 includes multipliers 425-i (i=1, …, N) and accumulator units 430-j (j=1, …, M). The system may receive arrays of weights ( W1k , W2k , … , WNk), (k =1, 2, …, K) and input values (V, V2, … , Vl , … ). The multipliers 425-i (i=1, …, N) perform multiplications of the weights in arrays of weights ( W1k , W2k , … , WNk), (k =1, 2, …, K) and input values (V, V2, … , Vl , … ) . The accumulator units 430-i (i=1, …, M) may accumulate results of multiplications by one or more multipliers 425-i (i=1, …, N). [0056] In some embodiments, the system 400 is carried out as a hardware unit. In these embodiments, the multiplications involving weights of a single array of weights
( W1k , W2k , … , WNk), (k = 1, 2, … , K) are performed in a single computational cycle of the system 400. If each of the arrays ( W1k , W2k , … , WNk) (k =1, 2, …, K) includes both zero and non-zero weights as shown in FIG.4, then the multiplication is executed for each of the arrays of weights without skipping any multiplication by zero. [0057] Assuming, that the arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) can be preliminarily modified in a such way, that at least one modified array of weights will include only zero weights. Then multiplications involving the zero weights can be skipped in a single computational cycle of the system 400. In this case, number of computational cycles required by the system 400 to execute the multiplication of weights and input values and accumulations of results of multiplications can be reduced by at least one cycle. [0058] Embodiments of the present disclosure allow modifying the arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) in a such way, that computations of the ANN with modified arrays of weights require a smaller amount of operations than computations of ANN with unmodified arrays of weights. It should be noted that this modification of the arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) differs from the process of pruning of weights (shown in block 335 of FIG.3) because the goal of pruning is to increase the number of zero weights in ANN, while modifications of the arrays of weights described in the present disclosure does not involve changing values of the weights. The modifications of arrays of weights described herein involve changing locations of weights within the arrays, changing an order of arrays of weights, extracting common parts in the arrays, and truncating arrays. However, modifications of the arrays described herein do not require changing values of the weights, for example, setting some of the weights to zeros. It should be noted, that unlike training and retraining of ANN, the modifications of array of weights described herein do not require knowledge of input values for neurons and training sets for ANN.
[0059] In some embodiments, the reduction in operations needed for computing the ANN can also be achieved when some of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) are equal to 1. When a weight ^^^ is equal to 1, the multiplication W1k × Vl can be omitted, and, hence, only accumulation is needed. The value ^^ can be sent without performing multiplication by multipliers 425-i (i=1, ..., N) directly to one or more accumulators 430-i (i=1, …, N). Thus, tracking weights equal to one and skipping multiplications involving these weights allow further reducing the amount of operations needed for computation of the ANN. [0060] In another embodiment, the reduction of operations required for computations of the ANN can be also achieved by reducing an amount of “read” operations performed with the memories including memory 120. The reduction of the “read” operations can be achieved by positioning, after reading from memory, the weight and storing the weight to different locations in arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) thereby allowing reduction of the amount of data used for the memories. [0061] In some embodiments, arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) can be assigned identifiers (ID1, ID2, … , IDk) , respectively. After the arrays of weights of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) are modified to obtain arrays of weights an differ from
N and can differ from
K, each weight in the modified arrays
ssociated with the identifiers (ID1, ID2, … , IDk) to indicate to which of the original arrays of weights ( W1k , W2k , … , WNk), (k = 1, 2, … , K) the weight belongs. The identifiers (ID1, ID2, … , IDk) can be used to select, from the accumulators 430-i (i=1, …, M), an accumulator for accumulating a result of a multiplication between an input value and the weight. [0062] The modifications of arrays of weights, generating identifiers for arrays of weights, and assigning the identifiers to weights in the modified arrays of weights, and
selecting, based on the identifiers, accumulators, can be carried out by one or more processing units 110. The system 400 can be integrated into the system 100 as one of the processing units 110. [0063] FIG.5 is a block diagram showing a structure 500 of a single convolution 505 of a CNN, according to some example embodiments. The structure 500 may include input channels 510 and kernels 520. The input channels include input values Vij to neurons of the CNN. The kernels 520 include weight Wlk for the input values. The kernels 520 can be less in size than the input channels 510. The results of multiplications of the weights in kernels 520 and the input values in input channels 510 are stored in feature maps 530. Each result Frs is a sum of products of weights of one of kernels 520 and input values in a sliding window within one of the input channels 510, wherein the dimensions of the sliding window correspond to dimensions of the kernels 520. [0064] The kernels 520 may include both zero and non-zero weights Wlk. Prior to computation of the convolution, the structure of the kernels 520 (which are two- dimensional arrays of weights) can be modified to balance number of zero weights Wlk and number of the non-zero weights Wlk across the series of the kernels 520. The balancing may allow to arrange some of weights W'kl across the series of the kernels in a such way, that the weights W'kl can be multiplied with corresponding input values Vij in a single computational cycle of a system for performing neuron computations, for example the system 400 shown in FIG.4. This may allow to exclude the cycle involving multiplications of the zero weights W'kl from the computations of neurons, and by so reduce amount of computations required to compute the results in feature maps 530, and hence, computations of neurons of the CNN 500. [0065] FIG.6 is a block diagram showing an example modification of an ANN 600 by reordering of kernels, according to an example embodiment. In example of FIG.6, the ANN 600 include kernels 1, 2, 3, 4, 5, and 6. The kernel 5 and kernel 2 can be changed in order to balance number of zero weights across the series of the kernels. In general,
changing order in the kernels 1, 2, 3, 4, 5, and 6 can be carried out to decrease lengths of sequences of non-zero weights located at a same position in subsequent kernels in kernels 810. The reordering of the kernels 1, 2, 3, 4, 5, and 6 may result in colocation of zero weights at the same positions in the kernels 1, 2, 3, 4, 5, and 6, which may further allow skipping multiplications of weights located in the same positions in a single computational cycle in a system for computing neurons of ANN, for example system 400 of FIG.4. For example, in kernel 1 and kernel 5, the same positions can be occupied by weights that are always zero and non-zero, and never non-zero simultaneously, thus allowing to perform operations related to kernel 1 and kernel 5 at the same time. [0066] FIG.7 is a block diagram showing an example modification of an ANN 600 by splitting kernels, according to an example embodiment. In example of FIG.7, each the kernels 520 has Y rows and X columns. Each of the kernels 520 includes submatrices of Y-B rows and X-A columns (A>0, B>0), wherein the submatrices include non-zero weights Wlk . Each of the kernels 520 includes submatrix of Y-B columns and A rows, wherein all weight Wlk are zero. The kernels 520 can be split in kernels 710-1, kernels 710-2, and kernels 710-K. The kernels 710-1 has Y-B rows and X-A columns and include corresponding weights located in first Y-B rows and X-A columns of original kernels 520. The kernel 710-2 has B rows and first X-A columns and include corresponding weights located in the last B rows and the first X-A columns of original kernels 520. The kernels 710-K have B rows and A columns and include corresponding weights located in the last B rows and the last A columns of the original kernels 520. The weights located in the first Y-B rows and the last A columns of the original kernels 520 can be excluded from computations of ANN 700. The computations of ANN can further proceed with the kernels 710-1, 710-2, and 710-K only. [0067] FIG.8 is a block diagram showing an example complex modification of an ANN 800, according to an example embodiment. In example of FIG.8, the ANN 800 includes kernels 520. The kernels 520 includes a series of kernels 1, 2, 3, 4, 5, and 6. The
modification of the kernels may start with dividing the kernels 520 in the kernels 810 and the kernels 820. The kernels 810 may include a series of kernels 1, 2, 4, and 6 of the original kernels 520. The kernels 820 may include a series of kernels 3 and 5 of the original kernels 520. [0068] The separation of the kernels 520 into kernels 810 and kernels 820 can be performed, for example, to collocate zero elements at the same positions in subsequent kernels. The kernels 810 can be then reduced in size to obtain kernels 830. The kernels 830 may include a series of kernels 1’, 2’, 4’, and 6’. Zero weights collocated in the same positions in series of kernels 810 may not be included in the kernels 830. [0069] The kernels 820 can be then split into kernels 840 and kernels 850. The kernels 840 may include series of kernels 3’ and 5’. The kernels 840 may include series of kernels 3'' and 5''. The kernels 3’, 5’, 3'', and 5'' are smaller in size than the kernels 3 and 5. The kernels 3’, 5’, 3’’, and 5’’ can include submatrices of the kernels 3 and 5. Some of zero weights of the kernels 3 and 5 may not be included in the kernels 3’, 5’, 3’’, and 5’’. [0070] The computation of neurons of ANN 800 can then proceed using the kernels 830, 840, and 850. The computation of ANN 800 using the kernels 830, 840, and 850 may require less multiplications than the computation of ANN 800 using the original kernels 520. [0071] FIG.9 is a block diagram showing an example modification of an ANN 900 by inserting kernels, according to an example embodiment. In example of FIG.9, the ANN 800 includes a series of kernels 520. The kernels 520 include kernels 1, 2, 3, 4, 5, and 6. The series of kernels 520 are modified to insert kernel 2’ between original kernels 2 and 3 and kernel 4’ between original kernels 4 and 5. The kernels 2’ and 4’ may include only zero weights. The kernels 2 and 2’ resulting from inserting kernel 2’ can be equivalent to the original kernel 2. The resulting kernels 910 may include a series of kernels 1, 2, 2’, 3, 4, 4’, 5, and 6, wherein number of zero weights and number of non-
zero weights are balanced across the series. Balancing numbers of zero and non-zero weights across the kernels may increase times needed for processing of some streams formed by weights of kernels 520. However, the balancing numbers of the zero and non-zero weights across the kernels 910 may reduce total time for processing of all streams of weights of the kernels 520 in ANN. For example, kernel 1 and modified kernel 2 on one side and kernel 2’ and kernel 3 can be processed at the same time, resulting in 2 sets of operations instead of 3 sets of operations required by processing original kernels 1, 2, and 3. [0072] FIG.10 is a block diagram 1000 showing time of computations of neurons of the ANN 900, according to an example embodiment. The diagram 1000 includes multipliers 425-i (i = 1, 2, …, N) that process streams of weights of the ANN 900. The times T1, T2. T3, … , TN are times of processing streams of weights of kernels 520 by the multipliers 425-i (i= 1, 2, …, N) assuming that multipliers 425-i (i= 1, 2, …, N) do not perform multiplications involving zero weights and number of zero weights is not balanced across the series of kernels 520. Unbalanced number of zero weights across the series of kernels 520 may result in situation when, for example, the multipliers 425-i (i = 1, 2, …, N-1) has finished processing streams of weights, while the multiplier 425-N continues processing stream designated to the multiplier 425-N. When the multiplier 425-N is finished, then an extra time between t1 and t2 will be required to check if all the streams of weights are processed and restart the processing for the next series of streams of weights. [0073] The times T'1, T'2, T'3, … , T'N are times of processing streams of weights of kernels 910 by the multipliers 425-i (i= 1, 2, …, N) assuming that multipliers 425-i (i= 1, 2, …, N) do not perform multiplications involving zero weights and numbers of zero weights is not balanced across the series of kernels 920. Because the number of zero weights is balanced across the kernels 920, the multipliers 425-i (i = 1, 2, …, N) may finish processing of the stream substantially at the same time. In this situation, even
there no decrease of time of processing for individual streams, the total time of processing the streams can be shorter because checks if all the streams are finished can be done substantially simultaneously for all the multipliers 425-i (i= 1, 2, …, N). [0074] FIG.11 is a block diagram showing an example modification of an ANN 1100 by reducing size of kernels, according to an example embodiment. In the example of FIG. 11, the ANN 1100 may include kernels 1110. The kernels 1110 may include a series of kernels 1, 2, 3, and 4. The kernels 1110 can be modified to collocate columns and/or rows including zero weights. The results of modification of kernels 1110 are kernels 1120 including a series of kernels 1’, 2’, 3’, and 4’. The kernels 1120 can be reduced in size by truncating rows and/or columns including only zero weights. The results of modification of the kernels 1120 are kernels 1130. The kernels 1130 include kernel 1'', 2'', 3'', and 4''. The kernel 3'' and 4'' can be further reduced in size by truncated columns including only zero weights. As result, computations of ANN 1100 using the kernels 1130 may require less multiplications than computation of ANN 1100 using the original kernels 1110. [0075] FIG.12 is a block diagram showing an example modification of an ANN 1200 by aggregating kernels, according to an example embodiment. In example of FIG.12, the ANN 1200 includes kernels 1210. The kernels 1210 includes a series of kernels 1, 2, 3, 4, 5, and 6. The kernels 1210 can be aggregated to for a single kernel 1220. The kernel 1220 incudes sequences of weights 1230, 1240, and 1250. The sequence 1230 includes zero weights of original kernels 1 and 2. The sequence 1240 includes zero weights of the original kernel 2 and 3. The sequence 1250 includes zero weights of the original kernel 4 and 5. The multiplication of the weights in the sequences 1230, 1240, and 1250 each can be skipped in computational cycles of a system for computing neuron of ANN, for example system 400 of FIG.4. The original kernels 1210 may not allow to skip the zero weights of the sequences 1230, 1240, and 1250 if, for example, the system 400 requires mutual multiplications involving at least 4 weights. As result, computation of ANN
1210 using the kernel 1220 may require less multiplications then computations of ANN 1210 using the original kernels 1210. [0076] FIG.13 is a flow chart showing steps of a method for modifying structure of artificial neural networks, according to some example embodiments. The method 1300 may be implemented by system 100. [0077] The method 1300, may commence in block 1305 with receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN. [0078] In block 1310, the method 1300 may include modifying, by the one or more processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights. The modification may change locations of weights. The weights with the changed locations may satisfy criteria for reducing operations required for computation of ANN. After the modification the following conditions are satisfied: 1) an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and 2) outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights. [0079] The further plurality of the further arrays of weights include a series of weights such that: 1) the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; and 2) each weight of the series of weights satisfies criteria for reducing the operations involving the weight in the computation of ANN. [0080] The plurality of arrays of weights is modified to decrease lengths of sequences of zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights. Alternatively, the plurality of arrays of weights is
modified sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights. [0081] The modification of the plurality of arrays of weights may changing an order of arrays in the plurality of arrays of weights. The modification of the plurality of arrays of weights may include splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and wherein the further plurality of further arrays of weights includes the first array. The modification of the plurality of arrays of weights may include inserting at least one additional array of values between two arrays in the plurality of arrays of weights. [0082] In block 1315, the method 1300 may include receiving, by the one or more processing units, a plurality of input values for the ANN. [0083] In block 1320, the method 1300 may include performing, by the one or more processing units, computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN. [0084] FIG.14 illustrates an example computing system 1400 that may be used to implement embodiments described herein. The example computing system 1400 of FIG. 14 may include one or more processors 1410 and memory 1420. Memory 1420 may store, in part, instructions and data for execution by the one or more processors 1410. Memory 1420 can store the executable code when the exemplary computing system 1400 is in operation. The processor 1410 may include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein. The memory 1420 may include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein. The example computing system 1400 of FIG. 14 may further include a mass storage 1430,
portable storage 1440, one or more output devices 1450, one or more input devices 1460, a network interface 1470, and one or more peripheral devices 1480. [0085] The components shown in FIG.14 are depicted as being connected via a single bus 1490. The components may be connected through one or more data transport means. The one or more processors 1410 and memory 1420 may be connected via a local microprocessor bus, and the mass storage 1430, one or more peripheral devices 1480, portable storage 1440, and network interface 1470 may be connected via one or more input/output buses. [0086] Mass storage 1430, which may be implemented with a magnetic disk drive, an optical disk drive, or a solid state drive (SSD), is a non-volatile storage device for storing data and instructions for use by a magnetic disk, an optical disk drive, or SSD, which in turn may be used by one or more processors 1410. Mass storage 1430 can store the system software for implementing embodiments described herein for purposes of loading that software into memory 1420. The mass storage 1430 may also include internal accelerators like a GPU, a FPGA, or similar accelerators that may be suitable for use with embodiments described herein. [0087] Portable storage 1440 may operate in conjunction with a portable non-volatile storage medium, such as a compact disk (CD) or digital video disc (DVD), to input and output data and code to and from the computing system 1400 of FIG. 14. The system software for implementing embodiments described herein may be stored on such a portable medium and input to the computing system 1400 via the portable storage 1440. [0088] One or more input devices 1460 provide a portion of a user interface. The one or more input devices 1460 may include an alphanumeric keypad, such as a keyboard, for inputting alphanumeric and other information, or a pointing device, such as a mouse, a trackball, a stylus, or cursor direction keys. Additionally, the computing system 1400 as shown in FIG.14 includes one or more output devices 1450. Suitable one
or more output devices 1450 include speakers, printers, network interfaces, and monitors. [0089] Network interface 1470 can be utilized to communicate with external devices, external computing devices, servers, and networked systems via one or more communications networks such as one or more wired, wireless, or optical networks including, for example, the Internet, intranet, LAN, WAN, cellular phone networks (e.g., Global System for Mobile communications network, packet switching communications network, circuit switching communications network), Bluetooth radio, and an IEEE 802.11-based radio frequency network, among others. Network interface 1470 may be a network interface card, such as an Ethernet card, optical transceiver, radio frequency transceiver, or any other type of device that can send and receive information. Other examples of such network interfaces may include Bluetooth®, 3G, 4G, and WiFi® radios in mobile computing devices as well as a USB. [0090] One or more peripheral devices 1480 may include any type of computer support device to add additional functionality to the computing system. The one or more peripheral devices 1480 may include a modem or a router. [0091] The example computing system 1400 of FIG.14 may also include one or more accelerator devices 1485. The accelerator devices 1485 may include PCIe-form-factor boards or storage-form-factor boards, or any electronic board equipped with a specific electronic component like a GPU, a Neural Processing Unit, a Multi-CPU component, a FPGA component, or similar accelerating electronic or photonic components, that may be suitable for use with embodiments described herein. [0092] The components contained in the exemplary computing system 1400 of FIG. 14 are those typically found in computing systems that may be suitable for use with embodiments described herein and are intended to represent a broad category of such computer components that are well known in the art. Thus, the exemplary computing system 1400 of FIG.14 can be a personal computer, handheld computing device,
telephone, mobile computing device, workstation, server, minicomputer, mainframe computer, or any other computing device. The computer can also include different bus configurations, networked platforms, multi-processor platforms, and so forth. Various operating systems (OS) can be used including UNIX, Linux, Windows, Macintosh OS, Palm OS, and other suitable operating systems. [0093] Some of the above-described functions may be composed of instructions that are stored on storage media (e.g., computer-readable medium). The instructions may be retrieved and executed by the processor. Some examples of storage media are memory devices, tapes, disks, and the like. The instructions are operational when executed by the processor to direct the processor to operate in accord with the example embodiments. Those skilled in the art are familiar with instructions, processor(s), and storage media. [0094] It is noteworthy that any hardware platform suitable for performing the processing described herein is suitable for use with the example embodiments. The terms “computer-readable storage medium” and “computer-readable storage media” as used herein refer to any medium or media that participate in providing instructions to a CPU for execution. Such media can take many forms, including, but not limited to, non- volatile media, volatile media, and transmission media. Non-volatile media include, for example, optical or magnetic disks, such as a fixed disk. Volatile media include dynamic memory, such as RAM. Transmission media include coaxial cables, copper wire, and fiber optics, among others, including the wires that include one embodiment of a bus. Transmission media can also take the form of acoustic or light waves, such as those generated during radio frequency and infrared data communications. Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, a hard disk, magnetic tape, any other magnetic medium, SSD, a CD-read-only memory (ROM) disk, DVD, any other optical medium, any other physical medium with patterns of marks or holes, a RAM, a PROM, an EPROM, an EEPROM, a FLASHEPROM, any
other memory chip or cartridge, a carrier wave, or any other medium from which a computer can read. [0095] Various forms of computer-readable media may be involved in carrying one or more sequences of one or more instructions to a CPU for execution. A bus carries the data to system RAM, from which a CPU retrieves and executes the instructions. The instructions received by system RAM can optionally be stored on a fixed disk either before or after execution by a CPU. The instructions or data may not be used by the CPU but be accessed in writing or reading from the other devices without having the CPU directing them. [0096] Thus, systems and methods for modifying structure of ANN are described. Although embodiments have been described with reference to specific exemplary embodiments, it will be evident that various modifications and changes can be made to these exemplary embodiments without departing from the broader spirit and scope of the present application. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.
Claims
CLAIMS What is claimed is: 1. A system for modifying a structure of an artificial neural network (ANN), the system comprising one or more processing units configured to: receive a plurality of arrays of weights associated with the ANN; modify the plurality of arrays of weights to generate a further plurality of further arrays of weights, wherein the modification includes changing locations of weights satisfying criteria for reducing an amount of operations involving the weights in a computation of the ANN and after the modification the following conditions are satisfied: an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN computed using the further plurality of further arrays of weights.
2. The system of claim 1, wherein the one or more processing units are configured to: receive a plurality of input values for the ANN; and perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
3. The system of claim 2, wherein the further plurality of the further arrays of weights include a series of weights such that: each weight of the series of weights satisfies criteria for reducing the amount of operations involving the weight from the computation of the ANN; and the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN.
4. The system of claim 3, wherein the one or more processors are configured to determine that the weight satisfies the criteria by comparing the weight to one or more pre-determined reference values.
5. The system of claim 4, wherein the one or more pre-determined reference values includes one of zero or one.
6. The system of claim 1, wherein the operations include multiplication.
7. The system of claim 1, wherein the modifying the plurality of arrays of weights includes changing an order of arrays in the plurality of arrays of weights.
8. The system of claim 1, wherein the modifying the plurality of arrays of weights includes inserting at least one additional array of values between two arrays in the plurality of arrays of weights.
9. The system of claim 1, wherein the modifying the plurality of arrays of weights includes splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and wherein the further plurality of further arrays of weights includes the first array.
10. The system of claim 1, wherein the modifying the plurality of arrays of weights includes: determining that each of the plurality of arrays of weights includes a subset of weights, wherein each of the subset of weights satisfies a criterion for skipping the weights from computation of the neurons of the ANN; and modifying each of the plurality of arrays of weights by removing the subset of weights and realigning the rest of the weights in all of the plurality of arrays.
11. The system of claim 1, wherein the plurality of arrays of weights is modified to decrease lengths of one of the following: sequences of zero weights located at a same position in subsequent arrays of weights in the plurality of arrays of weights; or sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights.
12. The system of claim 1, wherein the one or more processing units are configured to: generate an identifier related to an array of weights of the plurality of arrays of weights; and associate the identifier to a weight from an array of weights in the further plurality of further arrays of weights.
13. The system of claim 12, wherein the one or more processing units are configured to identify, based on the identifier, an accumulator for accumulating a result of a multiplication between an input value and the weight of the array of the weights in the further plurality of arrays of weights.
14. The system of claim 1, wherein the plurality of arrays includes kernels for calculating feature maps in a convolution.
15. A method for modifying structure of an artificial neural network (ANN), the method comprising: receiving, by one or more processing units, a plurality of arrays of weights associated with the ANN; modifying, by the one or more processing units, the plurality of arrays of weights to generate a further plurality of further arrays of weights, wherein the modification includes changing the locations of weights satisfying criteria for reducing an amount of operations involving the weights in a computation of the ANN and after the modification the following conditions are satisfied: an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights.
16. The method of claim 15, further comprising:
receiving, by the one or more processing units, a plurality of input values for the ANN; and performing, by the one or more processing units, computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN.
17. The method of claim 16, wherein the further plurality of the further arrays of weights include a series of weights such that: each weight of the series of weights satisfies the criteria for reducing an amount of operations involving the weight from the computation of the ANN; and the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN.
18. The method of claim 15, wherein the plurality of arrays of weights is modified to decrease lengths of one of the following: sequences of zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights; or sequences of non-zero weights located at the same position in subsequent arrays of weights in the plurality of arrays of weights.
19. The method of claim 15, wherein the modifying the plurality of arrays of weights includes one or more of the following: changing an order of arrays in the plurality of arrays of weights; splitting an array of the plurality of arrays of weights into a first array and at least one second array, wherein a size of the first array is less than a size of the array, and
wherein the further plurality of further arrays of weights includes the first array; and inserting at least one additional array of values between two arrays in the plurality of arrays of weights.
20. A system for modifying structure of an artificial neural network (ANN), the system comprising one or more processing units configured to: receive a plurality of arrays of weights associated with the ANN; modify the plurality of arrays of weights to generate a further plurality of further arrays of weights, wherein the modification includes modifying the locations of weights satisfying criteria for reducing an amount of operations involving the weights in computation of the ANN and after the modification the following conditions are satisfied: an amount of operations required for computing neurons of the ANN using the further plurality of further arrays of weights is less than an amount of operations required for computing same neurons of the ANN using the plurality of arrays of weights; and outputs of the neurons of the ANN computed using the plurality of arrays of weights are substantially equal to further outputs of the neurons of the ANN using the further plurality of further arrays of weights; receive a plurality of input values for the ANN; and perform computations of the neurons of the ANN based on the plurality of input values and the further plurality of further arrays of weights by performing the operations to obtain an output of the ANN, wherein the further plurality of the further arrays of weights include a series of weights such that:
the operations involving the series of weights and corresponding input values to the neurons are performed in a single computational cycle of computation of the ANN; and each weight of the series of weights satisfies criteria for reducing the amount of operations involving the weight in the computation of ANN.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/IB2020/053561 WO2021209789A1 (en) | 2020-04-15 | 2020-04-15 | Modifying structure of artificial neural networks by collocating parameters |
Publications (1)
Publication Number | Publication Date |
---|---|
EP4136584A1 true EP4136584A1 (en) | 2023-02-22 |
Family
ID=70802888
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
EP20727700.5A Pending EP4136584A1 (en) | 2020-04-15 | 2020-04-15 | Modifying structure of artificial neural networks by collocating parameters |
Country Status (2)
Country | Link |
---|---|
EP (1) | EP4136584A1 (en) |
WO (1) | WO2021209789A1 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10990648B2 (en) * | 2017-08-07 | 2021-04-27 | Intel Corporation | System and method for an optimized winograd convolution accelerator |
US10699160B2 (en) * | 2017-08-23 | 2020-06-30 | Samsung Electronics Co., Ltd. | Neural network method and apparatus |
-
2020
- 2020-04-15 WO PCT/IB2020/053561 patent/WO2021209789A1/en unknown
- 2020-04-15 EP EP20727700.5A patent/EP4136584A1/en active Pending
Also Published As
Publication number | Publication date |
---|---|
WO2021209789A1 (en) | 2021-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200226458A1 (en) | Optimizing artificial neural network computations based on automatic determination of a batch size | |
US20200311511A1 (en) | Accelerating neuron computations in artificial neural networks by skipping bits | |
US10990525B2 (en) | Caching data in artificial neural network computations | |
US11494624B2 (en) | Accelerating neuron computations in artificial neural networks with dual sparsity | |
US20200242445A1 (en) | Generic quantization of artificial neural networks | |
US11068784B2 (en) | Generic quantization of artificial neural networks | |
US11568255B2 (en) | Fine tuning of trained artificial neural network | |
US11748623B2 (en) | Modifying structure of artificial neural networks by collocating parameters | |
US10769527B2 (en) | Accelerating artificial neural network computations by skipping input values | |
WO2021209789A1 (en) | Modifying structure of artificial neural networks by collocating parameters | |
WO2020194032A1 (en) | Accelerating neuron computations in artificial neural networks by skipping bits | |
US11126912B2 (en) | Realigning streams of neuron outputs in artificial neural network computations | |
EP3895024A1 (en) | Caching data in artificial neural network computations | |
US20220222519A1 (en) | Optimizing operations in artificial neural network | |
US11645510B2 (en) | Accelerating neuron computations in artificial neural networks by selecting input data | |
US20210117800A1 (en) | Multiple locally stored artificial neural network computations | |
EP4278304A1 (en) | Optimizing operations in artificial neural network | |
EP3895072A1 (en) | Realigning streams of neuron outputs in artificial neural network computations | |
EP3908981A1 (en) | Optimizing artificial neural network computations based on automatic determination of a batch size | |
WO2022053851A1 (en) | Fine tuning of trained artificial neural network | |
WO2020234625A1 (en) | Accelerating neuron computations in artificial neural networks with dual sparsity | |
WO2020208396A1 (en) | Accelerating neuron computations in artificial neural networks by selecting input data | |
EP3895071A1 (en) | Accelerating artificial neural network computations by skipping input values | |
WO2021079168A1 (en) | Multiple locally stored artificial neural network computations | |
EP3915055A1 (en) | Generic quantization of artificial neural networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: UNKNOWN |
|
STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: THE INTERNATIONAL PUBLICATION HAS BEEN MADE |
|
PUAI | Public reference made under article 153(3) epc to a published international application that has entered the european phase |
Free format text: ORIGINAL CODE: 0009012 |
|
STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE |
|
17P | Request for examination filed |
Effective date: 20221115 |
|
AK | Designated contracting states |
Kind code of ref document: A1 Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR |
|
DAV | Request for validation of the european patent (deleted) | ||
DAX | Request for extension of the european patent (deleted) |