Binary spatter code (BSC)-based hyperdimensional computing (HDC) is a highly error-resilient approximate computational paradigm suited for error-prone, emerging hardware platforms. In BSC HDC, the basic datatype is a hypervector, a typically large binary vector, where the size of the hypervector has a significant impact on the fidelity and resource usage of the computation. Typically, the hypervector size is dynamically tuned to deliver the desired accuracy; this process is time-consuming and often produces hypervector sizes that lack accuracy guarantees and produce poor results when reused for very similar workloads. We present Heim, a hardware-aware static analysis and optimization framework for BSC HD computations. Heim analytically derives the minimum hypervector size that minimizes resource usage and meets the target accuracy requirement. Heim guarantees the optimized computation converges to the user-provided accuracy target on expectation, even in the presence of hardware error. Heim deploys a novel static analysis procedure that unifies theoretical results from the neuroscience community to systematically optimize HD computations. We evaluate Heim against dynamic tuning-based optimization on 25 benchmark data structures. Given a 99% accuracy requirement, Heim-optimized computations achieve a 99.2%-100.0% median accuracy, up to 49.5% higher than dynamic tuning-based optimization, while achieving 1.15x-7.14x reductions in hypervector size compared to HD computations that achieve comparable query accuracy and finding parametrizations 30.0x-100167.4x faster than dynamic tuning-based approaches. We also use Heim to systematically evaluate the performance benefits of using analog CAMs and multiple-bit-per-cell ReRAM over conventional hardware, while maintaining iso-accuracy -- for both emerging technologies, we find usages where the emerging hardware imparts significant benefits.
翻译:基于二元散列码(BSC)的超维计算(HDC)是一种高度容错的近似计算范式,适用于易出错的新兴硬件平台。在BSC HDC中,基本数据类型是超向量(一种通常规模较大的二元向量),超向量的尺寸对计算精度与资源消耗具有显著影响。传统方法通过动态调优超向量尺寸以匹配目标精度,但该过程耗时且难以保证精度,尤其当重复用于相似负载时效果不佳。我们提出Heim——一种面向BSC HD计算且具备硬件感知能力的静态分析与优化框架。Heim通过解析方法推导出满足目标精度要求且资源消耗最小的超向量最小尺寸,可保证优化后的计算在预期精度上收敛至用户设定目标(即使存在硬件误差)。该框架采用融合神经科学领域理论成果的新型静态分析流程,系统性优化超维计算。我们在25个基准数据结构上,将Heim与基于动态调优的优化方法进行对比:在99%的目标精度要求下,经Heim优化的计算中位精度达99.2%-100.0%,较动态调优提升最高49.5%;超向量尺寸较同等查询精度的HD计算缩减1.15-7.14倍,参数寻优速度提升30.0-100167.4倍。我们进一步利用Heim系统评估了在保持等精度条件下,使用模拟CAM和多比特单元ReRAM较传统硬件的性能优势——对于这两种新兴技术,我们均发现了其带来显著效益的应用场景。