Hyperdimensional Computing (HDC), a technique inspired by cognitive models of computation, has been proposed as an efficient and robust alternative basis for machine learning. HDC programs are often manually written in low-level and target specific languages targeting CPUs, GPUs, and FPGAs - these codes cannot be easily retargeted onto HDC-specific accelerators. No previous programming system enables productive development of HDC programs and generates efficient code for several hardware targets. We propose a heterogeneous programming system for HDC: a novel programming language, HDC++, for writing applications using a unified programming model, including HDC-specific primitives to improve programmability, and a heterogeneous compiler, HPVM-HDC, that provides an intermediate representation for compiling HDC programs to many hardware targets. We implement two tuning optimizations, automatic binarization and reduction perforation, that exploit the error resilient nature of HDC. Our evaluation shows that HPVM-HDC generates performance-competitive code for CPUs and GPUs, achieving a geomean speed-up of 1.17x over optimized baseline CUDA implementations with a geomean reduction in total lines of code of 1.6x across CPUs and GPUs. Additionally, HPVM-HDC targets an HDC Digital ASIC and an HDC ReRAM accelerator simulator, enabling the first execution of HDC applications on these devices.
翻译:超维计算(HDC)是一种受认知计算模型启发的技术,已被提出作为机器学习的高效且鲁棒的替代计算范式。现有的HDC程序通常采用面向CPU、GPU和FPGA的低层特定目标语言手动编写,这些代码难以移植到HDC专用加速器上。此前尚无编程系统能够支持HDC程序的高效开发并为多种硬件目标生成高性能代码。本文提出一种面向HDC的异构编程系统:包含新型编程语言HDC++(支持通过统一编程模型编写应用程序,提供HDC专用原语以提升可编程性)以及异构编译器HPVM-HDC(通过中间表示实现HDC程序向多硬件目标的编译)。我们实现了两种调优优化——自动二值化与约减穿孔,以利用HDC固有的容错特性。实验评估表明,HPVM-HDC能为CPU和GPU生成具有性能竞争力的代码,在GPU上较优化后的CUDA基准实现获得1.17倍的几何平均加速比,同时在CPU和GPU平台上实现总代码行数1.6倍的几何平均缩减。此外,HPVM-HDC支持以HDC数字ASIC和HDC ReRAM加速器模拟器为目标平台,首次实现了HDC应用在这些设备上的运行。