cpldcpu/BitNetMCU
Neural Networks with low bit weights on low end 32 bit microcontrollers such as the CH32V003 RISC-V Microcontroller and others
What it solves
BitNetMCU enables high-accuracy neural networks to run on extremely low-end microcontrollers (such as the CH32V003) that have very limited memory (e.g., 2KB RAM and 16KB Flash) and may lack hardware multiplication instructions.
How it works
The project uses a PyTorch-based training pipeline that employs Quantization Aware Training (QAT) and fine-tuning of the model structure. This allows the model to be compressed into low-bit formats (including binary, ternary, 2-bit, 4-bit, 8-bit, and NF4). The trained weights are exported to ANSI-C code, which provides a portable inference engine capable of running on various MCU architectures, including those without hardware multipliers.
Who it’s for
Embedded developers and AI researchers focusing on TinyML, specifically those needing to deploy neural networks on highly resource-constrained RISC-V or ARM Cortex-M0 microcontrollers.
Highlights
- Extreme Memory Efficiency: Achieves high accuracy on MNIST (up to 99.55%) while fitting within 16KB Flash and 2-4KB RAM.
- Multiplication-Free Inference: Supports quantization schemes that allow inference to run without using multiplication instructions.
- Flexible Quantization: Supports a wide range of low-bit formats including Binary, Ternary, NF4, and non-symmetric 4-bit quantization.
- Portable C Engine: Inference is implemented in ANSI-C for easy porting across different microcontroller architectures.
Related
- Project
- Project
- Project
- Project