Power consumption prediction based on SSA-RF
-
摘要:
随机森林具有训练速度快、不容易过拟合、易于实现等优点成功应用于各种领域. 针对在芯片设计后仿阶段需要对不同存储存储单元大小、电压、温度等情况进行功耗测试,并且测试一次的时间很长的问题,提出了一种基于麻雀搜索算法(SSA)与随机森林(RF)相结合的功耗预测方法. 首先,对14 nmSRAM后仿的单元库进行表征,找出合适的特征变量,得到特征数据后构建训练测试集;然后对特征变量进行特征重要性分析,按照特征重要性排序;最后使用随机森林模型进行回归预测,并引入了麻雀搜索算法以寻找出均方根误差最小时的模型参数. 与线性回归模型、支持向量回归模型等相比,SSA-RF收敛精度高并且训练速度快,SSA-RF模型的R2值为0.97左右. 此外,在数据量较少的情况下其R2的值也能达到0.95左右,构建了一个较好的预测模型,为减少功耗测试时间提供了一种可行的方案,可以为设计人员留下更多的时间去优化电路.
Abstract:Random forest has been successfully applied in various fields due to its advantages of fast training speed, difficult over fitting and easy realization. In order to solve the problem that the power consumption test of different memory unit sizes, voltages and temperatures is needed in the post simulation stage of chip design, and the test time is very long, a power prediction method based on the combination of Sparrow Search Algorithm (SSA) and Random Forest (RF) is proposed. Firstly, the unit library after 14 nm SRAM is characterized to find out the appropriate feature variables and obtain the feature data to build the training test set. Secondly, the characteristic variables are analyzed by the characteristic importance, and sorted according to the characteristic importance. Finally, the random forest model is used for regression prediction, and the sparrow search algorithm is introduced to find the model parameters with the smallest root mean square error. Compared with linear regression model, support vector regression model and other models, SSA-RF has higher convergence accuracy, faster training speed. The R2 value of SSA-RF model is about 0.97. In addition, in the case of less data, the R2 value can also reach about 0.95. A better prediction model is constructed, which provides a feasible scheme for reducing the power consumption test time, and can leave more time for designers to optimize the circuit.
-
Key words:
- power waste /
- Sparrow search algorithm /
- Random forest
-
表 1 实验的评估结果
Table 1. Evaluation results of the experiment
评价指标 第一次 第二次 第三次 第四次 第五次 R2 0.979 0.983 0.969 0.973 0.966 MSE 322 208 316 256 303 MAE 2.58 2.23 2.58 2.32 2.42 表 2 不同模型评估结果对比
Table 2. Comparison of evaluation results of different models
评价
指标RF模型 线性回
归模型SVR模型 贝叶斯回
归模型多层感
知机R2 0.963 0.436 0.235 0.169 0.454 MSE 3.75*10−5 1.03*10−3 0.876 3.29*10−3 5.63*10−4 MAE 2.01*10−3 1.11*10−2 0.197 3.73*10−2 1.08*10−2 表 3 不同训练集下模型的评价结果
Table 3. Evaluation results with small training data
评价
指标训练测试5∶1 训练测试4∶1 训练测试3∶1 训练测试2∶1 训练测试1∶1 R2 0.972 0.973 0.965 0.965 0.955 MSE 299 285 332 321 427 MAE 2.43 2.41 2.49 2.64 3.09 -
[1] 顾东华, 曾智勇, 余金金, 等. 从RTL到GDS的功耗优化全流程[J]. 电子技术应用,2022,48(8):65-69. DOI: 10.16157/j.issn.0258-7998.229807.GU D H, ZENG Z Y, YU J J, et al. Fully power optimization flow from RTL to GDS[J]. Application of Electronic Technique,2022,48(8):65-69. DOI: 10.16157/j.issn.0258-7998.229807. [2] SINANGILME, CHANDRAKASANAP. Application-specific SRAM design using output prediction to reduce bit-line switching activity and statistically gated sense amplifiers for up to 1.9×lower energy/access[J]. IEEE Journal of Solid-State Circuits,2014,49(1):107-117. DOI: 10.1109/JSSC.2013.2280310. [3] 欧阳谢逸, 刘雯. 一种提高SRAM写能力的自调节负位线电路设计[J]. 电子技术,2020,49(12):1-5.OUYANG X Y, LIU W. Study on a self-regulating negative bit-line voltage circuit for improving SRAM writing-ability[J]. Electronic Technology,2020,49(12):1-5. [4] RAJR, BHATMS, REKHAS. Library characterization: noise and delay modeling[C]//Proceedings of 2018 IEEE Distributed Computing, VLSI, Electrical Circuits and Robotics. Mangalore: IEEE, 2018: 44-48. [5] 郭春成, 郝旭丹, 陈霏. 一种新型低功耗SRAM读写辅助电路设计[J]. 北京航空航天大学学报,2020,46(8):1618-1624. DOI: 10.13700/j.bh.1001-5965.2019.0533.GUO C C, HAO X D, CHEN F. Design of a novel read and write assisted circuit in low power SRAM[J]. Journal of Beijing University of Aeronautics and Astronautics,2020,46(8):1618-1624. DOI: 10.13700/j.bh.1001-5965.2019.0533. [6] CHARAFEDDINE K, OUARDI F. Fast timing characterization of cells in standard cell library design based on curve fitting[C]//Proceedings of 2017 International Conference on Wireless Technologies, Embedded and Intelligent Systems. Fez: IEEE, 2017: 1-6. [7] SHE Y Q, ZHANG L J, ZHENG J B, et al. Standard cell library characterization of 28 nm process based on machine learning[C]//Proceedings of DES tech Transactions on Computer Science and Engineering. Guilin: 2nd International Conference on Computer Science and Technology. (CST), 2017: 543-548. [8] KLEMME F, AMROUCH H. Machine learning for on-the-fly reliability-aware cell library characterization[J]. IEEE Transactions on Circuits and Systems I:Regular Papers,2021,68(6):2569-2579. DOI: 10.1109/TCSI.2021.3069664. [9] 张雪欢, 孙剑伟, 赵黛岩. 基于随机森林的卫星快变遥测数据建模[J]. 计算机测量与控制,2022,30(11):213-218. DOI: 10.16526/j.cnki.11-4762/tp.2022.11.031.ZHANG X H, SUN J W, ZHAO D Y. Modeling of fastchanging telemetry data of satellite based on random forest[J]. Computer Measurement & Control,2022,30(11):213-218. DOI: 10.16526/j.cnki.11-4762/tp.2022.11.031. [10] 董红瑶, 王弈丹, 李丽红. 随机森林优化算法综述[J]. 信息与电脑,2021,33(17):34-37. DOI: 10.3969/j.issn.1003-9767.2021.17.011.DONG H Y, WANG Y D, LI L H. A review of random forest optimization algorithms[J]. China Computer & Communication,2021,33(17):34-37. DOI: 10.3969/j.issn.1003-9767.2021.17.011. [11] XUE J K, SHEN B. A novel swarm intelligence optimization approach: sparrow search algorithm[J]. Systems Science & Control Engineering,2020,8(1):22-34. DOI: 10.1080/21642583.2019.1708830. [12] 李黄曼, 张勇, 张瑶. 基于ISSA优化SVM的变压器故障诊断研究[J]. 电子测量与仪器学报,2021,35(3):123-129. DOI: 10.13382/j.jemi.B2003485.LI H M, ZHANG Y, ZHANG Y. Study of transformer fault diagnosis based on improved sparrow search algorithm optimized support vector machine[J]. Journal of Electronic Measurement and Instrumentation,2021,35(3):123-129. DOI: 10.13382/j.jemi.B2003485. [13] 戈一航, 杨光永, 徐天奇, 等. 基于SSA优化PID在移动机器人路径跟踪中的研究[J]. 国外电子测量技术,2021,40(9):64-69. DOI: 10.19652/j.cnki.femt.2102828.GE Y H, YANG G Y, XU T Q, et al. Research on optimized PID based on SSA in path tracking of mobile robot[J]. Foreign Electronic Measurement Technology,2021,40(9):64-69. DOI: 10.19652/j.cnki.femt.2102828. [14] 常东峰, 南新元. 基于改进麻雀算法的深度信念网络短期光伏功率预测[J]. 现代电子技术,2022,45(17):135-140. DOI: 10.16652/j.issn.1004-373x.2022.17.025.CHANG D F, NAN X Y. Short-term PV power prediction of deep belief network based on improved sparrow search algorithm[J]. Modern Electronics Technique,2022,45(17):135-140. DOI: 10.16652/j.issn.1004-373x.2022.17.025. [15] 杨云, 王勇. 基于麻雀搜索优化深度极限学习机的入侵检测方法[J]. 微电子学与计算机,2022,39(6):79-88. DOI: 10.19304/J.ISSN1000-7180.2021.1088.YANG Y, WANG Y. Intrusion detection method based on sparrow search optimization deep extreme learning machine[J]. Microelectronics & Computer,2022,39(6):79-88. DOI: 10.19304/J.ISSN1000-7180.2021.1088. [16] 李敦桥. 一种混合麻雀搜索算法[J]. 电脑知识与技术,2021,17(5):232-234. DOI: 10.14004/j.cnki.ckt.2021.0594.LI D Q. A hybrid sparrow search algorithm[J]. Computer Knowledge and Technology,2021,17(5):232-234. DOI: 10.14004/j.cnki.ckt.2021.0594. [17] SHAO Y, LI R D, LUO Y J, et al. Research on running data analysis method based on attention-LSTM[C]//Proceedings of 2021 International Conference on Intelligent Transportation, Big Data & Smart City. Xi'an: IEEE, 2021: 446-450. [18] KASUYA E. On the use of r and r squared in correlation and regression[J]. Ecological Research,2019,34(1):235-236. DOI: 10.1111/1440-1703.1011. [19] 魏明军, 张鑫楠, 刘亚志, 等. 一种基于SSA-BRF的网络入侵检测方法[J]. 河北大学学报(自然科学版),2022,42(5):552-560. DOI: 10.3969/j.issn.1000-1565.2022.05.014.WEI M J, ZHANG X N, LIU Y Z, et al. A network intrusion detection method based on SSA-BRF[J]. Journal of Hebei University(Natural Science Edition),2022,42(5):552-560. DOI: 10.3969/j.issn.1000-1565.2022.05.014. -