Optimizing Embedded Vision Efficiency across the Hardware-dataflow-algorithm Stack
Author:
Abstract:
Artificial Intelligence (AI) systems have been shown to be capable of performing complex tasks like (semi-)autonomous driving, image enhancement or creation, and winning strategy games such as Chess and even Go. All these example of AI are powered by a particularly powerful technique: neural networks (NN). However, processing neural networks is very demanding of the hardware executing them. Yet, at the same time, they should run on resource-constrained devices close to the data source in order to avoid the excessive latency caused by transmitting the data to a remote compute infrastructure. To break this opposition, optimizations should be performed with three levels of abstraction in mind: the algorithm level, the dataflow level, and the hardware level. This thesis therefore presents multiple optimization techniques, covering all these abstraction levels. Targeted at the algorithm level, chapter 3 presents Hierarchical Cascading. This technique extends the single-stage or two-stage classifier setup to a multi-stage setup. From the first to the last stage, classification decision boundaries are both added and refined so that more and more classes are supported, and the accuracy of already supported classes increases. Depending on the inputs' statistical characteristics, this setup allows to classify inputs that belong to common classes and are easy to classify at the early inexpensive stages, without ever activating the later expensive stages. In contrast, inputs belonging to classes that appear rarely, or are hard to classify because they are close to the decision boundary, can still be handled by the expensive accurate stages. Experiments show that this setup outperforms a single-stage or two-stage setup with up to four or two orders of magnitude, respectively. Chapters 4 and 5 present techniques to decrease the number of data transfers between the specialized NN accelerator chip and its paired external memory. This is important as these transfers are a major cause of energy usage, and often also increase the total execution latency. Each of the two chapters targets another culprit of the data transfers. Chapters 4 targets the large models of neural networks, introducing a compressionflow that combines Singular Value Decomposition, retraining, pruning and weight clustering into a superior compression flow that outperforms the individual compression techniques up to 5×. Chapter 5 instead targets the reduction of the number of external data transfers caused by excessive movement of intermediate data. To optimize this, it introduces the depth-first dataflow as an alternative to the traditional layer-by-layer one, which is shown to suffer from an unsatisfactory yet fundamental lower bound regarding external data transfers. The depth-first dataflow, further enhanced by tiling, outperforms this bound by up to two orders of magnitude for a given on-chip memory capacity or, vice versa, can achieve an equal number of external data transfers with up to four orders of magnitude smaller on-chip memories. Chapter 6 continues this thesis with DepFiN, an accelerator chip that is designed to be compatible with the introduced depth-first dataflow. DepFiN furthermore has a processing core that is dynamically reconfigurable into a mode that efficiently executes depthwise+pointwise layer pairs. In this way, the benefit of this algorithmic optimization is efficaciously brought down to the hardware level. The DepFiN accelerator chip is fully designed and manufactured in a 12nm silicon technology, and its measurements showed a peak core efficiency of up to 20 TOPS/W at 0.5V with 75% sparse features and weights, or 5 TOPS/W without any sparsity. Most of this efficiency, 4.3 TOPS/W, is retained for depthwise-pointwise layer pairs due to the reconfigurability of the core. Besides peak core performance, measurements of fully mapped neural networks showed a system efficiency, including IO power, of 1.7 to 3.6 TOPS/W at 0.65V, depending on the network. Compared to an hypothetical equivalent layer-by-layer processor, this is an efficiency gain of up to 18× realized by the depth-first dataflow. However, the development and evaluating measurements of an accelerator like DepFiN requires a great deal of time. Chapter 7 therefore presents a cost and analysis framework to speed up development iterations. This framework, dubbed DeFiNES, allows to rapidly estimate energy and latency with only a high level description of the accelerator and is compatible with many neural networks and dataflows that range from layer-by-layer to pixel-by-pixel depth-first. As such, many different combinations of hardware architectures, dataflow, and neural network can be evaluated in the early stages of accelerator design, so that only the most promising one would have to be fully developed. DeFiNES is therefore an extremely valuable tool for designers of the NN accelerator chips of the future. This thesis thus presents several techniques to optimize NN applications that cover the complete stack of abstraction layers. In doing so, it enables powerful Artificial Intelligence on devices that can be ubiquitously deployed in everyday life.