Cryptonite: Neural Network Inference on the ESP32 RSA Accelerator
Many microcontrollers include a big-integer multiplier for public-key cryptography, and it sits idle whenever the chip is not running public-key operations. We test whether it can run int8 keyword-spotting (KWS) networks on the ESP32, a low-power, affordable, and widely available microcontroller whose RSA accelerator multiplies integers up to 2048 bits. Kronecker packing fits many small multiplies into one 2048-bit multiply, a cost model planner chooses the packing for each layer, a direct register driver cuts about 20 to 37 µs of overhead off every multiply, and the CPU prepares the next job while the multiplier runs. On ten KWS networks from Speech Commands v0.02, these optimizations reduce total accelerator time from 171 s to 31 s (with 4-bit weights), but the accelerator is still slower than an optimized int8 CPU kernel (14.6 s). The reason is that a network layer uses only about 2% of the products each multiply computes. Long 1-D filters use all of them: with 128 taps and 4-bit data, the accelerator is 2.90× faster than the best CPU kernel on two cores, and measured on the board's supply it uses 2.8× less energy per clip. Retraining the ten networks with a 128-tap filter front end makes them 1.26× faster than two CPU cores with 1.27× less energy, at a cost of 2.1 to 7.3 accuracy points.
Authors
- Wyatt Beaulieu
- James Strong
- Ankush Achwani
Institutions
- University of Massachusetts Amherst (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-02
- DOI
- https://doi.org/10.5281/zenodo.24737858
- Primary Topic
- Advanced Neural Network Applications
- Type
- preprint