MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba
MNNTranspose16Bit8x8
, 提升fp16的转置性能;mnn-llm
在MNN 2.8.0版本的CPU性能如下,测试均使用4线程, 速度为prefill / decode
单位为tok/s
model | android(f16/32) | macos (f32) | linux (f32) | windows (f32) |
---|---|---|---|---|
qwen-1.8b-int4 | 100.21 / 22.22 | 84.85 / 19.93 | 151.00 / 35.89 | 117.30 / 33.40 |
qwen-1.8b-int8 | 99.95 / 16.94 | 67.70 / 13.45 | 118.51 / 24.90 | 97.19 / 22.76 |
chatglm-6b-int4 | 17.37 / 6.69 | 19.79 / 6.10 | 34.05 / 10.82 | 30.73 / 10.63 |
chatglm2-6b-int4 | 26.41 / 8.21 | 20.78 / 6.70 | 36.99 / 11.50 | 33.25 / 11.47 |
chatglm3-6b-int4 | 26.24 / 7.94 | 19.67 / 6.67 | 37.33 / 11.92 | 33.61 / 11.21 |
qwen-7b-int4 | 14.60 / 6.96 | 19.79 / 6.06 | 33.55 / 10.20 | 29.05 / 9.62 |
baichuan2-7b-int4 | 13.87 / 6.08 | 17.21 / 6.10 | 30.11 / 10.87 | 26.31 / 9.84 |
llama-2-7b-int4 | 17.98 / 5.17 | 19.72 / 5.06 | 34.47 / 9.29 | 28.66 / 8.90 |
测试的系统和设备信息如下,
os | device | CPU | Memory |
---|---|---|---|
android | XiaoMi12 | Snapdragon 8gen1 | 8 GB |
macos | MacBook Pro 2019 | Intel(R) Core(TM) i7-9750H CPU | 16 GB |
linux | PC | Intel(R) Core(TM) i7-13700K | 32GB |
windows | PC | Intel(R) Core(TM) i7-13700K | 32GB |
OpenCL优化Mali-GPU计算量大的卷积运算(image/buffer存储混用)。性能提升10%-20%。
CPU浮点模型优化Winograd卷积的准入条件、1x1Strassen算法。性能提高3%~18%。
CPU量化模型优化WinogradInt8、DepthwiseInt8。性能提高4%~22%。
CUDA优化广播Binary算子性能、Blit算子性能。
CUDA支持编译CodeGen功能,针对Unary/Raster/Binary算子进行算子在线融合,整体性能提升5%-10%。
Oneplus 9 机型 Benchmark 测试结果如下
Model | unrecord | record |
---|---|---|
resnet-v2-50.mnn | 21.254 | 20.160 |
MobileNetV2_224.mnn | 4.853 | 4.186 |
mobilenet-v1-1.0.mnn | 6.424 | 5.315 |
nasnet.mnn | 46.751 | 20.260 |
SqueezeNetV1.0.mnn | 7.35 | 6.832 |
squeezenetv1.1.mnn | 3.936 | 3.693 |
mobilenetV3.mnn | 14.201 | 6.743 |
inception-v3.mnn | 33.111 | 32.032 |
一、新特性
二、重构/优化
三、Bugfix
2.3.1