[论文解读] HDCC: A Hyperdimensional Computing compiler for classification on embedded systems and high-performance computing
HDCC 是一个开源编译器,将高维计算(Hyperdimensional Computing)分类任务翻译成优化的独立 C 代码,使嵌入式和 HPC 环境能够实现多线程和 SIMD 加速执行,结果可重复,与 Torchhd 相比有显著加速。
Hyperdimensional Computing (HDC) is a bio-inspired computing framework that has gained increasing attention, especially as a more efficient approach to machine learning (ML). This work introduces the ame{} compiler, the first open-source compiler that translates high-level descriptions of HDC classification methods into optimized C code. The code generated by the proposed compiler has three main features for embedded systems and High-Performance Computing: (1) it is self-contained and has no library or platform dependencies; (2) it supports multithreading and single instruction multiple data (SIMD) instructions using C intrinsics; (3) it is optimized for maximum performance and minimal memory usage. ame{} is designed like a modern compiler, featuring an intuitive and descriptive input language, an intermediate representation (IR), and a retargetable backend. This makes ame{} a valuable tool for research and applications exploring HDC for classification tasks on embedded systems and High-Performance Computing. To substantiate these claims, we conducted experiments with HDCC on several of the most popular datasets in the HDC literature. The experiments were run on four different machines, including different hyperparameter configurations, and the results were compared to a popular prototyping library built on PyTorch. The results show a training and inference speedup of up to 132x, averaging 25x across all datasets and machines. Regarding memory usage, using 10240-dimensional hypervectors, the average reduction was 5x, reaching up to 14x. When considering vectors of 64 dimensions, the average reduction was 85x, with a maximum of 158x less memory utilization.
研究动机与目标
- 提供一个自包含、无依赖的 HDC 分类 C 实现,适用于嵌入式系统和 HPC。
- 为 HDC 学习任务提供一个现代编译器流水线(标记器、语法、IR、可重定位后端)。
- 通过 C 内在函数实现多线程和 SIMD,以最大化性能并最小化内存使用。
- 确保开源可用性,并具有可重复的实验和数据。
提出的方法
- HDCC 以 HDC 学习任务的高层描述作为输入,并将其转化为包含编码、训练和推理组件的 HDC 学习模型。
- 编译器使用 MAP(Multiply-Add-Permute)超空间及打包(bundling)和绑定(binding)操作用于编码和处理。
- 嵌入可以是随机的或层级初始化,编码模式如 MULTIBUNDLE、NGRAM 和 BATCHBIND;实现对编码进行内存与速度优化。
- 训练通过对编码样本进行打包来更新联想内存;推理使用余弦相似度将查询超向量与类别原型进行比较,训练后的归一化以加速推理。
- 它支持 SIMD 向量内嵌、通过 POSIX 线程实现多线程,以及一种以流式方式读取数据并降低编码引起的内存使用的内存高效方法。
- 后端可回定位以生成 C 代码,并且可以通过 OpenCL/OpenGL 后端扩展到 FPGA/GPU。
实验结果
研究问题
- RQ1开源编译器是否能够为具有嵌入式系统约束的 HDC 分类任务生成高效、自包含的 C 代码?
- RQ2HDCC 生成的实现与 Torchhd 在多数据集和高维空间维度下的训练/推理速度和内存使用方面的比较?
- RQ3多线程和 SIMD 对 HDCC 生成的 HDC 分类器在性能和内存占用方面的影响?
- RQ4该方法对不同数据集(ISOLET、EMG、语言识别、MNIST)和硬件平台的可迁移性如何?
- RQ5复现实验并将编译器扩展到其他向量符号体系结构的实际步骤是什么?
主要发现
- 在使用 10240-dimension 超向量相对于 Torchhd 时,HDCC 在跨数据集和多台机器上实现了高达 132x 的训练和推理加速,平均约 25x。
- 与 Torchhd 相比,内存使用平均降低 5x,10240 维时降幅达 14x;在 64 维向量时,平均降幅可达 85x,最大降幅 158x。
- HDCC 生成的代码是自包含的(无外部依赖),并为低内存和高吞吐进行优化,适用于嵌入式 CPU 和 HPC 系统。
- 与 Torchhd 相比,HDCC 在 ISOLET、EMG、欧洲语言和 MNIST 数据集上显示出相似的准确度,同时带来显著的速度和内存优势。
- 在四台机器(包括 Apple M2 和 Intel Xeon 平台)上进行多维设置(64–10240)的实验,展示了对硬件的鲁棒性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。