Citation: | Song Yuhong, Edwin Hsing-Mean Sha, Zhuge Qingfeng, Xu Rui, Wang Han. RR-SC: Run-Time Reconfigurable Framework for Stochastic Computing-Based Neural Networks on Edge Devices[J]. Journal of Computer Research and Development, 2024, 61(4): 840-855. DOI: 10.7544/issn1000-1239.202220738 |
With the development of AI democratization, deep neural networks (DNNs) have been widely applied to edge devices, such as smart phones and automated driving, etc. Stochastic computing (SC) as a promising technique performs fundamental machine learning (ML) tasks using simple logic gates instead of complicated binary arithmetic circuits. SC has advantages of low-power and low-cost DNNs execution on edge devices with constrained resources (e.g., energy, computation and memory units, etc.). However, previous SC work only designs one group of setting for fixed hardware implementation, ignoring the dynamic hardware resources (e.g., battery), which leads to low hardware efficiency and short battery life. In order to save energy for battery-powered edge devices, dynamic voltage and frequency scaling (DVFS) technique is widely used for hardware reconfiguration to prolong battery life. In this paper, we creatively propose a run-time reconfigurable framework, namely RR-SC, for SC-based DNNs and first attempt to combine hardware and software reconfigurations to satisfy the time constraint of inference and maximally save energy. RR-SC using reinforcement learning (RL) can generate multiple groups of model settings at one time, which can satisfy the accuracy constraints under different hardware settings (i.e., different voltage/frequency levels). The solution has the best accuracy and hardware efficiency trade-off. Meanwhile, the model settings are switched on a backbone model at run-time, which enables lightweight software reconfiguration. Experimental results show that RR-SC can switch the lightweight settings within 110 ms to guarantee the required real-time constraint at different hardware levels. Meanwhile, it can achieve up to 7.6 times improvement for the number of model inference with only 1% accuracy loss.
[1] |
Garvey C. A framework for evaluating barriers to the democratization of artificial intelligence [C] //Proc of the 32nd AAAI Conf on Artificial Intelligence. Palo Alto, CA: AAAI, 2018: 8079−8080
|
[2] |
Wang Hanrui, Wu Zhanghao, Liu Zhijian, et al. Hat: Hardware-aware transformers for efficient natural language processing [C] //Proc of the 58th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2020: 7675−7688
|
[3] |
Song Yuhong, Jiang Weiwen, Li Bingbing, et al. Dancing along battery: Enabling transformer with run-time reconfigurability on mobile devices [C] // Proc of the 58th Design Automation Conf. Piscataway, NJ: IEEE, 2021: 1003−1008
|
[4] |
Jiang Weiwen, Yang Lei, Dasgupta S. , et al. Standing on the shoulders of giants: Hardware and neural architecture co-search with hot start[J]. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2020, 39(11): 4154−4165 doi: 10.1109/TCAD.2020.3012863
|
[5] |
Peng Hongwu, Huang Shaoyi, Geng Tong, et al. Accelerating transformer-based deep learning models on FPGAs using column balanced block pruning [C] //Proc of the 22nd Int Symp on Quality Electronic Design (ISQED). Piscataway, NJ: IEEE, 2021: 142−148
|
[6] |
纪荣嵘,林绍辉,晁飞,等. 深度神经网络压缩与加速综述[J]. 计算机研究与发展,2018,55(9):1871−1888
Ji Rongrong, Lin Shaohui, Chao Fei, et al. Deep neural network compression and acceleration: A review[J]. Journal of Computer Research and Development, 2018, 55(9): 1871−1888 (in Chinese)
|
[7] |
龚成,卢冶,代素蓉,等. 一种超低损失的深度神经网络量化压缩方法[J]. 软件学报,2021,32(8):2391−2407
Gong Cheng, Lu Zhi, Dai Surong, et al. Ultra-low loss quantization method for deep neural network compression[J]. Journal of Software, 2021, 32(8): 2391−2407 (in Chinese)
|
[8] |
孟子尧,谷雪,梁艳春,等. 深度神经架构搜索综述[J]. 计算机研究与发展,2021,58(1):22−33
Meng Ziyao, Gu Xue, Liang Yanchun, et al. Deep neural architecture search: A survey[J]. Journal of Computer Research and Development, 2021, 58(1): 22−33 (in Chinese)
|
[9] |
李航宇,王楠楠,朱明瑞,等. 神经结构搜索的研究进展综述[J]. 软件学报,2022,33(1):129−149
Li Hangyu, Wang Nannan, Zhu Mingrui, et al. Recent advances in neural architecture search: A survey[J]. Journal of Software, 2022, 33(1): 129−149 (in Chinese)
|
[10] |
Gaines B R. Stochastic computing systems [G/OL] // Advances in Information Systems Science. Berlin: Springer, 1969 [2022-11-24]. https://link.springer.com/chapter/10.1007/978-1-4899-5841-9_2
|
[11] |
Jeavons P, Cohen D A, Shawe-Taylor J. Generating binary sequences for stochastic computing[J]. IEEE Transactions on Information Theory, 1994, 40(3): 716−720 doi: 10.1109/18.335883
|
[12] |
Qian Weikang, Li Xin, Riedel M D, et al. An architecture for fault-tolerant computation with stochastic logic[J]. IEEE Transactions on Computers, 2010, 60(1): 93−105
|
[13] |
Li Peng, Lilja D J, Qian Weikang, et al. Computation on stochastic bit streams digital image processing case studies[J]. IEEE Transactions on Very Large Scale Integration Systems, 2013, 22(3): 449−462
|
[14] |
Li Bingzhe, Qin Yaobin, Yuan Bo, et al. Neural network classifiers using stochastic computing with a hardware-oriented approximate activation function [C] //Proc of the 35th IEEE Int Conf on Computer Design (ICCD). Los Alamitos, CA: IEEE Computer Society, 2017: 97−104
|
[15] |
Wu Di, Li Jingjie, Yin Ruokai, et al. Ugemm: Unary computing architecture for gemm applications [C] //Proc of the 47th ACM/IEEE Annual Int Symp on Computer Architecture (ISCA). Piscataway, NJ: IEEE, 2020: 377−390
|
[16] |
Song Yuhong, Sha E H, Zhuge Qingfeng, et al. Bsc: Block-based stochastic computing to enable accurate and efficient TinyML [C] // Proc of the 27th Asia and South Pacific Design Automation Conf (ASP-DAC). Piscataway, NJ: IEEE, 2022: 314−319
|
[17] |
Kim K, Kim J, Yu J, et al. Dynamic energy-accuracy trade-off using stochastic computing in deep neural networks [C] // Proc of the 53rd Annual Design Automation Conf (DAC). New York: ACM, 2016: 124: 1−124: 6
|
[18] |
Sim H, Kenzhegulov S, Lee J. DPS: Dynamic precision scaling for stochastic computing-based deep neural networks [C] //Proc of the 55th Annual Design Automation Conf (DAC). New York: ACM, 2018: 13: 1−13: 6
|
[19] |
刘全,翟建伟,章宗长,等. 深度强化学习综述[J]. 计算机学报,2018,41(1):1−27
Liu Quan, Zhai Jianwei, Zhang Zongzhang, et al. A survey on deep reinforcement learning[J]. Chinese Journal of Computers, 2018, 41(1): 1−27 (in Chinese)
|
[20] |
余显,李振宇,孙胜,等. 基于深度强化学习的自适应虚拟机整合方法[J]. 计算机研究与发展,2021,58(12):2783−2797
Yu Xian, Li Zhenyu, Sun Sheng, et al. Adaptive virtual machine consolidation method based on deep reinforcement learning[J]. Journal of Computer Research and Development, 2021, 58(12): 2783−2797 (in Chinese)
|
[21] |
Sim H, Lee J. A new stochastic computing multiplier with application to deep convolutional neural networks [C] //Proc of the 54th Annual Design Automation Conf (DAC). New York: ACM, 2017: 29: 1−29: 6
|
[22] |
Tomic T, Schmid K, Lutz P, et al. Toward a fully autonomous UAV: Research platform for indoor and outdoor urban search and rescue[J]. IEEE Robotics & Automation Magazine, 2012, 19(3): 46−56
|
[23] |
Horowitz M, Indermaur T, Gonzalez R. Low-power digital design [C] // Proc of 1994 IEEE Symp on Low Power Electronics. Piscataway, NJ: IEEE, 1994: 8−11
|
[24] |
Jiang Weiwen, Zhang Xinyi, Sha E H, et al. Accuracy vs. Efficiency: Achieving both through FPGA-implementation aware neural architecture search [C/OL] // Proc of the 56th Annual Design Automation Conf (DAC). New York: ACM, 2019[2022-11-24].https://dl.acm.org/doi/abs/10.1145/3316781.3317757
|
[25] |
Williams R J. Simple statistical gradient-following algorithms for connectionist reinforcement learning[J]. Machine Learning, 1992, 8(3): 229−256
|
[26] |
Dong Xuanyi, Yang Yi. Nas-bench-201: Extending the scope of re-producible neural architecture search [C/OL] // Proc of the 8th Int Conf on Learning Representations (ICLR). 2020[2022-11-24].https://openreview.net/forum?id=HJxyZkBKDr
|
[27] |
Skadron K, Stan M, Huang Wei, et al. Temperature-aware microarchitecture [C] // Proc of the 30th Int Symp on Computer Architecture (ISCA). Los Alamitos, CA: IEEE Computer Society, 2003: 2−13
|
[28] |
Google. Odroid-XU3 [EB/OL]. 2020[2022-11-24].https://www.hardkernel.com/shop/odroid-xu3/, 2020.
|
[29] |
Liu Siting, Han jie. Energy efficient stochastic computing with sobol sequences [C] // Proc of the 20th Design, Automation & Test in Europe Conf & Exhibition (DATE). Piscataway, NJ: IEEE, 2017: 650−653
|
[30] |
Najafi M H, Lilja D J, Riedel M. Deterministic methods for stochastic computing using low-discrepancy sequences [C/OL] // Proc of the 37th IEEE/ACM Int Conf on Computer-Aided Design (ICCAD). New York: ACM, 2018[2022-11-24].https://dl.acm.org/doi/abs/10.1145/3240765.3240797
|
[1] | Li Qinxin, Wu Wenhao, Wang Zhaohua, Li Zhenyu. DNS Recursive Resolution Service Security: Threats, Defenses, and Measurements[J]. Journal of Computer Research and Development. DOI: 10.7544/issn1000-1239.202440158 |
[2] | Research on Malicious Domain Detection Technology Based on Semantic Graph Learning[J]. Journal of Computer Research and Development. DOI: 10.7544/issn1000-1239.202440375 |
[3] | Wei Jinxia, Long Chun, Fu Hao, Gong Liangyi, Zhao Jing, Wan Wei, Huang Pan. Malicious Domain Name Detection Method Based on Enhanced Embedded Feature Hypergraph Learning[J]. Journal of Computer Research and Development, 2024, 61(9): 2334-2346. DOI: 10.7544/issn1000-1239.202330117 |
[4] | Pan Jianwen, Cui Zhanqi, Lin Gaoyi, Chen Xiang, Zheng Liwei. A Review of Static Detection Methods for Android Malicious Application[J]. Journal of Computer Research and Development, 2023, 60(8): 1875-1894. DOI: 10.7544/issn1000-1239.202220297 |
[5] | Fan Zhaoshan, Wang Qing, Liu Junrong, Cui Zelin, Liu Yuling, Liu Song. Survey on Domain Name Abuse Detection Technology[J]. Journal of Computer Research and Development, 2022, 59(11): 2581-2605. DOI: 10.7544/issn1000-1239.20210121 |
[6] | Yang Wang, Gao Mingzhe, Jiang Ting. A Malicious Code Static Detection Framework Based on Multi-Feature Ensemble Learning[J]. Journal of Computer Research and Development, 2021, 58(5): 1021-1034. DOI: 10.7544/issn1000-1239.2021.20200912 |
[7] | Peng Chengwei, Yun Xiaochun, Zhang Yongzheng, Li Shuhao. Detecting Malicious Domains Using Co-Occurrence Relation Between DNS Query[J]. Journal of Computer Research and Development, 2019, 56(6): 1263-1274. DOI: 10.7544/issn1000-1239.2019.20180481 |
[8] | Dai Hua, Qin Xiaolin, and Bai Chuanjie. A Malicious Transaction Detection Method Based on Transaction Template[J]. Journal of Computer Research and Development, 2010, 47(5): 921-929. |
[9] | Li Qianmu and Liu Fengyu. A Risk Detection and Fault Analysis Method for the Strategic Internet[J]. Journal of Computer Research and Development, 2008, 45(10): 1718-1723. |
[10] | Zhang Xiaoning and Feng Dengguo. Intrusion Detection for Ad Hoc Routing Based on Fuzzy Behavior Analysis[J]. Journal of Computer Research and Development, 2006, 43(4): 621-626. |
1. |
余莎莎,肖辉,郑清,赵幽. 基于威胁情报的DNS助力医院网络安全建设实践. 中国卫生信息管理杂志. 2024(06): 909-914 .
![]() |