- AutorIn
- M.Sc. Elias Trommer Center for Advancing Electronics#Infineon Technologies Dresden
- Titel
- Efficient Neural Network Inference on Resource-Constrained Devices
- Zitierfähige Url:
- https://nbn-resolving.org/urn:nbn:de:bsz:14-qucosa2-968657
- Erstveröffentlichung
- 2025
- Datum der Einreichung
- 09.12.2024
- Datum der Verteidigung
- 07.03.2025
- Abstract (EN)
- Large-scale Artificial Neural Networks (ANNs) have gone from academic subject to surpassing human performance in a large number of domains within little more than a decade. What powered this meteoric rise was the availability of enormous—and exponentially growing—amounts of computational capacity. During the same time, many scandals around data breaches have undermined the public’s trust in the confidentiality of their data, once transferred to the cloud platforms on which ANNs usually run. This trend has sparked interest in running Machine Learning (ML) models not just on centralized and powerful compute systems, but on the edge, close to where the data originates. These devices are often battery-powered and provide several orders of magnitude less compute and memory, compared to modern High Performance Computing (HPC) systems. Training a model based on local data is rarely feasible on such constrained systems. Querying an existing, static model for predictions—a process known as inference—is, however, often achievable, especially for comparatively simple tasks like image recognition and keyword spotting. This thesis discusses several adaptations to the inference of ANNs to suit the requirements of these resource-constrained systems. First, integer quantization and the use of Approximate Multipliers (AMs) are discussed as a means of reducing the energy consumption of the arithmetic hardware of resource-constrained systems. These hardware multipliers do not provide mathematically exact results under all conditions, which allows them to improve upon accurate hardware in other metrics. When they are used to run a model that was trained using accurate multiplication, they do, however, tend to cause a significant degradation of accuracy. To improve the final model’s accuracy when using AMs, a Graphics Processing Unit (GPU)-backed simulation of their behavior is integrated into the popular ML framework PyTorch. For some designs, the throughput of this simulation is improved upon by up to four times through a novel simulation model in the floating-point domain, which plays to the strengths of the GPUs that are commonly used to carry out the training. This AM simulation software library is then used to combine the heterogeneous choice of AMs for different layers in a neural network with retraining to improve the model’s performance. Considering the accuracy requirements of each layer in a neural network, rather than uniformly deploying a single AM model throughout improves the accuracy for a given reduction in energy and vice versa. An up to 79% reduction in the energy consumption for multiplications at a less than 1 p.p. drop in accuracy was achieved when combining heterogeneous AM assignment with retraining. Besides compute, another scarce quantity in a resource-constrained system is memory. Results from previous research suggest that many parameters in a neural network might be redundant and can be replaced with zeroes, leaving a network with sparse tensors. Most research focuses on using this sparsity to accelerate computations, while its use for compression is rarely discussed. This is addressed by developing two encoding schemes for sparse neural network tensors, which achieve both high compression ratios and can utilize the parallel hardware available in many devices to accelerate decompression at runtime. The combination of both schemes achieves a more than 25% reduction in memory consumption at a less than 1 p.p. loss in model accuracy for several different image recognition architectures. Finally, sparsity and heterogeneous choice of AMs are combined and extended to include a third desirable property in resource-constrained systems: flexibility. The AM choice algorithm is enhanced to allow for a constrained number of AMs to be chosen from a larger search space. If the compute platform allows for reconfiguring the precision of the approximate operator at runtime, The optimization result is used to provide several different assignments from AMs to layers—the model’s operating points. Each of these points strikes a different balance between energy consumption and accuracy and allows for adjusting the Quality of Service (QoS) of the model at runtime. The increase in parameters caused by retraining the same model for different inference environments is addressed with a weight-sharing scheme that keeps the majority of parameters identical between models as well as the use of pruning and compression of the model’s sparse tensors. With this combination, both an up to 50% reduction in energy consumption and a 25% reduction in memory footprint are achieved, at the cost of a worst-case accuracy loss of 1.10 p.p. This thesis integrates several, usually distinct, aspects of neural network inference from model training to hardware parameters optimization and low-level software. Simultaneously considering these different components that need to come together in a system’s design helps build a deeper understanding away from domain-specific optimizations, and towards optimization of neural network inference on resource-constrained devices as a whole.
- Verweis
- Link: https://ieeexplore.ieee.org/abstract/document/10534860
Smaller Together: Groupwise Encoding of Sparse Neural Networks
DOI: 10.1109/TCAD.2024.3402957 - High-throughput approximate multiplication models in PyTorch
Link: https://ieeexplore.ieee.org/abstract/document/10139366
DOI: 10.1109/DDECS57882.2023.10139366 - dCSR: A memory-efficient sparse matrix representation for parallel neural network inference
Link: https://dl.acm.org/doi/abs/10.1109/ICCAD51958.2021.9643506
DOI: 10.1109/ICCAD51958.2021.9643506 - Fast Retraining of Approximate CNNs for High Accuracy
DOI: 10.1109/TCAD.2024.3483091
Link: https://ieeexplore.ieee.org/abstract/document/10720891 - QoS-Nets: Adaptive Approximate Neural Network Inference
Link: https://ieeexplore.ieee.org/abstract/document/10534860 - Combining Gradients and Probabilities for Heterogeneous Approximation of Neural Networks
DOI: 10.1145/3508352.3549329
Link: https://dl.acm.org/doi/abs/10.1145/3508352.3549329 - Freie Schlagwörter (EN)
- approximate computing, deep learning, neural networks, processor design
- Klassifikation (DDC)
- 006
- Klassifikation (RVK)
- ST 301
- GutachterIn
- Prof. Dr. Akash Kumar
- Prof. Dr. Jörg Henkel
- BetreuerIn Hochschule / Universität
- Prof. Dr. Akash Kumar
- Den akademischen Grad verleihende / prüfende Institution
- Technische Universität Dresden, Dresden
- Förder- / Projektangaben
- Bundesministerium für Bildung und Forschung RadarSkin
ID: 16ME0542K - Sonstige beteiligte Institution
- Infineon Technologies Dresden GmbH & Co.KG, Dresden
- Version / Begutachtungsstatus
- publizierte Version / Verlagsversion
- URN Qucosa
- urn:nbn:de:bsz:14-qucosa2-968657
- Veröffentlichungsdatum Qucosa
- 08.05.2025
- Dokumenttyp
- Dissertation
- Sprache des Dokumentes
- Englisch
- Lizenz / Rechtehinweis
CC BY 4.0- Inhaltsverzeichnis
ABSTRACT ACKNOWLEDGMENTS 1 INTRODUCTION 1.1 The Unreasonable Effectiveness of Neural Networks 1.2 Processors at the End of Dennard Scaling 1.3 Intelligent Devices: The Drive Towards On-Device Inference 1.4 Shrinking Neural Networks 1.5 Research Challenges 1.6 Proposed System Design Methodology 1.7 Key Contributions and Thesis Overview 2 PRELIMINARIES 2.1 Neural Networks 2.1.1 Inference 2.1.2 Learning through Backpropagation 2.1.3 Convolutional Neural Networks 2.2 Quantization 2.2.1 Fixed-Point and Floating-Point Representations 2.2.2 Post-Training Quantization and Quantization-Aware Training 2.3 Pruning 2.3.1 Sensitivity Analysis 2.3.2 Iterative Pruning and Fine-Tuning 2.4 Approximate Multiplications 2.4.1 Truncated Multiplier 2.4.2 Logarithmic Multiplier 3 APPROXIMATE MULTIPLICATIONS DURING NETWORK TRAINING 3.1 Introduction 3.2 Related Work 3.2.1 Approximate Multipliers 3.2.2 Approximate Neural Network Training 3.3 Granular Quantization for Approximate Neural Networks 3.3.1 Motivation 3.3.2 Approximate Per-Channel Quantization 3.4 From Fake-Quantization to Fake-Approximation 3.4.1 Rationale 3.4.2 Modeling Approximate Multiplications as a Composition of Transformations and Accurate Product Functions 3.4.3 Required Properties and Limitations 3.5 Analytic Implementation of Fake-Approximation 3.5.1 Modeling Logarithmic Approximate Multipliers 3.5.2 Performance Considerations for GPUs 3.6 Data-driven Implementation of Fake-Approximation 3.6.1 Modeling Truncated Multipliers 3.6.2 Determining Model Parameters through Linear Regression 3.7 Generalization of Fake-Approximation to Arbitrary Circuits 3.8 Design Considerations for the TorchApprox Software Toolkit 3.9 Accuracy Impact of Quantization Granularity 3.9.1 Aggregate Evaluation on a Population of Models 3.9.2 Impact on Individual Models 3.10 Fidelity and Throughput of the Proposed Floating-Point Models 3.10.1 Experimental Setup 3.10.2 Evaluation 3.11 Inference Throughput of Approximate Deep Learning Frameworks 3.11.1 Experimental Setup 3.11.2 Evaluation 3.11.3 Comparison with TFApprox 3.12 Conclusion 4 MODEL SENSITIVITY TO APPROXIMATE MULTIPLICATIONS 4.1 Introduction 4.2 Related Work 4.2.1 Retraining for Approximate Multiplications through Gaussian Noise 4.2.2 Heterogeneous Approximate Multiplier Assignment 4.3 Modeling Approximate Multiplication as Noise 4.3.1 Propagation of Small Numerical Errors in a Neuron 4.3.2 Handling of the Error Mean 5.7 Case Study: Large Sparse vs. Small Dense MobileNetV2 on CIFAR-10 5.8 Hybrid Compression for Image Classification Tasks 5.8.1 Accuracy and Sparsity 5.8.2 Extraction Throughput 5.9 Conclusion 6 ADAPTIVE APPROXIMATE COMPUTING AND SPARSITY 6.1 Introduction 6.2 Related Work 6.3 n-constrained Multiplier Selection 6.3.1 Rationale 6.3.2 Input Preparation and Clustering 6.3.3 Interpretation of Clustering Results 6.4 Extending to Multiple Approximate Operating Points 6.5 Model Size Reduction 6.5.1 Rationale 6.5.2 Importance of Error Mean 6.5.3 Fine-Tuning Scheme 6.5.4 Sparsity for Shared Weights 6.6 Optimization of a Single Operating Point 6.6.1 Training Setup 6.6.2 Reference Optimization Techniques 6.6.3 Achieved Accuracy 6.7 Impact of Multiple Operating Points 6.7.1 Training Setup 6.7.2 Accuracy and Model Size 6.7.3 Model Compression through Sparsity and Hybrid Encoding 6.8 Conclusion 7 CONCLUSION AND OUTLOOK 7.1 Conclusion 7.2 Outlook BIBLIOGRAPHY APPENDIX A Use of Large Language Models in the Writing of This Thesis B Approximate Multiplication Training Framework B.1 Network Training Setup B.2 Experimental Results C Compressed Sparsity C.1 Likelihood of Element Groups C.2 Spacing of Elements C.3 Impact of Group Occupancy θ on Partitioning C.4 Binary Group Mask C.5 Keyword Spotting Reference Architecture