MNN icon indicating copy to clipboard operation
MNN copied to clipboard

MNN-LLM的论文提到Prefetch KV Pipeline方案抓Trace发现推理过程中与UFS的IO很少,没有节省内存

Open PencilGo opened this issue 10 months ago • 2 comments

我研究MNN-LLM: A Generic Inference Engine for Fast Large Language Model Deployment on Mobile Devices 论文 DRAM-Flash Hybrid Storage 小节提到的推理时KV offload/prefetch 方法。 实测时通过prefetto抓取Block和f2fs层的trace log分析IO的RW很少,内存占用很大,没有节省内存。

测试机:SM8650 + 12GB DRAM MNN-LLM APP Version:mnn_chat_d_0_2_2.apk 测试模型:DeepSeek-R1-7B-Qwen-MNN

请问论文描述的方法是否在代码中实现及相关代码位置,谢谢

PencilGo avatar Mar 03 '25 07:03 PencilGo

kv部分目前公开的代码只有mmap的简单实现版本,还没有预取的实现。

KV的优化还在改进中,包括计算部分后续还会修改,感谢您的关注!

wangzhaode avatar Mar 03 '25 11:03 wangzhaode

Marking as stale. No activity in 60 days.

github-actions[bot] avatar May 03 '25 09:05 github-actions[bot]