A Simple Model for Portable and Fast Prediction of Execution Time and Power Consumption of GPU Kernels
Paper · 2020 · Lorenz Braun, Sotirios Nikas, Chen Song et al.
Summary
A program that can run on several graphics processing units still has to decide where to send its work. A useful estimate of how long a task will run or how much power it will draw should be available before that decision pays its cost. Lorenz Braun and colleagues study this problem at the level of a compute kernel, a routine that a host program launches on a GPU. They ask whether a description of the work itself can support predictions for different devices, even when details such as the rate of cache hits are unavailable. The question arises in scheduling, in dividing work across devices and in comparing hardware for future workloads. GPU parallel computing
The authors record instruction counts at the level of PTX, an intermediate instruction language for CUDA. Their profiler counts how often each thread executes a straight-line region of code. From those counts it builds a compact description of the work, including groups of instructions, volumes of data accessed and the arrangement of threads at launch. A random forest, an ensemble of decision trees, learns how those features relate to measured time or power. The same description of a launch can be reused on another GPU. The measurements and the fitted predictor are specific to the destination device. Machine learning
Experiments use kernels drawn from Rodinia, Parboil, SHOC and Polybench-GPU. Across the tested devices, median cross-validation error for power ranges from 1.84% to 2.94%, using mean absolute percentage error. Timing is more sensitive to the device. The GPUs tested at fixed clocks have median timing errors from 8.86% to 13.86%. The GTX1650, which ran with variable core and memory clocks, has a median timing error of 52.0%. The authors identify variable clocks as a possible explanation, alongside difficulties in measuring very short launches.
The detailed latency measurements put the time predictors at roughly a tenth of a second per prediction on the tested host processor, with shorter latencies for the power predictors. Whether that is fast enough depends on where the estimate enters the decision process. A device comparison planned in advance has different timing constraints from a scheduler choosing where to send a short kernel immediately before launch. The authors make their prediction and measurement infrastructure available as gpu-mangrove. Their results establish how far reusable workload descriptions can go within the tested CUDA setup, and show where irregular timing and scarce examples begin to limit the estimates.
Deep dive: A Simple Model for Portable and Fast Prediction of Execution Time and Power Consumption of GPU Kernels
Braun and colleagues use GPU instruction counts and launch settings to predict kernel time and power, testing how well the approach transfers across devices. · about 33 minutes to read
The problem and its context
Why estimate an individual kernel?
A GPU application can launch several routines, each with its own arguments and arrangement of parallel work. The paper treats a kernel launch as the unit whose behavior needs to be predicted. This matters because an application name tells a scheduler little about the cost of the next operation. Even launches of the same routine can represent different amounts of work. A launch may use a different input size or divide the work into a different number of thread blocks. A prediction has to be specific enough to respond to these changes.
The immediate example is task placement. In a system with different kinds of processors or different GPU types, a scheduler needs some indication of which device will complete a given piece of work sooner. When a task is split across GPUs, estimates can also help judge whether the pieces are large enough to be worthwhile and whether computation can overlap with communication. The authors point to hardware provisioning and procurement as further uses. For that kind of decision, the question is how prospective devices respond to workloads of interest. Power introduces another criterion on which the same devices can be assessed.
A direct measurement can answer such questions for a launch after it has run. Performance counters can also explain some of what happened during that run. The paper’s design question is what information could be reused if the GPU changes. A record of cache hits belongs to a particular execution on a particular machine. A description of how much arithmetic the launch performs, or how its threads are grouped, can serve as an input on several machines. The challenge is to retain enough information in that reusable description to estimate a device-dependent outcome.
There is also a difference between obtaining the work description and using it. The authors allow an instrumented execution to obtain instruction statistics. Their proposal saves the resulting features and reuses them for separate predictions. The decision cost the paper measures is the cost of evaluating a trained predictor once those features are available. That setup is especially relevant when work has already been characterized and the same behavior will recur, or when device choices can be evaluated in advance.
What makes parallel work easier or harder to characterize?
The paper explains GPU execution using CUDA’s terminology. A kernel launch specifies a grid of thread blocks. Threads in the same block can synchronize and exchange data through shared memory. Each block runs on a single streaming multiprocessor, or SM, which is a group of processing resources. The size of each block and the number of blocks in the grid thus describe different aspects of the work. One is about how many threads are grouped together. The other is about how many such groups the device can distribute.
Within a block, the hardware generally schedules threads in groups called warps. The paper gives 32 as the typical warp size. Threads sharing an instruction stream can proceed efficiently when they follow a coherent path. If different threads take different branches, execution can have to cover the separate paths with only the relevant threads active on each path. The authors discuss changes to thread scheduling in Volta, while retaining the practical point that the way threads take branches matters for performance. An aggregate count of branch and arithmetic instructions captures only part of that behavior.
Memory access has a similar distinction between amount and organization. Global memory is the device’s main memory resource, and shared memory is a resource that threads within a block can explicitly use for data exchange and reuse. When threads access global memory in a suitable pattern, their accesses can be combined. With less regular access, the same amount of useful data can require less efficient transfers. In shared memory, accesses that contend for the same bank can be serialized. The number of bytes requested by a program consequently need not reveal how much work the memory system must do to serve those requests.
The same hardware can tolerate the delay of an operation when there is other thread work ready to proceed. This is the practical significance of what the authors call parallel slackness, an abundance of work relative to the available execution resources. A launch with too little work can leave parts of the device idle. A launch with plentiful work gives the device more opportunities to continue while other operations wait. Both the number of blocks and their size are inexpensive ways to describe the supply of parallel work, even though neither directly measures how effectively the hardware used it.
These considerations motivate the paper’s hypothesis. The authors expect many GPU kernels to have reasonably coherent control flow, carefully arranged memory accesses and enough parallel work to tolerate latency. Under those conditions, much of the difference among launches may be explained by instructions and launch configuration, with the characteristics of a given device learned from its measurements. The condition matters. Code with deliberately poor locality, extensive divergence or other irregular behavior can make hardware effects more influential than the description accounts for. The experiments therefore test the adequacy of the description for a collection of real benchmark kernels.
The approaches available before this study
The paper surveys analytical, empirical and hybrid approaches to GPU prediction. An analytical approach expresses a relationship between features of the workload and properties of the hardware. One example uses the available memory bandwidth and the number of running threads. The Aspen approach described by the authors uses a domain-specific language to express an application for analysis. Other approaches use traces and simulation to estimate execution at the level of the GPU core, sometimes in conjunction with analytical descriptions. These methods differ in what they ask the application developer or the measurement infrastructure to supply.
Empirical approaches use observations to fit the relationship between workload and outcome. The paper describes earlier uses of regression, neural networks and tree ensembles, among other methods. A common source of input is a collection of runtime statistics obtained from a profiler or from a processor’s performance counters. Other studies add facts from kernel compilation, hardware specifications, custom microbenchmarks or program analysis. A fitted predictor can be accurate for the operating conditions and devices represented in those data. Reusing it can be harder when its inputs describe behavior that must be measured anew on each device.
Some earlier work had already used static program information or architecture-independent features, and some studies tested multiple GPUs. The authors also describe earlier efforts to predict behavior as memory and core clocks change, with the aim of finding useful operating settings. This paper focuses on a different reuse question. It keeps the description of a workload fixed when changing GPUs and obtains new target measurements for each device. The operating condition is mostly held fixed on each GPU where the authors can control it, so predicting the effect of a chosen frequency is outside the experiment.
The survey also explains why a comparison of headline error rates across publications would be difficult. Studies differ in their choice of metric, in the number and kinds of workloads, and in whether their units of evaluation are applications or individual kernels. A study of a single workload and one of a suite of applications test different forms of generalization. An error reported in absolute units and one reported relative to measured values emphasize different kinds of misses. The paper’s experimental design follows from those distinctions. It defines a common feature collection, fixes the units being predicted and uses evaluation splits to see how predictions behave on held-out examples.
The method, step by step
Separate the description of work from its measured cost
The workflow begins with a benchmark application and a particular problem size. The application can launch several kernels, and the order of those launches is recorded. Each sample associates the launch description with a measurement of time or power. There are separate measurement procedures for these targets because a timing measurement can be taken from an individual launch, while the power sensor may update too slowly to characterize a short launch on its own. The two tasks use a common approach to workload features, but the available samples can differ.
A feature vector is a row of numerical properties of the launch. It can include, for instance, the number of threads in a block, arithmetic operations executed and the volume of accesses to global memory. The target is the observed quantity the authors want to estimate on a given GPU. Changing the target can change which examples are available and which features are most informative. Changing the GPU also changes the measured target, even when the row of workload features stays the same.
From a CUDA launch to a device-specific prediction
The steps in order.
The notation in the paper describes the learning task as a mapping.
g: X → Y
Here, X is the space of possible input feature vectors and Y is the space of possible target values. The symbol g denotes the fitted function, and the arrow shows the direction of the mapping. An example vector is written xᵢ, with i identifying the example. Its label yᵢ is the corresponding observed target. For a time predictor the labels represent GPU execution times, with the transformation described below applied for fitting. For a power predictor they represent measured power. The function is fitted for a particular GPU and target.
The authors also express the task in terms of a score.
f: X × Y → ℝ
In this notation, f is the scoring function, X × Y denotes the pairing of feature and target spaces, and ℝ denotes real-valued scores. The arrow indicates that scoring yields a real value. The paper describes training as seeking a favorable score or, equivalently for its purposes, a low prediction error. In the evaluation, an error uses the observed label and the estimate derived from its features. Mean absolute percentage error is favorable when it is small. The criterion used to choose a split within a tree is a separate choice.
The distinction between features and targets makes the portability procedure concrete. To add another GPU within the scope of the method, the authors’ procedure keeps the workload feature vectors and obtains measurements on the additional device. An ensemble fitted to those measurements learns a new mapping from the same kinds of inputs. Hardware characteristics such as the number of SMs, the size of caches and the operating clocks can influence the measured outcomes and hence the fitted relationship. The predictor can reflect those characteristics without taking device specifications or a record of device state as input for each launch.
Count which instructions are executed
CUDA Flux, the profiler used in the study, collects statistics from PTX. PTX is an intermediate representation in the CUDA toolchain that can be used across the NVIDIA architectures of interest. The authors distinguish it from SASS, the GPU’s architecture-specific machine instructions. A count based on the latter could change when the same source is compiled for another GPU. A PTX-level description gives the authors a more stable basis for reuse, at the cost of omitting effects that emerge when the intermediate instructions are turned into device instructions.
A basic block is a straight-line region of code. CUDA Flux analyzes the instructions in each block and adds instrumentation to track how often threads execute the block. It instruments every thread in an observed launch. The instructions in the block provide the operation counts for an execution of that block, and the per-thread execution frequencies establish how often those counts contribute to the launch. This arrangement keeps the runtime information that must be recorded small. The profiler can reconstruct instruction totals from the execution frequencies and the block’s already known instruction mix.
For instance, a block on a branch contributes to the profile when threads actually travel down that branch. Blocks in a loop contribute according to how often they run. Thus the profile can reflect differences in executed work even for launches drawn from the same source code. The saved description is a set of counts and related launch properties, so it discards the order in which the blocks executed. It also discards the identity and grouping of the threads once their counts have been aggregated. Two launches can therefore show the same total activity while presenting the hardware with different execution patterns.
The authors call these features hardware-independent because they are collected at a level chosen for reuse across the GPUs in the study. Their execution frequencies still come from running an instrumented application. That distinction explains how the method can account for dynamic control flow at a broad level while using the resulting description for later predictions. A changed input that sends threads through different blocks can change the profile. The study’s portability procedure reuses the recorded profile for a corresponding workload, so its benefit comes from separating the acquisition of the profile from the repeated acquisition of device-specific counters.
Summarize the operations and memory traffic
CUDA Flux can distinguish many PTX instructions and their variants. Treating every variant as an independent input would give the learning procedure a much larger collection of features to estimate from the available examples. The authors group instructions into broader categories. The inputs used in their analysis include counts for arithmetic, special, logic, control and synchronization operations, along with the total instruction count. The grouping makes it possible to ask whether broad kinds of work are useful predictors and keeps the description small enough to inspect.
The arithmetic grouping ignores the width of the computation. The reasoning is that grouping different widths limits the number of input features and gives the training procedure more examples from which to learn broad relationships. The tradeoff is a loss of detail about what arithmetic resources a device may use. If the width of an operation matters for a given GPU, two launches can have comparable group counts even though their instructions make different demands on the hardware. The authors return to this issue when discussing support for reduced-precision arithmetic.
For memory operations, the study retains the consequence of width by estimating how much data is read or written. An operation that transfers more data contributes more to the volume. The profile records separate volumes for global, shared and parameter memory. The location where parameters are stored can depend on the implementation, and the authors describe registers and global memory as usual possibilities. A parameter-memory feature is therefore most directly understood as a description of program accesses. The connection to the physical resources used is part of what the fitting procedure has to learn.
The authors also include an arithmetic-intensity feature. It expresses arithmetic operations relative to data transfer volume, with the methodology describing global and local memory in connection with the ratio. The purpose is to expose a relationship that raw counts give separately. A launch with a comparatively large amount of arithmetic for its memory traffic has a different balance of activity from a launch dominated by transfers. The predictor also sees individual counts and volumes, so the ratio can help distinguish work mixes while the other features preserve information about the scale of the launch.
The launch configuration contributes grid size, block size and the amount of shared memory allocated for the launch. The reported fitted feature analysis uses the number of blocks, also called CTAs, and the number of threads per CTA. CTA stands for cooperative thread array, another name for a thread block. The counts tell the predictor how work was packaged before the GPU began to run it. They are distinct from measurements of how much of the machine was occupied or how often execution resources stalled.
There are several places where the abstraction deliberately stops. The features do not account for register spilling, in which register pressure causes values to be kept elsewhere. Spilling can depend on the device and its compilation. Cache hit rates are also excluded. A volume derived from the program’s memory instructions describes the data requested by those instructions, while a cache measurement would describe how a particular hardware execution satisfied the requests. Reusability depends on leaving observations of the latter kind to the device-specific target measurements.
Obtain comparable timing and power labels
For timing, the paper describes repeating measurements ten times to reduce the effect of unusual runs. The authors record the launches for each benchmark and input dataset, then match the timing records with the profiler records using the application, its input and the launch sequence. When the same kernel is launched repeatedly with identical parameters, the sample uses the median of the relevant timings. Launches with different arguments remain separate. This preserves meaningful differences within an application while reducing the weight of exact repetitions.
Measured durations range from a few microseconds to multiple seconds, with short launches much more common. The authors apply a logarithm to the time labels before fitting. The log transformation spreads out the dense lower part of the distribution relative to a scale measured in seconds and compresses the span occupied by the longest launches. It changes how the target is represented during learning. The final question remains how well a predicted duration agrees with the duration observed on the GPU.
Measuring power calls for a different procedure. The onboard sensor reports power at intervals, and a kernel can finish between updates. To measure power, the authors run the kernel in a loop for at least one second, with a CPU thread logging readings during the run. They average multiple readings for the kernel and repeat the power measurements ten times. The launch sequence again helps align the resulting measurements with the profile. The observed target for a short kernel is thus based on repeatedly executing it over a period long enough for the sensor to obtain readings.
A loop is useful only when repeating the work produces a meaningful measurement for that kernel. Later executions can depend on state changed by earlier ones. The authors compare outputs before and after inserting the measurement loop and exclude kernels for which the outputs differ. This makes the power data a more selective collection than the timing data. It also means the observed power pertains to the study’s repeated-execution procedure. Agreement with that observation is what the predictor is evaluated on.
The authors handle another form of repetition when a benchmark launches a kernel many times with slight changes to the arguments or launch configuration. Leaving all of those launches in the dataset would allow a few kernel families to account for a large share of examples. During random selection the authors cap the contribution at 100 samples for each application, problem size and kernel combination. A cap preserves some of the variations while limiting their influence. The authors treat this value as a compromise between keeping enough examples and avoiding excessive representation of a recurring routine.
Fit the predictions and measure the error
The prediction method is Extremely Randomized Trees Regression, as implemented in scikit-learn. A regression tree follows a succession of decisions about feature values. At a node it can test whether a value such as the number of threads per block lies on one side of a learned threshold. That decision selects the next node. A path ends at a leaf with an output value, and the collection of trees combines leaf outputs into an estimate. This lets a feature have a different predictive role in different regions of the data. A large memory volume, for example, can be treated differently in launches with different amounts of parallel work.
The authors use nested cross-validation to select settings and assess performance across different splits of the available examples. Cross-validation fits on some examples and evaluates on others, repeating the process with different partitions. In the nested procedure, the choice among hyper-parameter settings is itself based on validation. Hyper-parameters are choices that govern how the trees are built, such as how many trees the ensemble contains. The paper describes scoring combinations across splits and then evaluating the selected settings across splits, with different random initializations for repeated iterations. This gives a view of how much the score depends on the examples available for training.
The number of candidate features for a split can be set to max, log2 or sqrt. These settings use all features or reduce the candidate set according to the logarithm or square root of its size. The authors test mean squared error, MSE, and mean absolute error, MAE, as criteria for the quality of tree splits. They search ensemble sizes of 128, 256, 512 and 1024 estimators, where an estimator is a tree. Preliminary experiments led them to cap the search at 1024 because they considered larger settings more prone to overfitting in their data. The number of trees also matters for how long evaluation takes.
For timing, the authors design splits around the observed duration distribution. They always keep the five longest-running samples in training for these splits because the predictor cannot produce estimates outside the range of targets it has learned. They also try to balance the portions of short, medium and long runs across splits. The paper specifies short runs as t<1,000us, medium runs as 1,000us<=t<100,000us and long runs as t>100,000us, with t representing measured kernel time. A split that leaves the longest examples in training answers a question about prediction with coverage at the top of the training range. The separate leave-one-out investigation shows what can happen when even an extreme example must be left out.
The main score divides the magnitude of the error for each example by that example’s observed target and then averages across examples.
MAPE = (1/n) ∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ| / yᵢ
MAPE stands for mean absolute percentage error. The symbol n is the number of examples being scored, and i indexes them from 1 through n. The summation sign ∑ adds the relative errors. For example i, yᵢ is the observed value and ŷᵢ is its prediction. The bars give the absolute magnitude of their difference, and division by yᵢ expresses that magnitude relative to the observation. The prefactor 1/n makes the sum a mean. As written in the paper, the formula gives a fraction, and the results are expressed as percentages.
The denominator matters particularly for time. The same absolute difference can be a substantial error for a brief launch and a negligible one for a long launch. The authors wanted the score to reflect both. Using absolute differences in the numerator also means that underestimates and overestimates both count as errors. Squaring absolute differences in the original units would emphasize large misses on long runs. Relative error gives short runs a stronger voice in evaluation, which also makes timing noise on those runs more consequential.
Experiments and results
The benchmark collection and devices
The experiments use Rodinia 3.1, Parboil 2.5, Polybench-GPU 1.0 and SHOC. The workloads cover regular computations as well as irregular ones. Rodinia’s breadth-first search and b+tree workloads, and SHOC’s breadth-first search, are examples the authors identify as irregular. The comparison is therefore broader than a test restricted to regular array operations. The instrumentation and measurement requirements still determine which applications can contribute to each target. Evaluation and benchmarks
Some applications use texture memory, which the LLVM-based CUDA Flux workflow could not handle in the study. Others encounter compilation problems, unstable behavior or library calls that the authors could not instrument. Within the usable applications, the authors modify some benchmarks to support larger problem sizes and bring certain kernel definitions and calls into the same compilation module. Different problem sizes create different examples even when they use the same kernel. Larger sizes can also make the associated power measurements easier to obtain.
The paper’s comparative overview reports 189 kernels for timing and 168 for power. These are kernel counts. The measurement procedure can produce more than one sample for a kernel when problem sizes or arguments change. Conversely, repeated measurements of identical launches can contribute to a single aggregated sample. The difference between the timing and power collections is visible in particular applications. Rodinia’s b+tree and gaussian and SHOC’s FFT and Sort, for example, are listed as usable in the collection but excluded for power prediction.
The devices cover NVIDIA’s Kepler, Pascal, Volta and Turing architectures. The K20, Titan Xp, P100 and V100 were tested at fixed clocks. The GTX1650 could not be held at fixed frequencies in the setup and was evaluated with variable clocks. The sensor update rates also differed by GPU. The paper reports a power sampling frequency of 73.6 Hz on the K20 and 10.9 Hz on the GTX1650. These rates describe how often power readings could be obtained in the study. They help explain why isolated short executions could offer little usable power data.
What the K20 case study reveals
The authors start with the K20 because its lower compute capacity stretches out some execution times and gives them a better duration distribution for this part of the analysis. They repeated nested cross-validation for timing over 30 iterations with different randomized splits. Across those iterations, the means of the timing errors were between 12.11% and 19.37% MAPE. That range describes the reported mean score at the level of an iteration. The device comparison below instead uses medians of individual fold scores, so the K20 number there summarizes a different distribution.
The case study also uses leave-one-out evaluation. For each sample, the predictor is fitted to the other examples and asked to estimate the omitted one. The settings come from the nested cross-validation procedure. This produces an estimate for each sample without using that sample in the corresponding fit and allows the authors to inspect errors that could be concealed by an average. The plots compare measured and predicted values, while the error distribution shows how many examples fall into different ranges of relative error.
For K20 timing in leave-one-out evaluation, about 82% of samples have relative error between 0 and 10%, and about 8% fall between 10% and 25%. At the other end of the distribution, about 2% have errors greater than 100%. Large errors therefore coexist with a considerable concentration near the measured values. In the scatter plot, launches at the upper end of measured time are generally underestimated. A long launch that is rare in the full dataset can become rarer still in the relevant training set when its own observation is removed.
Power scores on the K20 have a much narrower reported span. Its nested cross-validation results lie between 1.72% and 1.97% MAPE across iterations. In leave-one-out evaluation, 92% of the K20 power samples are within 0 to 5% of the measured value. The authors suggest that the range of targets helps explain the difference between the tasks. Power readings span fewer orders of magnitude than durations, and the measurement procedure averages readings from repeated executions. The comparison concerns these observed targets and procedures, so it gives a concrete account of the difference without isolating a single cause.
How errors change across GPUs
For the cross-device comparison, the authors show the distributions of individual held-out fold errors from nested cross-validation. This exposes a poorly predicted fold even if other folds from the same iteration performed well. The median of those fold scores is the central comparison in the two charts.
Median timing MAPE across GPUs on the CUDA benchmark kernels
The fitted predictor for the P100 has the lowest median timing error, and the GTX1650 has the highest.
The numbers
| System or setting | MAPE % |
|---|---|
| K20 | 13.86 |
| Titan Xp | 10.95 |
| P100 (this paper) | 8.86 |
| V100 | 10.89 |
| GTX1650 | 52.0 |
The GTX1650 also has a wide spread of timing errors. Its third quartile of fold MAPE is 99.23%, so the distribution includes many folds with error substantially above the median. The histograms still show GTX1650 folds with low error. In the leave-one-out plot, this device has a larger concentration of short measured times than the others. The authors consider variable clocks, the accuracy of short-duration measurements and examples with few close counterparts in training as possible contributors to the poor results. The experiment compares devices with several differences at once.
Median power MAPE across GPUs on the CUDA benchmark kernels
Median power errors remain close across the tested devices, with the lowest score on the K20.
The numbers
| System or setting | MAPE % |
|---|---|
| K20 (this paper) | 1.84 |
| Titan Xp | 2.21 |
| P100 | 2.94 |
| V100 | 2.30 |
| GTX1650 | 2.33 |
The power comparison changes the ordering of devices. The P100 gives the lowest median error for time and the highest for power, while the GTX1650’s unusually high timing error has no counterpart in its median power result. Each task has its own fitted predictor and ground truth. Stable fold medians for power show that the reusable descriptions can estimate the measured average power across the devices under this procedure. They provide a separate result from successful timing prediction on any of those devices.
The power leave-one-out plots point to a specific failure mode. The authors found outlying examples whose recorded feature vectors were identical even though the observed power differed. A predictor using only those features receives the same input for both, so it has no basis in the input for reproducing both observed values. Additional features or more stable measurements could address different explanations for such a collision. The experiment identifies the ambiguity in the recorded inputs and labels, while leaving open which physical or measurement factors produced it.
Prediction time and the simulation comparison
For the latency experiment, evaluation is timed using an Intel Xeon E5-2667 v3 CPU running at a clock speed of 3.2 GHz. For timing, the settings chosen for the fixed-clock GPUs use 512 trees, all features as candidates and MAE to judge splits. Their reported average prediction latencies range from 106.91 ms on the V100 predictor to 108.65 ms on the Titan Xp predictor. The GTX1650 timing predictor uses 256 trees and MSE with all features available. Its reported average latency is 107.46 ms. These measurements apply to the fitted settings on that host processor.
The selected power predictors show a wider latency range. The Titan Xp predictor averages 15.32 ms, and the K20 predictor averages 15.36 ms. Both use 256 trees. The P100 power predictor uses 512 trees and averages 30.14 ms. The V100 and GTX1650 power predictors use 1024 trees and average 60.58 ms and 59.20 ms respectively. The authors discuss tree count and the depth of the trees as factors in the amount of work the prediction requires. The observed times concern evaluation of the ensemble after features have been collected and fitting has finished.
The paper discusses earlier systems separately from its main cross-validation. The earlier PTX deep structured learning approach uses instruction sequences and information about dependencies, and considers dynamic voltage and frequency scaling. It handles loops through unrolling in the preprocessing described by the authors. PPT-GPU, the comparison the authors ran, combines event-based simulation with analytical prediction. These approaches give context for the paper’s choice to represent a launch through executed instruction counts. The five-device fold results come from tests of the paper’s own procedure.
The authors ran a publicly available version of PPT-GPU on Polybench-GPU. That version lacked the cache component described for PPT-GPU in its paper, and gave a timing MAPE of 433.8% on that suite. Braun and colleagues also evaluated their own approach with Polybench-GPU as the test suite and the remaining applications as training data, yielding timing MAPE of 218.6%. Holding out a full suite changes the question substantially from predicting a random held-out fold in the mixed collection. Both reported errors are high for this comparison, and the authors qualify it because of the incomplete simulator configuration and the change to the learning protocol. They report that their prediction is faster than the simulation in this comparison without giving a common quantitative latency benchmark for the two methods.
What the ablations show
The paper has no feature-removal ablation, but it does analyze feature importance, sensitivity to held-out examples, measurement variability and the effects of changing the evaluation split.
Which inputs the trees rely on
The feature-importance analysis asks which inputs the fitted trees prioritize when making decisions. A feature’s use in the structure of the trees, especially near the start of decision paths, can help indicate how much the predictions depend on it. The resulting numbers apply to fitted ensembles on the available features and examples. Two features can carry related information, and a strong rank for one can reflect how the trees use it in that particular collection. This analysis therefore shows where the trained predictor finds useful distinctions. The paper supplies no measured accuracy for a predictor rebuilt with just the highest-ranked inputs.
The most consistent timing result is that threads per block ranks first on every device. Its reported importance for time is 23.19% on the K20 and 29.62% on the V100. Global memory volume also ranks near the top throughout. Taken together, these observations are consistent with timing depending heavily on how a launch supplies work to the GPU and how much global memory traffic the program requests. The number of blocks is another prominent feature on several devices. The authors relate its role to the number of SMs available to receive blocks.
There is useful variation within that overall pattern. Parameter memory volume is relatively influential for timing on the K20, where its reported importance is 20.14%. Global memory volume is particularly prominent on the Titan Xp and P100, with a reported importance of 16.30% for each. The authors also describe the concentration across the timing predictors. The top 5 features account for 73.73% of importance for the GTX1650 and 69.75% for the Titan Xp, with the other tested devices between those reported values. Even the GTX1650’s relatively poor timing fit places much of its learned importance on a small group of inputs. Concentration of importance and predictive accuracy are different observations.
The power ranks are more varied. Block count, threads per block and parameter memory volume have substantial importance, with the ordering changing across devices. On the Titan Xp, for example, threads per block has a power importance of 24.70%. On the V100, parameter memory volume has an importance of 27.45% and block count has an importance of 20.26%. The authors interpret the prominence of launch geometry as consistent with the amount of hardware that the workload keeps active. The individual rankings also leave room for differences in the work that drives power on different devices.
The collection of leading inputs is broader for power than for time. Across devices, the top 7 timing inputs comprise 8 distinct features, while the top 7 power inputs comprise 11. The paper observes that the total instruction count contributes more strongly to timing than to power. Duration can depend substantially on how many instructions the launch performs. The kind of instructions, and thus the resources active during execution, can matter more for distinguishing power. This is an interpretation of the rankings. The experiments do not independently vary instruction categories while keeping all other activity constant.
The authors also observe that global memory volume generally has less importance for power than for time and suggest a possible explanation in the memory subsystem’s power behavior. Power could have a relatively stable component while the GPU stays active. The analysis has no separate power measurements for memory and execution units that could test this explanation directly. The safe reading is narrower. The same instruction and data movement summaries support both targets, and the fitted forests use these summaries differently.
When evaluation puts the training coverage under pressure
The leave-one-out timing analysis gives a direct view of what happens to examples near the edge of the data. A long-running kernel may have few comparable examples. Holding it out can remove the only observation at its duration or one of the few examples near it. The tree ensemble estimates within the span of the training targets, so a prediction for the most extreme held-out run is pulled back towards shorter observed durations. This explains the direction of the misses at the upper end of the plots. It also explains the authors’ decision to retain the longest timing samples in the nested splits.
At the short end, the authors examine variation across repeated measurements using the coefficient of variation, which expresses spread relative to the mean. Their plot shows more relative variability among short executions. Runs longer than 1 ms generally have lower variability in the reported analysis. The paper notes that CUDA drivers can add about 1-50 us of delay depending on the configuration and the way executions are repeated. That scale of delay can matter for a very short launch, particularly when evaluation divides the prediction error by the observed duration.
The power measurement analysis also uses the coefficient of variation. The paper describes variation generally below 5% in its repeated power measurements. This is evidence about repeatability under the measurement procedure. It does not independently establish that the onboard sensors report the exact physical power of the GPU or that isolated brief launches would have the same average. The contrast with the timing variability helps explain why very small median power errors are plausible for these labels, while leaving sensor accuracy and the choice of measurement conditions as separate questions.
Holding out Polybench-GPU supplies a different probe of training coverage. A random held-out sample may resemble training examples from its own benchmark or the same kind of computation. Holding out the entire suite removes all of its examples from the fitting data. The large error in that evaluation shows how strongly the answer can change when the partition asks for a harder kind of transfer. The experiment supplies one such partition. It does not measure a distribution over many held-out suites and cannot establish how much of the error comes from any particular property of Polybench-GPU.
Limitations
Limits the authors identify
The paper identifies the workload distribution as a central limitation. The benchmark suites supply many short launches and comparatively few long ones. Very short times are harder to measure reliably, while the longer runs are harder to learn because they are scarce. Those are distinct problems. More repeat measurements can clarify variability on a short kernel, while more examples of different long kernels could improve coverage at the upper end. The authors suggest synthetic workloads with controllable duration and parallelism as one possible way to broaden the collection. They report that as future work.
The tested kernels also vary in how much of the GPU their launch configurations can use. The authors estimate that 14.59% of GTX1650 launches and 56.08% of V100 launches do not use all available SMs when register usage is ignored. The percentages characterize the launch configurations in the study under that simplifying assumption. They do not directly measure utilization during execution. The authors see better coverage of highly parallel work as valuable, particularly for devices whose larger complement of SMs may be difficult to exercise with the recorded launches.
Power has an additional selection limit. If looping a data-dependent kernel changes its output, the repeated execution no longer supplies the kind of observation sought in the experiment. The authors leave those kernels out of the power collection. Others are excluded because of compilation, instrumentation or stability problems. In consequence, the power scores are based on workloads for which the measurement method could obtain labels judged suitable for learning. The analysis cannot establish the same accuracy for the excluded launches.
Feature design also limits which changes the predictor can recognize. The authors propose accounting for computational widths, including 16bit floating-point and 8bit integer operations. They also discuss features that could reflect divergence, shared memory bank conflicts and the organization of global memory accesses. Two launches can make similar requests in aggregate yet incur different costs depending on how those requests are ordered and how threads contend for resources. The instrumented histogram preserves the amount of activity to a useful degree, while descriptions of these execution patterns would provide information that the fitted trees currently lack.
The hyper-parameter search also has a bounded scope. The authors say that a broader search and regularization might improve accuracy, although searching for settings that also keep prediction latency small could be expensive with their training method. They propose reducing the number of features or trees as ways to make predictions faster. The paper provides latency measurements for the chosen configurations. It leaves the achievable balance between improved latency and accuracy open because it did not measure the full range of reduced configurations.
Finally, the paper makes its portability claim within CUDA. The use of PTX allows the authors to reuse features among the NVIDIA GPUs studied and to collect only new target labels for a further device within that workflow. Other programming environments and devices would require a corresponding way to obtain compatible workload descriptions and to match them with measurements. The authors treat this as a practical limitation of the implementation. The experiments demonstrate reuse within their workflow.
Limits visible in the evaluation design
The cross-validation principally tests unseen samples drawn from the collected workloads. Because samples can describe different arguments or problem sizes for the same kernel, a held-out sample can have a related launch in training. The sample cap limits the influence of heavily repeated kernels without changing that basic split design. A scheduler asked to predict an entirely unfamiliar application needs a different form of evidence. The Polybench-GPU holdout is closer to that question and shows a much less favorable error under its particular partition.
Timing validation also deliberately gives the predictor access to the longest examples for the custom nested splits. That choice is sensible for testing within a represented range, but a deployment could encounter the longest workload only after training. The leave-one-out results show how the longest runs can then be underestimated. A timing median from the nested validation should therefore be read in light of how the train and test folds were formed. It is strongest as evidence about held-out examples in a collection for which the upper part of the range already has labels.
The relationship between variable clocks and the GTX1650 timing error is plausible, but the devices also differ in architecture, resources and measurement behavior. This study has no paired comparison in which the same GTX1650 workload is evaluated at fixed and variable frequencies. The data support the observed difference in timing predictability and identify factors that may contribute. The share of the difference due to clock variability cannot be read from the reported MAPE. The similarly low GTX1650 power median reflects an average measured by another procedure and leaves the timing explanation open.
The latency measurements likewise have a specific boundary. Evaluating a forest takes the reported time once the input vector is ready. Obtaining a first profile, fitting on device-specific labels and integrating estimates into a scheduler are separate costs. The paper discusses scheduling ahead of execution and overlapping a decision with current work, which could make the measured latencies acceptable for some workloads. It reports no deployed scheduler experiment measuring the effect on completion time or throughput. Whether the estimate pays for itself depends on such factors as how frequently features can be reused and how much time is available before a placement decision.
The two target measurements should also retain their original meanings. The power score describes agreement with sensor readings averaged during repeated execution. The timing score describes agreement with measured launch durations. These results do not by themselves measure energy use, the effect of changing placement on system-wide power or whether a predictor selects the best device for a particular task. The evidence is most direct for the stated prediction problem. A portable description of a profiled launch is often sufficient for estimating the measured targets after calibration on the destination GPU, with accuracy depending on the target, the device and the availability of comparable training examples.
What came after
No later studies are documented here. The paper’s directions for follow-up are to collect more long-running and highly parallel workloads, represent execution effects that instruction totals miss, and measure how changes to the tree ensemble affect both error and prediction latency. Those proposals remain open directions in the paper.
Cite
Cite as Lorenz Braun, Sotirios Nikas, Chen Song, Vincent Heuveline and Holger Froning. 2020. A Simple Model for Portable and Fast Prediction of Execution Time and Power Consumption of GPU Kernels. arXiv:2001.07104.
@misc{braun2020simple,
title = {{A Simple Model for Portable and Fast Prediction of Execution Time and Power Consumption of GPU Kernels}},
author = {Lorenz Braun, Sotirios Nikas, Chen Song, Vincent Heuveline and Holger Froning},
year = {2020},
doi = {10.48550/arxiv.2001.07104},
eprint = {2001.07104},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2001.07104}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/braun-2020-simple-model-portable-fast-prediction/