Abstract
Statistical machine learning often uses probabilistic algorithms, such as Markov Chain Monte Carlo (MCMC), to solve a wide range of problems. Probabilistic computations, often considered too slow on conventional processors, can be accelerated with specialized hardware by exploiting parallelism and optimizing the design using various approximation techniques. Current methodologies for evaluating correctness of probabilistic accelerators are often incomplete, mostly focusing only on end-point result quality ("accuracy"). It is important for hardware designers and domain experts to look beyond end-point "accuracy" and be aware of the hardware optimizations impact on other statistical properties. This work takes a first step towards defining metrics and a methodology for quantitatively evaluating correctness of probabilistic accelerators beyond end-point result quality. We propose three pillars of statistical robustness: 1) sampling quality, 2) convergence diagnostic, and 3) goodness of fit. We apply our framework to a representative MCMC accelerator and surface design issues that cannot be exposed using only application end-point result quality. Applying the framework to guide design space exploration shows that statistical robustness comparable to floating-point software can be achieved by slightly increasing the bit representation, without floating-point hardware requirements.
Introduction
Markov Chain Monte Carlo (MCMC) algorithms are fundamental to statistical machine learning, supporting applications ranging from image segmentation to robotics. Due to the high computational cost of these algorithms on standard CPUs, specialized hardware accelerators have been developed. These accelerators often employ "approximations"—such as reduced bit-widths, truncated values, or simplified random number generators—to optimize for power and area.
Traditionally, these accelerators are evaluated based on "end-point accuracy": whether the final output matches that of high-precision (FP64) software. However, in probabilistic computing, the path to the result is as critical as the result itself. An accelerator might produce a seemingly correct answer while suffering from highly correlated samples or poor convergence. Such failures can be catastrophic in safety-critical domains like medical imaging, where understanding uncertainty is paramount.
The Three Pillars of Statistical Robustness
To address these shortcomings, this research proposes a framework based on three pillars of statistical robustness, adapting classical metrics for high-dimensional hardware constraints:
- Sampling Quality: Measured via Effective Sample Size (ESS), which quantifies the number of independent samples generated. The authors modified this metric to account for "inactive" variables—those with zero variance due to hardware truncation—which typically break standard statistical formulas.
- Convergence Diagnostic: Based on the Gelman-Rubin $\hat{R}$ metric. The framework introduces Convergence Percentage, representing the fraction of variables in a high-dimensional set (e.g., pixels in an image) that have successfully converged.
- Goodness of Fit: Evaluated using Root Mean Squared Error (RMSE) for application data and Jensen-Shannon Divergence (JSD) for data-independent analysis. JSD measures the divergence between the hardware’s probability distribution and the software’s, exposing biases introduced by hardware optimizations.
Experimental Evaluation
The framework was applied to a representative MCMC accelerator, the Stochastic Processing Unit (SPU). Evaluation was conducted across two computer vision tasks using the Middlebury benchmark:
- Stereo Vision: Datasets included art, poster, and teddy.
- Motion Estimation: Datasets included dimetrodon, rubberwhale, and venus.
Key Results and Insights
The evaluation revealed that "accuracy" often masks underlying statistical deficiencies. For instance, the baseline SPU achieved software-level accuracy but required 2× more iterations to reach comparable convergence, effectively halving its performance gains.
Hardware approximations, such as truncating small probabilities to zero, create "inactive" variables that bias the resulting distribution. Interestingly, limited-precision hardware occasionally produced better end-point results than FP64 software when compared to ground truth, further proving that "accuracy" is an unreliable proxy for architectural correctness.
Design space exploration identified a "sweet spot" at a 6-bit probability representation. By increasing the bit-width from 4 to 6 bits and removing specific truncation approximations, the hardware matched the statistical robustness of FP64 software. This optimized ASIC design incurred only a 20% increase in area and a 10% increase in power, avoiding the need for expensive floating-point hardware.
Conclusion
This work demonstrates that evaluating probabilistic accelerators requires looking beyond application-level accuracy. By quantifying sampling quality, convergence, and goodness of fit, designers can build more robust and reliable specialized hardware. Future research will focus on extending these metrics to more complex models and investigating the impact of pseudo-random number generator (PRNG) quality on MCMC performance.
Summary updated