Elamur Research

Hardware and Software Optimizations for Accelerating Deep Neural Networks: Survey of Current Trends, Challenges, and the Road Ahead

Paper · 2020 · Maurizio Capra, Beatrice Bussolino, Alberto Marchisio et al.

Summary

A neural network can spend more energy fetching a number than using it in a calculation. That matters when a single prediction requires billions of multiply-and-accumulate operations, especially on a battery-powered device that has to respond quickly. Capra and colleagues survey ways to reduce that cost, from changing the order in which a processor runs a convolution to changing the network itself. They compare CPUs, graphics processing units, reprogrammable FPGAs, and application-specific integrated circuits. The paper gives particular attention to the last two because designers can tailor their memory, arithmetic, and interconnections to the workload.

The central design question is which values to keep near the arithmetic units. A convolution uses the same filter at many positions, the same input in several output channels, and some of the same pixels in neighboring windows. An accelerator can exploit those patterns by holding weights, inputs, or unfinished sums in small local memories and arranging computations around them. The survey connects those hardware decisions to software techniques such as loop reordering and tiling, which changes how a large calculation is divided into pieces. It also examines quantization, pruning, and sparse encodings, where the benefits depend on whether the hardware can use shorter numbers or skip zero-valued work without spending too much on indexing and communication.

The paper brings together evidence from earlier studies and uses worked examples to explain where the savings come from. In one cited memory comparison, at a 45 nm process node, an SRAM access uses 5.5× the energy of a 32-bit addition and a DRAM access uses 711×. In a separate VGG16 comparison, the reported accuracy loss against a floating-point baseline is 6.2% with 3-bit linear quantization and 0.6% with logarithmic quantization. The examples concern different layers of design, but both show why an arithmetic operation count alone tells an engineer little about the cost of a prediction.

The survey also covers spiking neural networks, whose computation and communication depend on when events arrive, and examines the hardware designed around those events. Its benchmarking discussion explains which conditions matter when comparing accuracy, speed, energy, and chip area. Its security discussion adds robustness and defense overhead to that assessment. Together, these topics frame acceleration as a problem of coordinating the network, its numerical representation, the software schedule, and the hardware that moves and processes the data.

Deep dive: Hardware and Software Optimizations for Accelerating Deep Neural Networks: Survey of Current Trends, Challenges, and the Road Ahead

Capra and colleagues survey how memory reuse, dataflow, and lower precision make deep neural networks faster and more energy efficient. · about 41 minutes to read

The problem and its context

Getting enough data to the arithmetic units

In machine learning, a deep neural network learns by adjusting the weights and biases that determine how inputs are transformed. The paper focuses on networks with layers of these transformations, especially convolutional networks used in image recognition and related tasks. Their basic arithmetic repeats on a large scale. Each multiply-and-accumulate operation, or MAC, multiplies two values and adds their product to a running sum. A convolution may perform this operation for many input positions, channels, and filters. At any one output position, the products serve a particular sum. Across the layer, some of the same inputs and weights serve many sums.

A processor needs access to a weight and an input activation for each product. An activation is a value produced by a neuron or layer and passed on for further processing. The processor also needs somewhere to hold the sum as it accumulates. If the weight, activation, and partial sum all have to travel through the memory hierarchy each time, the machine can spend much of its energy servicing the arithmetic. If requests exceed the bandwidth of the memory system, arithmetic units can also sit idle while waiting for operands. Those effects help explain why adding more MAC units can leave the effective speed of a network limited by data movement.

Training and inference put different demands on the machine. Training computes outputs, evaluates their error, and propagates information about that error backward so the parameters can be updated. Intermediate activations become useful again during this backward pass. Inference uses parameters learned earlier and computes the output for a new input. The authors concentrate their detailed memory analysis on inference, partly because it offered more accelerator case studies and partly because the intended deployment frequently put learning and prediction on different devices. A network could be trained offline and then run repeatedly on an embedded device with strict energy and response-time constraints.

Why the choice of platform matters

General-purpose CPUs give developers a flexible environment for running many kinds of programs. Vector instructions let them perform an operation on multiple data elements together. The paper describes graphics processing units as devices built around much more parallel execution, with software libraries that provide optimized operations for deep learning. Their parallelism and software support made them especially important for training. The authors also describe GPUs as an inference option when the application can accommodate their power needs. These are among the main tradeoffs the paper identifies in GPU and parallel computing.

The situation changes when computation moves close to a sensor. The paper uses edge computing to describe deployment near the source of the data. A nearby processor can respond without sending each input to a remote server and waiting for the result. It can also reduce the energy spent on transmission and keep raw data local. The available hardware may be powered by a battery or energy harvesting, making the power needs of a high-end GPU difficult to accommodate. The authors describe heterogeneous systems in which a general-purpose processor handles flexible tasks and a specialized circuit handles a selected part of the workload.

An FPGA, or field-programmable gate array, allows the designer to configure how hardware resources are connected and used. This is valuable for evaluating a circuit and for workloads that call for specialized arithmetic or memory paths. An ASIC, or application-specific integrated circuit, is designed for a particular purpose and offers scope to optimize its layout, storage, and communication in more detail. The authors associate these choices with different kinds of flexibility. A custom device can be adapted closely to a workload during design, while a general-purpose processor provides greater freedom in the software it runs. The paper's comparisons make those distinctions relevant to both deployment and development cost.

How network design changed the workload

The survey traces the shift from fully connected layers, in which every output receives every input, to convolutional layers built around local connections and weight sharing. It describes LeNet as an early example that used convolution and pooling for handwritten digit recognition. AlexNet extended the approach to ImageNet and illustrates an architectural decision made under a hardware constraint. Its developers split the network across GPUs to accommodate limited memory and restricted the points at which the devices exchanged data. The example joins storage capacity and communication cost in a single design decision.

Later networks changed the shape of the computation in other ways. VGG used stacks of smaller filters. GoogLeNet ran several branches at different scales and combined their outputs. Residual networks added paths that bypassed groups of layers, helping gradients reach earlier stages during training. Dense connections, which feed earlier activations into later layers by concatenation, created a different pattern of data dependencies. These designs matter for hardware because the number of layers says little about which tensors are alive at the same time, which can be reused, and which have to be combined across branches.

The paper places spiking neural networks in the same survey because they ask a different question about what the hardware should execute. A conventional layer computes numerical activations. A spiking neuron receives events, changes its internal state, and may emit an event of its own. Hardware that carries those events directly can organize its work around activity and timing. The authors treat the cost of encoding inputs, training spiking networks, and supporting their communication as part of the design problem. The comparison extends the survey beyond finding a faster implementation of an unchanged convolution.

How the survey extends earlier accounts

Capra and colleagues place their work in the tradition of Sze and colleagues' tutorial and survey on efficient deep neural network processing. They revisit the relationship between computations, memory, and dataflow while incorporating newer accelerators and giving spiking networks and adversarial robustness their own treatment. They describe earlier reviews with narrower concentrations, including a historical account of neuromorphic computing, an overview of accelerator architectures, and a detailed treatment of compression. Their aim is to connect topics that often appear in separate reviews.

That breadth shapes the kind of answer the paper can give. It establishes a vocabulary for comparing implementations and takes examples from work that optimizes different parts of a system. One study might change the way a matrix is stored. Another might change the arithmetic, the schedule, or the structure of the network. The survey's contribution is to trace how those decisions affect computation and memory under the conditions of each design.

The method, step by step

From a neuron to a layer of operations

The survey starts from the arithmetic a network needs. An artificial neuron takes input values, multiplies each by its associated weight, adds the products, and includes a bias. The bias shifts the result before the activation function is applied. The paper's verbal description of the weighted sum and its fully connected layer can be written using the same indexing.

O[cₒ] = ∑(cᵢ = 0 … Cᵢ − 1) W[cₒ, cᵢ] · I[cᵢ] + b[cₒ]

O is the vector of outputs before activation. I is the input vector, W is the matrix of weights, and b is the vector of biases. The input index cᵢ ranges from 0 through Cᵢ − 1, where Cᵢ is the input count. The output index cₒ ranges from 0 through Cₒ − 1, where Cₒ is the output count. The summation sign indicates that each product for a given output is added before the bias for that output is included.

A neuron then turns its weighted sum into an activation. The paper describes this with a general nonlinear function.

y = σ(z)

Here z is the weighted sum with its bias, σ is the activation function, and y is the value it produces. Applying a nonlinear function between layers lets a network express transformations beyond a composition of weighted sums and offsets. The choice of function also changes the implementation cost. The rectified linear unit, or ReLU, requires a comparison with zero.

y = max(0, x)

In this expression x is the value supplied to ReLU and y is its output. The max operation returns whichever is greater, 0 or x. The rule creates zero activations whenever its input is negative, a property the survey later connects to compression and zero skipping. The authors also discuss variants that retain a slope for negative inputs, where plain ReLU gives a constant output.

The sigmoid uses an exponential operation to bound a scalar output.

y = 1 / (1 + e⁻ˣ)

Here x is the input, y is the sigmoid output, and e is the base of the natural exponential. The exponent −x is the negative of the input. The constants in the fraction place y between 0 and 1. The survey contrasts the work needed for this function with the simple comparison used by ReLU.

The hyperbolic tangent produces both negative and positive outputs.

y = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ)

Here x is the input, y is the output, and e again denotes the base of the natural exponential. The numerator subtracts the two exponential terms, while the denominator adds them. The resulting range is between −1 and 1.

Softmax applies to a whole vector, as when a classifier produces a score for every class.

yᵢ = exp(xᵢ) / ∑(j = 0 … N − 1) exp(xⱼ)

The vector x contains the input scores, N is their count, and i identifies the output component being calculated. The index j runs over all scores in the sum. The exp function is the natural exponential, and yᵢ is the normalized score for component i. The denominator is shared across the outputs, whose values sum to 1.

The survey also describes batch normalization as a way to standardize internal activations and then let the network learn their scale and offset.

y = γ · (x − E[x]) / √(Var[x] + ε) + β

In this expression x denotes the input activations and y the output. E[x] is their mean and Var[x] their variance, so the square root without ε would give the standard deviation. The small term ε stabilizes the division. The trainable quantity γ rescales the standardized value, and β shifts it. The paper relates normalization to the work of training layers whose input distributions can otherwise change as the parameters are updated.

What convolution makes reusable

A fully connected layer can be executed as a matrix–vector product. Every output uses the entire input vector and a different set of weights. A convolutional layer also computes weighted sums, but the weights are organized into filters that slide across a spatial grid. A single filter can recognize the same pattern at different positions because its weights are shared there. Each output channel corresponds to a particular filter, and each input channel contributes to the sum for that filter. A feature map is the grid of values associated with a channel. Feature maps may describe an input image or intermediate features learned by the network.

Ofm[cₒ, hₒ, wₒ] = ∑(cᵢ = 0 … Cᵢ − 1) ∑(hₖ = 0 … Hₖ − 1) ∑(wₖ = 0 … Wₖ − 1) W[cᵢ, cₒ, hₖ, wₖ] · Ifm[cᵢ, S·hₒ + hₖ, S·wₒ + wₖ] + b[cₒ]

Ofm is the output feature-map tensor and Ifm the input feature-map tensor. The channel indices cₒ and cᵢ select an output and an input channel, with counts Cₒ and Cᵢ respectively. The indices hₒ and wₒ select the output row and column, within output height Hₒ and width Wₒ. The indices hₖ and wₖ select a position inside a kernel of height Hₖ and width Wₖ. W contains the filter weights and b holds the bias for each output channel. The stride S is the displacement between adjacent windows. The expressions that multiply hₒ and wₒ by S locate the start of the corresponding input window. The sums add the products across the kernel positions and input channels.

There are several ways to reuse data in that equation. Holding cₒ fixed and changing the output position uses the same filter again. Holding a window fixed and changing cₒ uses the same inputs for another filter. Moving to a neighboring window can retain inputs that lie in the overlap, with the amount of overlap set by the stride and kernel dimensions. These opportunities can exist simultaneously even when the hardware can exploit only some of them efficiently. How much capacity is available near the processing elements and which directions the interconnect can move values help determine what is practical.

Pooling uses windows too. It takes a statistic such as a maximum or an average over the values covered by a window. Pooling can reduce the spatial dimensions of later activations and their storage requirements. Since it uses no filter weights, it has no weight reuse. The survey examines the common case of windows that do not overlap, where little input reuse is available either. A chip organized around convolution therefore faces a different balance of arithmetic and bandwidth when it reaches pooling.

Capsule networks broaden the set of operations. The survey describes a capsule as a vector whose components encode properties of an entity and whose length represents its presence. A capsule's activation changes its length while preserving its direction.

y⃗ = (‖x⃗‖² / (1 + ‖x⃗‖²)) · (x⃗ / ‖x⃗‖)

The vector x⃗ is the input to the squash function and y⃗ is its output. The norm ‖x⃗‖ is the input vector's length. Its square is used in the scalar factor, which bounds the new length, and dividing x⃗ by its length gives the direction for a non-zero input. Capsule layers also use dynamic routing to adjust how strongly capsules in adjacent layers are connected. That adds work beyond the scalar operations of an ordinary convolution and helps explain why the paper discusses dedicated capsule accelerators and precision choices for routing.

How weights are learned and then used

In the supervised setting, a training example pairs an input with an expected output. The forward pass computes the network's prediction from its current parameters. A loss function assigns a value to the discrepancy between the prediction and the expected output. Back-propagation uses the chain rule to calculate how changes in the parameters affect that loss. Gradients propagate from the end of the network toward earlier layers, and an optimization rule uses them to update weights and biases.

θₜ₊₁ = θₜ − η · ∂L/∂θₜ

The symbol θ denotes a parameter, t is the current update index, and θₜ₊₁ is the resulting value. L is the loss, ∂L/∂θₜ is its partial derivative with respect to the parameter at the current update, and η is the learning rate that scales the step. The subtraction moves the parameter in the direction opposite to the local gradient. The survey uses this gradient-descent update to explain the procedure and names alternatives including momentum, Adam, and ADADELTA.

The paper also describes unsupervised learning, where the objective is to find structure in data without a supplied label for each example, and reinforcement learning, where an agent receives rewards tied to its actions. These settings introduce different sources of training information. The detailed explanation of forward and backward computation concerns the supervised case. For inference, the system reads the learned parameters, computes the forward operations, and produces its prediction. The survey gives procedures for the techniques it reviews and describes workloads used in earlier studies, with no shared training run underlying its hardware comparisons.

Training can group examples into batches, giving the machine another dimension along which to parallelize work. In a fully connected layer, the same weight matrix can serve a batch of input vectors and the resulting computation can be expressed as matrix multiplication. The speed and storage benefits depend on the batch size and memory capacity. In a service with a tight response deadline, collecting enough inputs to form a batch can add waiting time. The same number of inputs processed per unit of time can therefore correspond to different response times for an individual request.

Mapping a layer to hardware

The authors distinguish parallelism within a layer from parallelism across examples. Independent products within a layer can be assigned to different arithmetic units, with the appropriate sums brought together afterwards. Examples can also be assigned in parallel when they are available together. In the paper's architectural description, temporal designs use central control and feed processing elements through a shared memory structure. Spatial designs arrange processing elements in an array with local state and links that can pass values between elements. This distinction helps describe which kinds of reuse a mapping can put in hardware.

In a typical spatial accelerator, off-chip dynamic random-access memory, or DRAM, provides bulk storage. A global buffer on the chip holds a working set for the array. A processing element contains arithmetic circuitry and may have a small local register file. A network-on-chip carries inputs, weights, and sums to the proper destinations. One value can be broadcast to the whole array, sent to a subset of elements, or forwarded from one element to a neighbor. The placement of values and the schedule of transfers determine how much use each fetch can support.

The following sequence captures the mapping decisions the survey explains for a spatial accelerator. The workload and its intended use set the constraints at the beginning. The selected mapping then determines how values move as each tile is processed.

Mapping a neural network layer to a spatial accelerator

The steps in order.

Mapping a neural network layer to a spatial acceleratorStep 1: Identify layer operations and reusable values1. Identify layer operations and reusable valuesStep 2: Choose loops to execute in parallel2. Choose loops to execute in parallelStep 3: Tile tensors to fit available buffers3. Tile tensors to fit available buffersStep 4: Assign operations and data to processing elements4. Assign operations and data to processing elementsStep 5: Schedule operand transfers and partial sum accumulation5. Schedule operand transfers and partial sum accumulationStep 6: Evaluate traffic, utilization, latency, and energy6. Evaluate traffic, utilization, latency, and energy

In software, the layer's computation can be seen as nested loops over examples, channels, spatial positions, and filter positions. Spatial unrolling means that different iterations of a loop run on different processing elements at the same time. Loop reordering changes which values stay in use while an inner loop advances. For instance, executing many output positions while a filter weight remains in a register makes that weight available for repeated products. A dataflow combines the spatial assignment with the temporal order. The exact same convolution can therefore give rise to several schedules and communication patterns.

Tiling subdivides loop ranges so that the required portion of each tensor fits in an available buffer. An output tile might use a selected group of filters and a restricted region of the image. The inner loops compute on the resident data. The outer loops specify when to move on to another tile and what to fetch for it. Changing their order can keep a tensor resident while another changes. A schedule that gives more reuse to the input may require additional storage for unfinished results. The authors use that interaction to explain why buffer sizes and loop order belong in the same design decision.

Which values stay local

In weight-stationary dataflow, an element keeps a weight in its local register file and computes the products that use it as inputs arrive. An illustrative mapping assigns filter positions to the processing array. Partial sums pass between elements as the products are accumulated. One version broadcasts input values, which can leave some elements with nothing useful to do at particular steps. Another forwards input values between neighbors, exploiting the overlap of sliding windows. The same stationary data can thus coexist with different traffic and different array utilization.

One of the illustrated schedules needs a delay before a partial sum can be forwarded to the next row of elements.

delay = Wᵢ − Wₖ

Here delay counts scheduling timesteps, Wᵢ is the width of the input feature map, and Wₖ is the kernel width. The expression pertains to the paper's illustrated weight-stationary schedule. The survey describes the use of first-in, first-out buffers in nn-X to introduce such delays locally. The alternative in the illustrated schedule is to put the sums into the global buffer while they wait, adding traffic there.

Another weight-stationary mapping unrolls the input-channel and output-channel loops. It represents the main work as a matrix product and can use a systolic array, an arrangement that forwards data between processing elements in a coordinated rhythm. The paper gives the Tensor Processing Unit as an example in which weights reside in the elements, inputs advance in one direction, and accumulation occurs in the other. The datacenter workload mix helped motivate the emphasis on matrix multiplication, which also accommodates fully connected layers. In-Datacenter Performance Analysis of a Tensor Processing Unit

Output-stationary dataflow keeps a partial sum with its assigned accumulator as the needed weights and inputs arrive. That can save the repeated stores and loads otherwise incurred when a sum moves between the array and the global buffer. In a particular weight-stationary example, the survey counts the occasions on which a sum must be stored and reloaded.

reloads = (Hₖ − 1) · Cᵢ

Here reloads counts those store-and-reload occasions for the partial sum of an output pixel in the illustrated arrangement. Hₖ is the kernel height and Cᵢ the number of input channels. In the output-stationary alternative, local accumulation avoids this path while the element works on its assigned output. The incoming traffic still depends on how the hardware supplies weights and pixels.

ShiDianNao illustrates an output-stationary mapping across spatial positions. Different elements work on different output pixels, a weight can be broadcast across the array, and inputs can reach elements from a shared buffer or from neighbors. Origami uses a different parallel assignment and gives an accumulator to each output channel being computed in parallel. The comparison shows how a dataflow name identifies an operand's local lifetime while leaving open which dimensions of the calculation are spread over the array.

Row-stationary dataflow, used by Eyeriss, assigns the arithmetic for a row of a convolution to a processing element. A filter row stays local as the matching input values stream through. Processing elements can share weights along a row of the array, use inputs along diagonal paths, and combine partial sums vertically. The aim is to exploit weight reuse, input reuse, and local accumulation together. How that logical arrangement fits a physical array depends on the layer's dimensions and the resources supplied by the hardware.

The survey also discusses designs with no local reuse in the processing elements. The choice frees area that can be used for a larger shared buffer, since the small register files have a higher area cost per bit than denser storage. The price is more traffic between the buffer and the array. This makes capacity and energy interact. A design may hold more data on the chip overall while moving individual values farther on the chip. Which effect matters most depends on what that capacity displaces and how often the processing elements need the same data.

Using libraries or searching for a mapping

On CPUs and GPUs, optimized linear algebra libraries supply matrix operations. Fully connected layers fit them directly. A convolution accesses a window whose rows may be separated in memory, even when each row itself is stored contiguously. Convolution lowering rearranges the filters as matrix rows or columns and lays out each input window so a matrix multiplication computes the desired dot products. The arrangement can repeat an input at each window in which it participates. The strong performance of the matrix routine therefore comes with a cost in temporary storage and data preparation.

The paper compares this approach with other ways to organize convolution arithmetic. Strassen's matrix multiplication uses fewer multiplications by partitioning the matrices and performing additional additions. A fast Fourier transform changes convolution into element-wise products in the frequency domain and incurs the work of transforming the operands and result. The paper identifies larger kernels and unit stride as the favorable case in the work it reviews. The description identifies small kernels as a case where Winograd’s algorithm works well. Direct convolution can also be optimized by rearranging data and making better use of vector instructions. The task is to balance the work of the arithmetic itself against the transformations and memory accesses required to get there.

For custom accelerators, the design space grows when the engineer can choose buffer sizes, array dimensions, mappings, and tile sizes together. The authors describe methods that start from a fixed on-chip capacity and search for schedules that minimize off-chip traffic. In one optimization, a tensor whose address stays the same throughout an inner loop can be retained across the loop, moving its load and store outside it. A multilevel method applies blocking to neighboring levels of memory and revisits earlier choices as it adds levels. SmartShuttle adapts the loop order and tile sizes to layers with different shapes. All of these approaches use the relationship between an index and a memory access to avoid fetching data again unnecessarily.

Tools for design space exploration can ask more than which schedule uses the fewest off-chip accesses. NNest searches a parameterized accelerator design for tradeoffs among resource choices. MAESTRO estimates properties such as execution time, energy, and communication for a mapping. Timeloop constructs a space of mappings for a described architecture and workload and evaluates them with cost estimates. MAGNet also addresses accelerator generation, mapping, and tuning. The designer can use these tools to look for Pareto-optimal choices, meaning choices for which improving one objective within the space considered requires giving up ground on another.

Hardware-aware neural architecture search changes what the network computes as well as how it is mapped. Its objective can include predictive accuracy and a hardware quantity such as latency or energy. MnasNet includes latency measured on mobile phones. APNAS uses analytical cycle estimates to avoid running every candidate on hardware. HotNAS begins from trained networks and includes compression in the search for a suitable combination of hardware and network. Approaches based on shared weights or partial training reduce the cost of exploring possible architectures. The survey presents these as different ways to make an otherwise expensive search tractable, with different relationships between what is estimated during search and what is measured on the target device.

Reducing precision and changing the computation

Quantization replaces values drawn from a large set with values from a smaller one. For a hardware designer, this can shrink the storage and transfers needed for weights and activations, and it can make the arithmetic cheaper. Its effect on the network depends on which values are changed, how the smaller set is spaced, and whether training or fine-tuning compensates for the change. The paper defines the numerical error for an individual value as follows.

e_q = x_q − x

The symbol x is the original value, x_q is the value selected by the quantizer, and e_q is the signed error. A small error by this definition describes one replacement. Classification accuracy depends on how errors propagate through the network and affect its decisions.

The survey contrasts floating-point representation with fixed-point representation. Its account of a normal 32-bit floating-point value uses a sign, an exponent field, and a significand.

v = (−1)ˢ · m · 2^(e − 127)

Here v is the represented value, s is its sign bit, m is the significand, and e is the stored exponent. The factor involving −1 sets the sign. The base is 2 and the exponent bias is 127. The source describes an exponent field of 8 bits and a stored mantissa field of 23 bits. The expression concerns the ordinary finite normalized representation.

In the survey's signed fixed-point description, the format defines how much space is allocated to the integer and fractional parts.

v ∈ [−2^(Nᵢ − 1), 2^(Nᵢ − 1) − 2^(−Nꜰ)]

The symbol v is a representable value and ∈ means it lies within the interval shown. Nᵢ is the number of integer bits including the sign and Nꜰ is the number of fractional bits in this notation. The left endpoint is the minimum and the right endpoint is the maximum. The formula gives the endpoints for the two's-complement representation the paper discusses.

step = 2^(−Nꜰ)

Here step is the spacing between successive fixed-point values and Nꜰ is again the fractional bit count. The spacing is uniform at a given scale. Dynamic fixed point allows the scale to vary, which matters when different layers or tensors occupy different numerical ranges.

Weights can be quantized after training and then fine-tuned. Activations depend on the input, so their quantization has to be applied during execution. Gradients form another class of values, used during training, where quantization affects the updates through which the network learns. The paper discusses flexible-bitwidth hardware as a way to exploit precision settings that differ by layer or operand. A bit-serial unit performs arithmetic in stages according to the number of bits it needs. A spatial design such as Bit Fusion instead combines bit-level processing resources to suit the requested width. A precision policy yields an execution benefit only to the extent that the target can take advantage of it.

The most aggressive schemes restrict weights to a tiny set. BinaryConnect uses binary weights, and Binary Weight Nets represent a filter using binary entries and a scale.

W ≈ α · B

W is the original filter, B is its binary approximation before scaling, and α is a scale factor. The approximation symbol indicates that the scaled binary filter represents the original values with error. The paper describes using full-precision inputs with binary weights in this scheme and scaling the result. Ternary Weight Nets allow zero as well as the two signed binary values. Other approaches reduce activation precision too, including the low-bitwidth approach in DoReFa-Net.

Logarithmic quantization uses uneven intervals. The survey illustrates how approximating activations by powers of the base permits some multiplication work to be implemented with shifts.

x̃ᵢ = Int(log₂(xᵢ))

In this formula xᵢ is the positive activation value at index i and x̃ᵢ is the integer exponent selected for it. The log₂ function takes its logarithm to base 2, and Int denotes the conversion to an integer. The formula shows the logarithm for a positive value. The next expression illustrates the resulting dot product.

w · x = ∑(i = 0 … N) wᵢ·xᵢ ≈ ∑(i = 0 … N) wᵢ·2^(x̃ᵢ) = ∑(i = 0 … N) (wᵢ ≪ x̃ᵢ)

The vectors w and x contain weights and activations. Their components wᵢ and xᵢ are indexed by i, and N is the upper summation index in the paper's notation. The dot on the left denotes the dot product. The approximation replaces the activation with the power specified by x̃ᵢ. The final notation uses ≪ for the corresponding bit shift, with the shift direction governed by the sign of the exponent for the representation in use. The surveyed accelerators use shifter circuitry to exploit this form of arithmetic. The paper also discusses vector quantization, where clustering groups weights and the cluster centroids serve as the values used to represent them.

Pruning, encoding, and skipping work

Pruning sets selected weights to zero or removes larger units from the network. The paper describes early methods that estimated how much a weight mattered to the training loss, as well as magnitude-based pruning followed by fine-tuning. Removing whole neurons or channels changes the shapes of the layers. Removing scattered weights leaves the original shape with zeros at selected coordinates. The former can simplify the regular computation. The latter can create more opportunities to skip individual products, with a burden on the hardware to find and schedule the surviving work.

Other compression techniques begin with the structure of the network. Smaller sequential filters can cover the same spatial extent as a larger filter with fewer weights in the paper's example. Depthwise convolution applies a filter to each channel separately, followed in MobileNet by a pointwise operation that combines channels. Tensor decomposition represents weights by smaller factors. Knowledge distillation takes a different route. The surveyed procedures use predictions from a trained teacher to create training targets for a smaller student, transferring aspects of its behavior through data instead of copying the teacher's parameters.

Sparse encodings store the values worth processing along with information about where they belong. In compressed sparse row, or CSR, the non-zero values are stored in row order, with their column indices and a list marking where each row begins. The survey accounts separately for the data, the indices, and the row offsets.

bits_CSR = I · (N_b · (1 − Sp) + N_i · (1 − Sp)) + (H + 1) · N_o

Here bits_CSR is the number of bits used, I is the number of entries in the original matrix, and Sp is the sparse fraction, expressed on the scale required by 1 − Sp. The widths N_b, N_i, and N_o are measured in bits and apply to a value, a column index, and a row offset respectively. H is the matrix height. The offset term includes the final boundary after the last row.

Compressed sparse column, or CSC, stores values by column. It uses row indices for positions within columns and a column-offset array.

bits_CSC = I · (N_b · (1 − Sp) + N_i · (1 − Sp)) + (W + 1) · N_o

Here bits_CSC is the resulting bit count. I is the original number of entries and Sp is the sparse fraction. N_b is the value width, N_i the row-index width, and N_o the column-offset width. W is the original matrix width, so W + 1 counts the column offsets including the final boundary.

The format the authors call compressed image size, or CIS, uses a mask marking which positions contain non-zero values. It then stores those values in a list.

bits_CIS = I · (N_b · (1 − Sp) + n)

Here bits_CIS is the storage cost in bits, I is the original number of entries, N_b is the bitwidth of a value, and Sp is the sparse fraction. The quantity n is the mask cost per entry, typically 1 bit in the scheme described. The mask term covers every position, and the value term covers the surviving entries.

Run-length coding is effective when zeros occur in consecutive runs that can be represented compactly. Huffman coding offers another way to reduce the size of stored data, with greater complexity in compression and decompression. The survey treats storage and execution as related design choices. A compact encoding can help fit a tensor into faster on-chip memory. To use it for acceleration, the hardware must also determine where each useful value goes and have enough independent work to keep the arithmetic units busy. Some architectures clock-gate unused processing elements to save power. Others rearrange operations so that removing zero products can shorten execution. These are distinct ways of benefiting from the same sparse values.

Approximate computing extends the choice beyond precision and exact zeros. The paper surveys approximate multipliers, approximate memories, and ways to select approximations for individual layers or train a network with the intended approximation in mind. These techniques can change both the hardware cost and the numerical result. Skipping a product that contains an exact zero preserves its contribution to the sum, while skipping a near-zero product deliberately drops that contribution. The authors connect such choices to analyses of how much error an application can tolerate.

Event-driven computation and its training procedure

In a spiking neural network, an input event has a weight associated with its connection. The event changes the receiving neuron's internal state, called its membrane potential. If the potential passes a threshold, the neuron sends a spike and its potential is reset. A leaky integrate-and-fire neuron also loses some of its accumulated potential over time between events. The survey presents this as a compromise between computational simplicity and a more detailed account of biological neurons.

Information can be encoded in the average spike rate over an observation interval, the interval between consecutive spikes, or the delay to the first spike. Those schemes use different aspects of a stream of events and make different demands on how long a receiver must observe it. The survey mentions event-based cameras as a possible source of data suited to this style of computation. Their output represents changes as events. The hardware can then work with the events carried by that source.

The authors cover several training routes. Spike-time-dependent plasticity adjusts a connection using the timing relationship between spikes arriving at a neuron and spikes it emits. For supervised learning, the paper identifies the discontinuous nature of spikes as a difficulty for ordinary back-propagation. One route uses approximate derivatives so that training can use the temporal information in the spike trains. Another trains a conventional network first and converts it to a spiking network. A hybrid can continue training after conversion. The authors also describe the use of average pooling where max pooling is incompatible with a rate-based conversion.

Neuromorphic platforms embody different hardware responses to these needs. SpiNNaker implements event-driven computation and communication using processor cores. TrueNorth combines local memory and neurosynaptic cores with spike routing across the device. Loihi provides asynchronous processing and support for learning rules. BrainScaleS uses analog neurons with digital communication. These examples show why the placement of memory and the routing of events remain central even when the primitive being accelerated has changed.

Experiments and results

Reading the evidence in a survey

The numerical evidence comes from cited measurements, device specifications, and worked analyses with stated assumptions. Each has a different baseline. A quantization study can compare two ways to represent the same network with a floating-point reference. A hardware specification can describe the bandwidth of a memory configuration. A worked layer analysis can ask how much bandwidth would be needed if an accelerator were continuously busy. The survey places these side by side to explain design tradeoffs. The quantities retain the scope of the study or example from which they come.

The paper discusses public datasets that researchers use to make work comparable. MNIST contains 70,000 grayscale digit images in 10 classes, with 60,000 used for training and the rest for testing. CIFAR-10 and CIFAR-100 each have 60,000 color images and use 50,000 for training. They differ in whether the images are classified into 10 or 100 categories. The paper's ImageNet challenge description gives 1.3M training images, 100,000 test images, and 50,000 validation images across 1000 classes. These are benchmark descriptions. A specific result still needs its own dataset, split, and metric when the source identifies them.

The authors explain Top-1 accuracy as the proportion of cases where the highest-scoring class is correct. Top-5 accuracy counts the example as correct when the true class appears among the 5 highest-scoring classes. Those scores tell the reader about predictive performance on a specific task and data distribution. The survey also discusses ObjectNet, which uses a test set that varies backgrounds, rotations, and frequently viewpoints. It reports a 40-45% performance drop for systems that performed strongly on their usual datasets. The survey cites this as an example of how much an evaluation can change when familiar regularities in the images are disrupted. Its benchmark discussion connects predictive accuracy with workload and architecture measurements that explain the work required to achieve it. Evaluation and benchmarks

The framework comparison explains where some of those measurements and workload descriptions come from. TensorFlow and PyTorch offer ways to express a network and execute it on supported hardware. Caffe is discussed for convolutional workloads and its collection of trained networks. ONNX is a portable representation that can make a network available to another execution environment. The paper places these tools in the design process because a developer can look at where execution time is spent before deciding which operations deserve hardware support. An architecture comparison can depend on the quality of that software as well as on the circuit.

Memory and throughput

The paper cites energy figures at a 45 nm process node. The reference is a 32-bit addition that consumes 0.9 pJ. The chart expresses each memory-access cost as the reported multiple of this reference. It is an operation-level comparison with no dataset or split. The lower bar is the more energy-efficient memory access under these assumptions.

SRAM and DRAM access energy relative to 32-bit addition at 45 nm

The SRAM access costs less energy than the DRAM access under the cited process assumptions.

SRAM and DRAM access energy relative to 32-bit addition at 45 nmSRAM access (this paper): 5.5SRAM access (this paper)5.5DRAM access: 711DRAM access711
The numbers
System or setting× 32-bit adder energy
SRAM access (this paper)5.5
DRAM access711

The authors use the DRAM figure in a worked example with a 1G fully connected layer running at 30 fps. For the traffic assumptions in that example, they quote an access cost of 640 pJ and a resulting requirement of 19.2 W. The example exposes how a large sequence of costly accesses can exceed the power budget of a mobile device. It is a calculation for a specified access scenario, distinct from a measured power trace for a complete application.

Their AlexNet example takes throughput as a starting condition and asks what different layers would demand from memory. It assumes a device capable of 100 Gops/s running at 100% efficiency, with 16-bit weights and activations and no memory constraint in the calculation. The required bandwidth varies by layer, and the authors identify fully connected layers and max pooling as especially demanding in the example. Those layers offer fewer ways to reuse the values being moved. The comparison makes clear why throughput measured at the arithmetic units can be hard to sustain at the input and output of a layer.

The Tensor Processing Unit case adds a workload-selection result. The survey reports that convolutional networks accounted for 5% of the datacenter applications considered in the cited work. Within that workload, an emphasis on fully connected layers and matrix multiplication followed from what the accelerator would actually be asked to run. The percentage describes that application mix. Its importance to the paper lies in how the designers used workload evidence to select a mapping and an arithmetic core.

The survey also recounts results for changes to a memory system rather than to the network. In the multi-GPU extension of vDNN it reviews, a prefetching algorithm allowed a 60% increase in mini-batch size. The reported quantity is the change in the batch that the implementation could accommodate. It describes capacity for training under that setup and does not by itself quantify the time or energy needed to reach a given accuracy. This distinction matters because a larger batch offers more opportunities to reuse weights while increasing the amount of activation data the system must manage at once.

Precision, compression, and accuracy

The VGG16 comparison cited in the quantization section holds the stated precision at 3-bit and changes the spacing of the representable values. The reported quantity is accuracy loss relative to the floating-point baseline. The survey does not specify the dataset split or whether the loss refers to Top-1 or Top-5 accuracy for this comparison. The chart uses the loss metric as the paper reports it.

VGG16 accuracy loss with linear and logarithmic 3-bit quantization

Logarithmic quantization retains more of the floating-point baseline accuracy at the stated precision.

VGG16 accuracy loss with linear and logarithmic 3-bit quantizationLinear quantization: 6.2Linear quantization6.2Logarithmic quantization (this paper): 0.6Logarithmic quantization (this paper)0.6
The numbers
System or settingaccuracy loss %
Linear quantization6.2
Logarithmic quantization (this paper)0.6

Other results show how much depends on the procedure and hardware. Ristretto uses statistics from weights and activations to select scales and bitwidths, then fine-tunes the weights. According to the survey, the cited approach runs inference at 8-bit precision with an accuracy loss below 1% for AlexNet, SqueezeNet, and GoogLeNet. A separate speech-recognition implementation uses 8-bit fixed-point arithmetic and Intel SSSE3 vector instructions and reports a 7.6x speed-up over its floating-point baseline. One result concerns the preservation of accuracy after a representation change. The other measures the execution advantage of a particular low-precision implementation.

The paper provides storage results as well. The magnitude-based pruning example for AlexNet reports a 10x reduction in the number of parameters after selecting weights and fine-tuning the remainder. SqueezeNet is described as reaching AlexNet-level accuracy with 50x fewer parameters by making different architectural choices. These results count parameters. Turning a reduction in that count into a speed or energy gain requires that the new layer shapes or compressed tensors interact favorably with the target's memory and arithmetic units.

Within the sparse acceleration examples, EIE uses compressed sparse weights to avoid use of DRAM for the cited computation, with a reported energy saving of 120x associated with that change. The near-zero skipping design the authors discuss reports a 1.92x reduction in computation for LeNet5 and describes the accuracy loss as negligible. That second number measures how much computation was removed in the cited setup. The execution benefit also depends on the cost of deciding which products to skip and the ability to assign the remaining work.

What the hardware metrics count

The survey separates power from energy efficiency. Power is the rate of energy use and helps determine whether a device fits its operating budget. Energy per MAC assesses consumption relative to a unit of arithmetic. The authors emphasize accounting for off-chip memory in power figures, because the cost otherwise disappears at the boundary of the measurement while remaining part of execution. A device that finishes faster may also spend a different amount of energy per inference, depending on how much power it uses while running.

Throughput measures the rate of completed work, while latency measures the time it takes to complete a request. The paper gives the usual counting convention for reporting arithmetic rates.

1 GMAC/s ≃ 2 Gop/s

GMAC/s is billions of multiply-and-accumulate operations per second. Gop/s is billions of operations per second. The approximate equivalence counts the multiply and the accumulation separately. Even with this convention established, comparisons must account for whether a result describes the peak arithmetic rate or the rate achieved on a layer, and whether it counts nominal dense operations or only effective operations.

Chip area affects integration and cost. It is also tied to the process node and the amount and type of memory supplied on-chip. An accelerator may use more area to hold a larger working set and save energy otherwise spent off-chip. Accuracy, numerical precision, and flexibility across layer shapes add further dimensions. The survey accordingly treats the result of an accelerator comparison as a description of a workload and operating condition, with the metric defining which aspect of that result is being compared.

What the ablations show

Capra and colleagues report no ablation of a system of their own, and the closest evidence comes from comparisons of numerical encodings, memory organizations, and dataflows drawn from the surveyed studies and worked examples.

What changes when the bitwidth stays fixed

The linear and logarithmic VGG16 results provide a comparatively direct test of one design choice. Both settings use the stated 3-bit precision, and their losses are reported against a floating-point reference. The smaller loss with logarithmic quantization supports the authors' explanation that the placement of quantization levels can matter as much as the distinction between broad categories of precision. Uneven spacing can represent values differently across the numerical range. The result establishes the advantage of that setting for the cited comparison. The accompanying hardware examples show why the same representation can change implementation cost by making shifts available in place of general multiplication.

The Ristretto example involves several choices together. It selects precision and scaling parameters from the observed data, and it fine-tunes the weights. Its reported loss describes the outcome of that combined procedure. The survey gives no isolated measurement for the statistical analysis or the fine-tuning. An engineer reading the result can see that the precision used at execution was compatible with the reported accuracy under that procedure, while the attribution of that accuracy to individual steps remains open.

What changes when the storage format changes

The sparse-format analysis compares the encoded bit sizes against the original size at varying sparsity. It uses filter shapes from AlexNet's Conv 4 and Conv 1 as example cases. Conv 4 supplies a 3 × 3 × 384 filter example with 8-bit values, and Conv 1 supplies an 11 × 11 × 3 example with 32-bit values. The paper finds that the CIS mask representation performs better across almost the entire illustrated sparsity range than the row- and column-compressed formats. The equations explain how that can happen. CIS pays a mask cost for every position, while CSR and CSC pay for an index per non-zero entry and for offsets tied to the matrix dimensions.

That comparison concerns the number of stored bits. The performance question changes when an accelerator needs to retrieve a particular row or column, distribute values to several processing elements, or gather contributions to the same output. CSR and CSC carry indexing information suited to the corresponding access patterns. Run-length coding benefits from zeros occurring together. A sparsity percentage therefore describes one property of a tensor, while its distribution and the order in which the hardware consumes it govern how well a specific representation works.

The studied accelerators give examples of what can happen after compression. Cnvlutin emphasizes activation sparsity, Cambricon-X emphasizes weight sparsity, and SCNN handles both in convolution. The authors describe utilization in SCNN as strong on convolutional work and identify fully connected layers as a bottleneck where the reuse is weaker. Eyeriss can gate inactive arithmetic for zeros, reducing power while a highly sparse workload may leave the array underused. ZeNA addresses uneven work distribution explicitly. These comparisons support the distinction between storing fewer values, doing fewer products, and finishing earlier.

What changes when the mapping changes

The paper's weight-stationary examples retain the same purpose and change how input values move. Broadcasting supplies the same input to the array together. Forwarding supplies a previously received value to a neighboring element as the computation advances. In the illustrated schedules, these choices affect when work reaches each element and whether partial sums need buffering between rows. The comparison localizes the tradeoff in timing and data transfers while keeping the underlying convolution intact.

The output-stationary examples start from a different target for reuse. Partial sums stay with an accumulator, leaving the designer to supply input and weight data efficiently. Comparing them with row-stationary mappings shows that the local lifetime of a single operand is only one part of the story. The arrangement of the row-stationary array makes it possible to reuse filters and input values while accumulating parts of the same output along a defined direction. The survey interprets these mappings by following the values as they move. It gives a mechanism for understanding why a change might help, with performance still conditional on where the layer dimensions fit and how much memory the design has.

The mapping results cited for mRNA illustrate the distinction at the level of a design tool. In the reported experiments, scheduling more of the work onto available elements was associated with shorter runtimes. Reusing data and distributing it by broadcast or multicast reduced energy costs. A fast schedule and an energy-saving schedule can overlap, yet the mechanisms affect different resources. The tool's evidence is specific to the reconfigurable target it explores. The survey uses it to show what a mapping evaluation can reveal beyond the name of the dataflow.

Limitations

Limits the authors identify

The authors explicitly caution that hardware comparisons depend on the conditions under which they are made and on the neutrality of the chosen benchmark. A processor's throughput depends on frequency and bandwidth, and the device area depends on fabrication technology and memory capacity. Even within a network, several layers can have very different requirements. These conditions limit the meaning of an overall ranking across processors, programmable logic, and custom accelerators. The paper's focus on inference reflects the range of available examples and its emphasis on edge deployment.

The survey identifies practical limits on precision reduction and sparsity. Training can be sensitive to changes in the values used for parameter updates, and layers differ in how much approximation they can tolerate. Compression can introduce irregular accesses, and skipping zeros can leave processing elements with uneven work. Approximate memories or arithmetic depend on the application's resilience to error. The authors describe approximation as suitable where the use case permits some quality loss and discuss resilience analyses as a way to assess that condition.

For spiking networks, the authors identify uncertainty about how to achieve the accuracy of established conventional networks through direct supervised training. Converting a trained network can entail a decrease in accuracy. Some operations also have to change during a rate-based conversion, as in the use of average pooling in place of max pooling. The hardware examples establish ways to support event-driven activity, with the outcome still depending on encoding, training, and the application.

The security discussion identifies another tradeoff. A defense can improve performance against a class of deliberately manipulated inputs while reducing accuracy on clean inputs. Adversarial training, which incorporates such inputs into the training process, can add substantial training cost. The authors describe data provenance checks, preprocessing, randomized smoothing, and input detectors among the defensive approaches. Robustness and its overhead therefore belong among the properties of a deployed network and accelerator, alongside accuracy on the ordinary test set.

The future directions are also tied to explicit constraints. The authors identify limits on bandwidth between storage and arithmetic, difficulties in continuing conventional chip scaling, and a lack of a unified high-level toolchain for programming AI accelerators. They discuss high-bandwidth memory, computation in memory, and emerging storage technologies as avenues under investigation. Their discussion of local learning at the edge is motivated by responsiveness and privacy. The paper presents it as a future direction in a setting where most edge devices in its account performed inference.

Limits visible in the evidence

The results come from studies with different objectives and scopes. A multiplier measurement, a layer execution, and a complete inference report different slices of the cost. The quantization accuracy comparison and the memory access comparison are informative within their stated baselines. They offer no common experimental denominator for comparing the size of the gains. The paper also gives selected literature results for which the split, exact accuracy metric, or implementation conditions are less fully described. Those figures support narrower conclusions than a benchmark with a single shared measurement protocol would support.

The treatment of memory is detailed, but the conclusions from particular layer analyses depend on their assumptions. A fully connected layer evaluated for a single input has a different opportunity to reuse its weights from one processing a batch. Pooling with non-overlapping windows has a different access pattern from pooling with overlap. A count of bytes that fit in a buffer does not capture how the interconnect delivers them or how the memory serves concurrent requests. The paper's calculations help explain these dependencies. Applying them to a device requires its actual layer shapes, access patterns, and system boundaries.

Similarly, analytical exploration and hardware measurement answer different questions. A cost estimator can make it practical to score many designs before building them. Its ranking depends on how it represents the execution, memory, and communication of the candidates. A latency measurement on the target hardware includes effects of the implementation at the chosen setting, while still saying little about energy or accuracy on its own. The survey gives examples of both approaches, with no shared comparison of estimator accuracy across the tools it reviews.

The workload examples are especially rich for image recognition and convolution. The paper also discusses fully connected, recurrent, capsule, and spiking workloads, but the depth of quantitative evidence varies. The AlexNet bandwidth example says where one familiar network would put pressure on an assumed device. The datacenter TPU case shows how another mix of network types led designers to a different emphasis. A reader can generalize the engineering question each example asks, while keeping its answer attached to the workload under discussion.

Finally, the paper is a survey of developments available at the time. Its device descriptions and framework comparisons document the choices and constraints the authors had in view. Its discussions of emerging memory, edge learning, and programming tools lay out possible responses to those constraints. Their eventual effectiveness would require measurements from implementations built for those purposes.

What came after

The later citing work takes up energy consumption during GPU training. This moves the emphasis from the survey's detailed treatment of inference dataflows to the cost of the process that produces the trained network. The connection is strongest in the benchmarking question. Capra and colleagues treat training time and energy efficiency as distinct metrics, and they describe GPUs as a primary platform for training. Zeus makes GPU training energy the quantity to understand and optimize. The citation connects that question to the broader survey, while the title establishes the scope of the later study. Zeus: Understanding and Optimizing GPU Energy Consumption of DNN Training

Cite

Cite as Maurizio Capra, Beatrice Bussolino, Alberto Marchisio, Guido Masera, Maurizio Martina and Muhammad Shafique. 2020. Hardware and Software Optimizations for Accelerating Deep Neural Networks: Survey of Current Trends, Challenges, and the Road Ahead. arXiv:2012.11233.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/access.2020.3039858 · arXiv 2012.11233

@misc{capra2020hardware,
  title = {{Hardware and Software Optimizations for Accelerating Deep Neural Networks: Survey of Current Trends, Challenges, and the Road Ahead}},
  author = {Maurizio Capra, Beatrice Bussolino, Alberto Marchisio, Guido Masera, Maurizio Martina and Muhammad Shafique},
  year = {2020},
  doi = {10.1109/access.2020.3039858},
  eprint = {2012.11233},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/access.2020.3039858}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/capra-2020-hardware-software-optimizations-accelerating-deep/