DCGAN inference on a microcontroller: 12.6M parameters, 512KB SRAM, 26-second generation, pure C [P]

Reddit r/MachineLearning Papers

Summary

Demonstrates running a DCGAN with 12.6M int8 quantized parameters on a low-cost RISC-V microcontroller (CH32H417), generating 64x64 cat faces in 26 seconds using pure C inference and quantum entropy sampling.

Just thought I'd share, I ran a DCGAN on a dual core RISC-V microcontroller, the CH32H417 generating 64x64 cat faces. This is a new RISC-V MCU, so no TFLite, no CMSIS NN and no external memory. It's a pure C inference engine, bit-identical to PyTorch reference outputs. The model is 12.6M parameters with int8 per channel quantization. Intermediate activations are stored in DTCM and layer weights stream from SD card using double buffering so the next layer loads while the current one computes. The total available SRAM is 512KB shared between both cores and the inference engine and time to generate one image is 26 seconds, it could be faster, but SD card access speed is the bottleneck rather than computation. The z vector is seeded from 200 bytes of quantum random data (ANU QRNG vacuum fluctuation source), transformed via Box-Muller into the latent vector. which is not strictly necessary for image quality but it was a fun constraint for the art installation side of the project. The generated cat is classified as "motivated" or "demotivated" based on a single quantum bit, which selects from a phrase bank with four fragment slots combining into one of 131,072 possible spoken verdicts output through the onboard DAC... As far as I can tell nobody else is running GAN inference on these low cost RISC-V microcontrollers, cause ARM has the CMSIS NN ecosystem for this kind of thing but RISC-V MCUs especially in the CH32 space have nothing, so the entire inference engine is written from scratch. Paper: [TinyGAN: Generative Image Synthesis on a RISC-V Microcontroller with Quantum Entropy Sampling](https://zenodo.org/records/20371371)
Original Article

Similar Articles

Real local agentic coding on a 12GB VRAM budget.

Reddit r/LocalLLaMA

The article describes a practical setup for running local agentic coding with a quantized Qwen 3.8 27B model on a 12GB VRAM GPU, achieving productive performance using tools like OpenCode and Magic Context for context management.

Trained an diffusion model that runs on 264KB of RAM [P]

Reddit r/MachineLearning

An individual trained a diffusion model to generate 32x32 pixel images on a Shrike lite microcontroller with only 264KB RAM, experimenting with FPGA acceleration that hit memory bottlenecks, resulting in noisy but sometimes interesting outputs.

Running a 28.9M parameter LLM on an $8 microcontroller

Hacker News Top

A developer demonstrates running a 28.9 million parameter language model on an $8 ESP32-S3 microcontroller using Google's Per-Layer Embeddings to store most parameters in flash, achieving around 9.5 tokens per second on-device text generation.