Download PDF

Modeling and Analysis for Efficient Hardware Mapping of Neural Network Algorithms

Publication date: 2024-01-10

Author:

Colleman, Steven
Verhelst, Marian

Abstract:

Machine learning (ML) algorithms are gaining more and more importance nowadays in the area of data processing: data such as images, sound or texts can all be analyzed or improved using ML algorithms. This thesis focuses on the optimization and analysis of hardware design for neural networks, a very popular and efficient ML algorithm. A first important problem to solve is the off-chip communication, which requires a lot of energy and latency. Traditional hardware architectures make use of layer-by-layer evaluations. Chapter 3 contains an FPGA implementation of a depth-first (= layer-fused) scheduling, reducing the number of data items to be transfered between the chip and the off-chip memory. The data transfers can be reduced with a factor of up to 81x, based on the used network. The hardware architecture is also made flexible such that varying layer types and dimensions can be executed efficiently on FPGA without the need of reprogramming the FPGA. However, we see that in practice this implementation is still too slow for time critical operations, specifically for pixel processing tasks. Improving the hardware further will not lead to fundamental differences anymore as the utilisation is already very high. This means that we have an algorithmic bottleneck: the number of computations should be decreased to improve the latency to process one image. This can be done by using dynamic spatial sparsity networks as done in Chapter 4. Redundant pixels that do not matter a lot to the outcome of the classification are not handled, reducing the number of computations without losing a lot of accuracy. On human pose estimation and classification tasks with ResNet-based networks, we showed a speedup of x2.28/x1.91 for an accuracy drop of 0.87%/1.6% respectively, whereas GPUs are unable to exploit spatially dynamic execution networks. For a human pose estimation network with MobileNetV2-based blocks we demonstrated x2.31 speedup, which is comparable with GPU, for only 0.33% accuracy loss. The hardware architecture optimizations to deal with the flexibility in this chapter are found manually. The next chapters extend an existing hardware estimation framework, ZigZag, to be able to deal with more flexibility and to perform hardware optimization studies in a more systematic way. This flexibility is required to derive optimal execution schedules across different layer types, execution modes (layer-wise and layer-fused) and multi-core constellations. Chapter 5 presents COAC, a framework to find the optimal set of dataflows to minimize latency/energy for end-to-end inference, as well as resource overhead that comes from the introduced flexibility. Three required architecture extensions lead to this resource overhead. COAC makes use of a reshuffling buffer to reshuffle data in between layers that need another dataflow for optimal execution. However, the solution with the reshuffling buffer makes the hardware specific for a given set of dataflows. Therefore, another solution is presented in Chapter 6. This solution makes use of multi-banked memories. Chapter 6 proposes CMDS, a framework enabling cross-layer memory-aware dataflow optimization to minimize execution energy/latency for end-to-end NN inference. CMDS can exploit the parallelism of multi-banked memories to achieve low-cost data reshuffling with increased dataflow flexibility and is able to co-optimize the data layout together with the dataflow options to achieve end-to-end inference energy/latency minimization. The biggest drawback of COAC and CMDS is that these frameworks are limited to layer-by-layer, single-core architectures. Therefore, Chapter 7 proposes Stream, a hardware estimation framework that can handle layer-fused multi-core schedulings. Stream optimizes execution schedules towards minimal energy, minimal latency and/or minimal memory footprint for constrained edge devices. We demonstrated that high-level architectural decisions greatly impact hardware efficiency under the fine-grained scheduling paradigm, reducing energy-delay-product from 2.4x for single-core architectures to 30x for heterogeneous multi-core architectures compared to the traditional scheduling at layer granularity. Stream is also extended to deal with the additional layer types that are needed to simulate transformer networks. A detailed analysis about the optimal scheduling for these transformer networks will be shown. Machine learning applications will become more and more dominant in future to improve the quality of life. For more and more applications, specialized hardware will be needed to compute the machine learning algorithms, like for example in embedded devices such as hearing aids. This thesis brings solutions to optimize this hardware design for modern neural networks.