llama2.c icon indicating copy to clipboard operation
llama2.c copied to clipboard

Runing llama2.c on a microcontroller

Open mahdi259 opened this issue 1 year ago • 1 comments

Hi Thanks for your valuable effort. Is it possible to compile llama2.c project to be run on a microcontroller without operating system?

mahdi259 avatar Feb 09 '24 07:02 mahdi259

It is theoretically possible, but almost all uC boards lack the flash to store the models and have insufficient ram. You'd need to design a uC board with sufficient RAM/PSRAM that has a decent uC such as ESP32. With some changes to llama2.c it could be built for baremetal using the toolchain (compiler) for your uC. You should use the 8bit quantized llama2.c if you plan to do so to save resources.

This project comes close: https://github.com/maxbbraun/llama4micro

trholding avatar Mar 08 '24 06:03 trholding

Thanks

mahdi259 avatar Aug 04 '24 07:08 mahdi259