imxieyi / waifu2x-ios

iOS Core ML implementation of waifu2x
MIT License
538 stars 58 forks source link

为什么MacBook M1 不能在core ML中使用神经网络引擎 #24

Closed wisermonk closed 3 years ago

imxieyi commented 3 years ago

Apple并没有提供Neural Engine的API。目前唯一可能使用的办法就是通过设置Core ML的computeUnits。具体是否真的使用是Core ML框架做决定。经过测试waifu2x的模型即使选择.all也还是在GPU上运行。可能M1上的Neural Engine暂时并没有对第三方app开放。

gnattu commented 3 years ago

在以前的历史版本中 选择ANE后通过powermetrics可以看到ANE有不低的能耗,但是GPU没有,我认为这说明ANE至少在某个历史版本中是可以正常使用的

imxieyi commented 3 years ago

测试了一下确实现在ANE能用了,可能是以前的macOS版本不行。下次更新会重新启用macOS的ANE选项。

imxieyi commented 3 years ago

https://github.com/imxieyi/waifu2x-ios/wiki/Info-about-different-ML-backend#quality-comparison

做了些进一步的测试发现M1上的ANE相对MPSCNN画质下降小到可以忽略,和iPhone上面相比要好很多。不过考虑到Core ML因为系统更新出问题在过去发生过很多次,如果对速度不敏感还是建议使用MPSCNN。

imxieyi commented 3 years ago

Mac Catalyst版已经更新,iOS版会在下个版本跟进。