ML-Based Power Models for CPUs. Innovation in Verification
An effective learned power model for a CPU could be a significant advantage in early estimation of power performance against realistic workloads in complex architectures. Paul Cunningham (GM, Verification at Cadence), Raúl Camposano (Silicon Catalyst, entrepreneur, former Synopsys CTO and lecturer at Stanford, EE292A) and I continue our series on research ideas. As always, feedback welcome.
CPU를 위한 효과적인 학습 기반 전력 모델은 복잡한 아키텍처에서 현실적인 워크로드에 대한 전력 성능을 조기에 추정하는 데 있어 큰 이점이 될 수 있습니다. 폴 커닝햄(Paul Cunningham, 케이던스 검증 총괄 GM), 라울 캄포사노(Raúl Camposano, 실리콘 카탈리스트 창업자이자 전 시놉시스 CTO, 스탠퍼드 대학교 EE292A 강사)와 저는 연구 아이디어에 관한 시리즈를 이어가고 있습니다. 언제나 그렇듯 피드백은 환영합니다.
The Innovation
This month’s pick is Machine Learning-Based Microarchitecture-Level Power Modeling of CPUs. The authors are from UT Austin, also Hyperstone and U Stuttgart, both in Germany. The paper (2023) has been published in the IEEE Transactions on Computers and has 18 citations.
이번 달의 선정작은 '머신러닝 기반 CPU 마이크로아키텍처 수준 전력 모델링(Machine Learning-Based Microarchitecture-Level Power Modeling of CPUs)'입니다. 저자들은 미국 오스틴 소재 텍사스 대학교(UT Austin)와 독일의 하이퍼스톤(Hyperstone), 슈투트가르트 대학교(U Stuttgart) 소속입니다. 이 논문(2023)은 《IEEE Transactions on Computers》에 게재되었으며 1인용 인용 횟수는 18회입니다.
We covered another paper on this topic back in 2021: Learning-Based Power Modeling. Innovation in Verification (senior author in common with this paper). The primary advance from that earlier paper is extending the method from fixed function accelerators to programmable in-order and out-of-order CPUs. The learning method here is based on DNNs; it would be interesting see how transformer-based methods could advance these ideas.
우리는 2021년에 이 주제를 다룬 다른 논문, 즉 '학습 기반 전력 모델링: 검증의 혁신(Learning-Based Power Modeling. Innovation in Verification)'을 다룬 적이 있습니다(본 논문과 공통 교신저자 포함). 이전 논문에서의 주된 발전 사항은 고정 기능 가속기에서 프로그래밍 가능한 순차(in-out) 및 비순차(out-of-order) CPU로 방법론을 확장한 것입니다. 여기서는 심층 신경망(DNN) 기반의 학습 방법을 사용하고 있으며, 트랜스포머(Transformer) 기반 방법이 이러한 아이디어를 어떻게 발전시킬 수 있을지 살펴보는 것도 흥미로울 것입니다.
Paul’s view
Fun paper this month on estimating power from a cycle-accurate micro-architecture level simulation of a CPU – something at a resolution similar to what a high-level synthesis tool would be able to compile into RTL.
이번 달의 흥미로운 논문은 CPU의 사이클 정확(cycle-accurate) 마이크로아키텍처 수준 시뮬레이션으로부터 전력을 추정하는 다루었습니다. 고수준 합성(HLS) 도구가 RTL로 컴파일할 수 있는 수준과 유사한 해상도를 가집니다.
The authors’ approach is to train decision-tree models to predict power for a single clock cycle on low level CPU building blocks such as the fetch, decode, and load-store. The decision-trees are trained using golden power data using a post-P&R gate-level netlist and simulation traces. The models are then assembled hierarchically to construct a cycle-accurate power profile from a cycle-accurate micro-architectural simulation trace of the complete design.
저자들의 접근 방식은 페치(fetch, 명령어 인출), 디코드(decode, 해독), 로드-스토어(load-store) 같은 저수준 CPU 빌딩 블록에서 단일 클록 사이클의 전력을 예측하기 위한 의사결정 나무(decision-tree) 모델을 훈련하는 것입니다. 의사결정 나무는 P&R(배치 및 배선) 이후의 게이트 수준 넷리스트와 시뮬레이션 트레이스를 사용한 골든 전력 데이터로 훈련됩니다. 그 후 모델들을 계층적으로 조립하여 전체 디자인의 사이클 정확 마이크로아키텍처 시뮬레이션 트레이스로부터 사이클 정확 전력 프로파일을 구축합니다.
The key challenge to make the approach work picking the right features to use for branches in the decision-trees. Here, the authors have several neat ideas. All primary inputs to a block are used as features – control signals have a feature for each bit, datapath signals have a feature for each byte, where the value of that feature is the number bits in the byte that change value in the cycle. Where FIFOs and other pipelined structures are detected, their internal stages get their own features in the decision-tree. Glue logic at each intermediate level in the hierarchy is treated as a virtual sub-block and given its own dedicated decision-tree.
이 접근 방식을 작동시키는 데 있어 핵심적인 과제는 의사결정 나무의 분기에 사용할 올바른 피처(feature)를 선택하는 것입니다. 여기서 저자들은 몇 가지 기발한 아이디어를 제시합니다. 블록의 모든 주 입력은 피처로 사용됩니다. 제어 신호는 각 비트마다 하나의 피처를 가지며, 데이터패스 신호는 각 바이트마다 하나의 피처를 가집니다. 이때 해당 피처의 값은 해당 사이클에서 값이 변경되는 바이트 내의 비트 수입니다. FIFO 및 기타 파이프라인 구조가 감지되면, 그 내부 스테이지들은 의사결정 나무 내에서 각자의 피처를 갖게 됩니다. 계층 구조의 각 중간 단계에 있는 글루 로직(glue logic)은 가상 서브 블록으로 취급되어 전용 의사결정 나무가 할당됩니다.
The authors present results on two open source designs, a simple in-order CPU, and a complex out-of-order CPU, BOOM. They are implemented on an open source 45nm process and library. With only 20k cycles of training data using 8 very simple test programs (quick sort, Towers of Hanoi, Dhrystone, …), power estimation for BOOM on the CoreMark benchmark has an average error in any clock cycle of less than 4%. At the resolution of individual building blocks, 80% of the blocks are within a 15% error in any clock cycle. The runtime overhead of processing the decision trees is negligible, so the entire estimation process basically takes as long as the architecture simulation takes. Nice.
저자들은 단순한 순차 CPU와 복잡한 비순차 CPU인 BOOM이라는 두 가지 오픈소스 디자인에 대한 결과를 제시합니다. 이들은 오픈소스 45nm 공정 및 라이브러리를 사용하여 구현되었습니다. 8개의 매우 간단한 테스트 프로그램(퀵소트, 하노이의 탑, Dhrystone 등)을 사용한 단 2만 사이클의 훈련 데이터만으로, CoreMark 벤치마크 상에서 BOOM의 전력 추정치는 모든 클록 사이클에서 평균 오차가 4% 미만으로 나타났습니다. 개별 빌딩 블록 수준에서는 블록의 80%가 모든 클록 사이클에서 15% 이내의 오차를 보였습니다. 의사결정 나무를 처리하는 데 따른 런타임 오버헤드는 무시할 수 있을 수준이므로, 전체 추정 과정은 기본적으로 아키텍처 시뮬레이션이 걸리는 시간만큼만 소요됩니다. 훌륭합니다.
Raúl’s view
The motivation for this work is the long runtime of power estimation. Signoff power analysis requires gate-level activity from a synthesized and physically implemented design, making it too expensive for architectural exploration. The authors report an “accurate gate-level reference power estimation a total of 40-65 hours running at 2-3 cycles/s” of the BOOM processor (approx. 460K standard cells, https://slam.ece.utexas.edu/pubs/tc22.LACPo.pdf), compared with 7–9 hours using their learned models and Verilator-based simulation, a speedup of roughly 5–9x.
이 연구의 동기는 전력 추정의 긴 런타임에 있습니다. 시그노프(Signoff) 전력 분석은 합성 및 물리적으로 구현된 디자인의 게이트 수준 활동(activity)을 요구하므로, 아키텍처 탐색을 수행하기에는 비용이 너무 많이 듭니다. 저자들은 BOOM 프로세서(약 460K 표준 셀,https://slam.ece.utexas.edu/pubs/tc22.LACPo.pdf)에에) 대해 "총 40~65시간 동안 초당 2~3 사이클 속도로 실행되는 정확한 게이트 수준 기준 전력 추정"과 비교하여, 학습된 모델과 Verilator 기반 시뮬레이션을 사용할 경우 7~9시간이 소요되어 약 5~9배의 속도 향상을 이뤄냈다고 보고합니다.
The catch is that these savings come only after the models have been trained using expensive gate-level reference simulations, and it’s not clear these are accurate when exploring different implementations. The methodology is based on decision trees which are calibrated against gate-level power estimates from a particular synthesized and placed-and-routed design. Changes in synthesis, cell libraries, clock trees, physical implementation, etc. affect power consumption even when the microarchitectural functionality remains identical. The authors suggest that characterized blocks could be reused in different configurations but provide no evidence that this preserves accuracy. What they convincingly demonstrate is generalization across workloads running on the same implementation. Applicability to design-space exploration, where the hardware implementation itself is changing, is unclear.
문제는 이러한 절감 효과가 비용이 많이 드는 게이트 수준 기준 시뮬레이션을 사용하여 모델을 훈련한 이후에만 발생한다는 점이며, 다양한 구현을 탐색할 때 이 모델들이 정확성을 유지하는지는 불분명합니다. 이 방법론은 특정 합성 및 배치·배선(P&R) 디자인의 게이트 수준 전력 추정치를 기반으로 보정된 의사결정 나무에 기반을 두고 있습니다. 마이크로아키텍처 기능이 동일하게 유지되더라도 합성, 셀 라이브러리, 클록 트리, 물리적 구현 등의 변경은 전력 소비에 영향을 미칩니다. 저자들은 특성화된 블록이 서로 다른 구성에서 재사용될 수 있다고 제안하지만, 이것이 정확성을 보존한다는 증거는 제시하지 않습니다. 그들이 설득력 있게 입증한 것은 동일한 구현에서 실행되는 워크로드 전반에 걸친 일반화입니다. 하드웨어 구현 자체가 변경되는 디자인 스페이스 탐색(design-space exploration)에 대한 적용 가능성은 불분명합니다.
The reported accuracy also deserves a closer look. The Mean Absolute Error (MAE) is normalized to the average power of the entire CPU, rather than averaging the percentage error of each individual cycle. Thus, the 3.6% MAE on CoreMark does not mean that power is predicted within 3.6% in every cycle. Also, accuracy varies strongly across individual blocks: the ALU has a 15% MAE, the issue unit 18%, and the memory issue unit 23%. Errors in individual blocks can partially cancel when aggregated, even though absolute errors cannot cancel across cycles in the MAE calculation. This raises questions about the accuracy of localized power estimates for identifying power hotspots and comparing alternative implementations.
보고된 정확도 역시 면밀히 살펴볼 필요가 있습니다. 평균 절대 오차(MAE)는 각 개별 사이클의 퍼센트 오차를 평균하는 대신, 전체 CPU의 평균 전력으로 정규화되었습니다. 따라서 CoreMark에서의 3.6% MAE가 모든 사이클에서 전력이 3.6% 이내로 예측된다는 것을 의미하지는 않습니다. 또한 정확도는 개별 블록에 따라 크게 다릅니다. ALU는 15% MAE, 이슈 유닛(issue unit)은 18%, 메모리 이슈 유닛은 23%의 MAE를 보입니다. 절대 오차는 MAE 계산 시 사이클 간에 상쇄될 수 없지만, 집계될 때 개별 블록의 오차는 부분적으로 상쇄될 수 있습니다. 이는 전력 핫스팟을 식별하고 대안적인 구현들을 비교하기 위한 국소적 전력 추정치의 정확성에 대한 의문을 제기합니다.
Nevertheless, the reported results are impressive for whole-core power prediction. It gives an idea of how AI-based models may transform power estimation, shifting much of the analysis from expensive gate-level simulations to fast, learned predictions.
그럼에도 불구하고 보고된 결과는 전체 코어 전력 예측 관점에서 매우 인상적입니다. 이는 AI 기반 모델이 전력 추정 방식을 어떻게 변화시킬 수 있는지 보여주며, 분석의 많은 부분을 비용이 많이 드는 게이트 수준 시뮬레이션에서 빠르고 학습된 예측으로 전환시켜 줍니다.