# Agnostic Energy Consumption Models for Heterogeneous GPUs in Cloud Computing
## 3 Power and Energy Models
### Power Models  
This section illustrates the methodology for developing the power consumption model in detail. Firstly, we present the execution of GPU applications in the experiment. Secondly, we provide a brief overview of the data collection stage. Thirdly, we delve into the input selection process utilized in the model. Then, we will comprehensively examine the power model design. Furthermore, we showcase the training of the model. Finally, we will discuss the hybrid input model.  
(1) Applications  
The power model involves the training phase that contains collected data from several GPU applications to develop, train, and test the prediction accuracy of the developed model. Several GPU applications that contain different computational and communication characteristics and implementation techniques are selected to train and test the model, and evaluate the strength of the model as well. Different GPU application types including compute-intensive and memory-intensive applications are considered to develop the power model. N-body is an example of a compute-intensive application, and Spmv is an example of a memory-intensive application, chosen to harden and generalize the model's usage. Selected applications are found in several fields, such as linear algebra, image processing, simulation, and fluid dynamics. The main dataset is divided into training and testing sets. The training phase contains 30 applications, and the testing phase contains 10 applications. The applications in the training and testing phases are selected from well-known benchmarks in the field of GPU computing. These benchmarks are Rodinia [27], Parboil [28], and CUDA SDK applications [29]. We separately run two different profiling tools to collect data (nvprof and nvidia-smi), and nvprof has considerable overhead. Additionally, we consider two different GPUs to collect the required data for the model. Table 1 represents the application name, its source, and the application's size in the training set. Table 2 similarly illustrates the details of the selected applications in the testing set.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Application** & **Source** & **Description** & **Size** \\ \hline RecursiveGaussian & Cuda SDK & \
\begin{tabular}{c} Gaussian blur implementation using [PERSON]’s recursive \\ way or recursive Gaussian filter \\ \end{tabular} & \(512\times 512\) \\ \hline HSOpticalFlow & Cuda SDK & A clear movement of objects estimation in a picture & 640 \(\times\) 480 \\ \hline Interval & Cuda SDK & Interval Newton method calculation & 65,536 equations \\ \hline SobolQRNG & Cuda SDK & Sobol quasirandom sequence implementation & 1,000,000 vectors and \\  & & 1000 dimensions \\ \hline Reduction & Cuda SDK & Parallel reduction technique implementation & 16,777,216 elements \\ \hline ScalarProd & Cuda SDK & Scalar product implementation & 2048 vectors and \\  & & 131,072 elements \\ \hline StereoDisparity & Cuda SDK & Stereo disparity computation implementation & 1800 \(\times\) 1800 \\ \hline ThreadFenceReduction & Cuda SDK &
\begin{tabular}{c} Implementation of array reduction operation using thread \\ fence instruction approach \\ \end{tabular} & 1,048,576 elements; \\  & & 128 threads; 64 blocks \\ \hline Sgemm & Parboil & Single matrix multiplication implementation & A \(\times\) B; A = 2048 \(\times\) 1984, \\  & & B = 1984 \(\times\) 2112 \\ \hline Spmv & Parboil & Sparse matrix vector multiplication implementation & 146,689 \(\times\) 146,689 \\ \hline Stencil & Parboil & 3D seven-point stencil implementation & 128 \(\times\) 128 \(\times\) 32; 200 iterations \\ \hline \end{tabular}
\end{table}
Table 1: Training set characteristics in the power model.