论文

在 ESP32-P4 上跑 Kroko 流式语音识别:2/4 比特量化的 65.7M 参数 Transducer

Streaming Speech Recognition on a Microcontroller: a 65.7M-Parameter Transducer in 2 and 4 Bits on the ESP32-P4

精选理由

有人在没神经加速器的 ESP32-P4 芯片上跑通了 65.7M 参数的流式语音识别,权重压到 26.65 MB,还开源了引擎和固件,玩嵌入式的朋友可以看看。

Kroko 是一个 65.7M 参数的流式 Zipformer2 英语语音识别模型,被部署到无神经加速器的 ESP32-P4 微控制器上。通过 Hadamard 旋转分组并结合 GPTQ 的 2/4 比特量化,71 MB 的 int8 权重被压缩到 26.65 MB。手写 PIE SIMD 内核让每 1.28 秒音频块在双核上 0.90 秒内处理完,含束搜索。LibriSpeech test-clean 词错率为 4.34%(原模型 3.94%),test-other 为 10.26%(原模型 9.17%)。推理引擎、固件和量化权重已在 GitHub 开源。

原文 · arXiv cs.LG

Streaming Speech Recognition on a Microcontroller: a 65.7M-Parameter Transducer in 2 and 4 Bits on the ESP32-P4

We run Kroko, a 65.7M-parameter streaming Zipformer2 transducer for English, on the ESP32-P4, a microcontroller with two 400 MHz RISC-V cores, a 128-bit SIMD extension (PIE) and 32 MB of PSRAM, but no neural accelerator. Without any training, the encoder's 290 matrices are stored with 2 or 4 bits per weight in Hadamard-rotated groups: the width of each matrix comes from its measured sensitivity, and each matrix is first corrected toward the original model's output, then rounded with GPTQ and a search over the group norms. The released 71 MB of int8 weights become a 26.65 MB file. Activations are int16 between the matrix products and int8 into them. A C engine with hand-written PIE kernels processes each 1.28 s chunk of audio in 0.90 s on both cores, beam search included, and its PC build computes the same bits as the chip, so accuracy is measured on whole test sets. LibriSpeech WER is 4.34% on test-clean and 10.26% on test-other, against 3.94% and 9.17% for the released model; on FLEURS and Common Voice the gap grows to 2.3 and 1.1 points. A GPU simulator shows that the integer arithmetic costs nothing and that the whole gap comes from the weights, and an ablation on all of test-clean shows that GPTQ does most of the work. We also report the port's speed history, from 51.3 s to 0.62 s of encoder time per chunk, each design step measured again in one build, an attempt to reach 16 MB that stopped at 19.63 MB, and what did not work. We did not measure energy. The inference engine, the firmware and the 2/4-bit weights are available at https://github.com/BoumedineBillal/esp32-pie-asr.