在2006年iPod上运行llama2.c模型
llama2.c on a 2006 iPod @ 80 MHz w/ 64 MB ram and no FPU
极致的边缘端部署实践,展示了如何在无FPU、低内存的老旧硬件上通过纯整数运算和量化技巧运行LLM,工程细节极具参考价值。
hardware: PortalPlayer PP5022, ARM7TDMI @ 80 MHz, 64 MB ram
硬件:PortalPlayer PP5022,ARM7TDMI @ 80 MHz,64 MB 内存
wrote a fun rockbox plugin that runs Karpathy's llama2.c TinyStories models on an ipod video 5.5G.
编写了一个有趣的 Rockbox 插件,在 iPod Video 5.5G 上运行 Karpathy 的 llama2.c TinyStories 模型。
since there's no FPU, I ported llama2.c's int8 runq.c to use only integer math. it uses lookup tables -> exp/softmax + an integer square root for RMSNorm
由于没有浮点单元(FPU),我将 llama2.c 的 int8 runq.c 移植为仅使用整数运算。它使用了查找表来实现 exp/softmax 以及用于 RMSNorm 的整数平方根。
the 15M model is 17 MB, so it loads directly off the hard drive into the music buffer. Unfortunately you can't listen to music while it works lol
15M 参数的模型大小为 17 MB,因此可以直接从硬盘加载到音乐缓冲区中。不幸的是,在工作时你无法听音乐,哈哈。
want to eventually run this on both cores, and set up a more ipod themed model that does local music recommendation
希望最终能在两个核心上运行此模型,并设置一个更具 iPod 主题风格的模型,用于本地音乐推荐。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力