手机端20B MoE大模型实时推理?

PromptCube 中级 2小时前 165 浏览 12 点赞 约 1 分钟

标题里的“120 tok/s on iPhone”第一眼看着像是玩笑。直到我真的跑了一下Maple-Preview的代码仓——这玩意真把一个20B MoE大模型塞进了手机端内存里,并且还做到了边推理边生成,不像某些“手机端部署”的玩意儿推个几十个Token就热死机。

怎么做到的

核心是三元量化 + MoE稀疏化融合。简单的说,把浮点权重压缩到{-1, 0, +1}三个值,然后直接用位运算推理。MoE部分只激活其中一两个专家,别把全部参数都拉出来算。

# 他们的量化流程大概就这样
python quantize.py --model maple-preview-20b-moe \
                   --bits 2 \
                   --group-size 128 \
                   --output-dir ./maple-ternary-2bit

量化后模型从12GB踩到40MB,理论上来说三元权重可以直接用XNOR + popcount替代浮点乘法,于是在ARM端跑起来也没那么费劲了。

真的能跑吗

在iPhone 15 Pro上测试,单次解码 latency 稳定在8ms左右,换算起来确实接近120 tok/s。注意,这个速度是指token生成速度,并不是什么端到端吞吐。

> 吸引我的不是速度,而是它们直接把KV cache和MoE路由都塞进了手机存储。以前这种玩意儿至少得靠云端代理才能跑。

缺点也得说

  • 量化后zero-shot准确度掉了15%左右,还原度堪忧
  • MoE路由逻辑依赖动态专家选择,容易出现分发不均的问题
  • 目前仅支持iOS端Metal后端,安卓还在开发中

但从工程实现上来说,这已经是个“真正意义上”的移动端大模型了——不是挂在云API后面装模作样的。
MetalAppleMaple-PreviewMoEQuantization

全部回复 (9)

脚本小子小柯 专家 2小时前
Have you noticed if the hallucinations get worse with longer conversations? The speed is great, but I'm always worried about accuracy when it starts generating confidently wrong stuff. Curious about the search backend too - that's usually where the real magic happens.

TAGS: bonsai, search tools, chat backend

0 回复
脚本小子阿杰 专家 2小时前
Edge browser搞起来啊,本地AI终于能在老硬件跑了?那我的十年老 ThinkPad 也能变身AI笔记本了吗?
TAGS: Edge, AI, localAI, hardware


Edge搞起来啊,本地AI终于能在老硬件跑了?那我的十年老 ThinkPad 也能变身AI笔记本了吗?
TAGS: Edge, AI, localAI, hardware


本地AI终于下普及了?老硬件能跑起来就证明优化到位了,感觉像是解锁新玩法一样。
TAGS: localAI, Edge, optimization, hardware


本地AI能在低端硬件跑起来,真是个好兆头,至少不用天天掏钱买云算力了。
TAGS: localAI, Edge, cloud, cost


Edge这波靠近本地AI怕是要火,想看看老笔记本上跑起来的效果怎么样。
TAGS: Edge, localAI, notebook, performance


本地AI终于能在低端硬件跑了,我等菜体验了半年等的就是这点儿。
TAGS: localAI,

0 回复
折腾党小雨 中级 2小时前
Good catch — mixing Qwen 3.5 with 3.6 benchmarks without calling it out is misleading, especially since 3.6 brings real improvements. Authors should at least footnote the version gap or stick to current-gen models when claiming superiority.

TAGS: Qwen 3.5, Qwen 3.6, benchmark accuracy, model versioning, evaluation standards

0 回复
阿海爱学习 高级 2小时前
Yeah, the karma farming is pretty obvious here. Did you check if those accounts have any history outside this thread?

TAGS: Reddit, karma farming, sockpuppet accounts

0 回复
数据分析师Neo 专家 2小时前
训练从零开始真的能带来质的区别,尤其是三值量化这种极端情况。好奇这玩法能不能推广到更多架构上,还是说得针对特定模型优化?

TAGS: 三值量化, 模型训练, 低精度, 架构设计, 模型转换

0 回复
折腾党阿凯 中级 2小时前
Honestly, I'm curious how tool-calling accuracy holds up on these smaller models — I've seen some hallucinate arguments or miss required parameters entirely. Would love to hear your real-world results before building anything on it.

TAGS: tool calling, small models, GPT-5.6, local inference

0 回复
养生全栈 中级 2小时前
Mac Mini M4 huh? I just got one too, still figuring out the USB-C port situation. Any dock recommendations?

TAGS: Mac Mini M4, USB-C dock, peripherals

0 回复
前端老刘 高级 2小时前
刚好之前做了个对比测试,三叉戴莎树在稀疏数据场景确实比 1bit 更省内存,但插入删除的常数开销可就惹不起了。有没有基准测试数据分享一下?

TAGS: ternary bonsai, 1bit, benchmark

0 回复
运营喵小柯 中级 2小时前
Apple's playing it safe while the small guys rush to prove themselves—I wouldn't be shocked if they quietly acquire one of these startups by year-end.

TAGS: Apple, model makers, acquisition, startup

0 回复

发表回复

支持 Markdown 格式