使用 Onnxruntime 时使用不同的硬件加速器执行 NN 模型图的不同操作
我试图通过 OnnxRuntime 利用 NNAPI 在 Android 设备上进行 NN 模型推理。基于此处的 YouTube 视频:https://www.youtube.com/watch?v=Ij5MoUnLQ0E 可以为模型中的算子指定硬件加速器。任何有关如何继续进行的指导将不胜感激。
I was trying to utilize NNAPI via OnnxRuntime for NN model inferencing on an Android device. Based on the youtube video here: https://www.youtube.com/watch?v=Ij5MoUnLQ0E it is possible to specify the hardware accelerators for operators in the model. Any guidance on how to proceed with that would be grateful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 NNAPI 中,可以发现存在哪些硬件加速器,并选择特定的硬件加速器来运行模型。
如果应用程序指定多个加速器,NNAPI 运行时将根据每个加速器的特性及其支持的层来划分工作。
程序不可能逐层做出该决定。如果这就是您所需要的,您可能必须将模型分解为子模型。
有关更多详细信息,请参阅 NNAPI 文档中的设备发现和分配部分。
我对 OnnxRuntime 不熟悉。我不知道这个包是否公开了该功能。
In NNAPI, it is possible to discover which hardware accelerators are present, and to select specific ones for running a model.
If the application specifies more than one accelerator, the NNAPI runtime partitions the work depending on the characteristics of each accelerator and the layers they support.
It is not possible for a program to make that decision on a layer by layer basis. If that's what you need, you may have to break down your model into sub-models.
See the Device discovery and assignment section in the NNAPI documentation for more details.
I am not familiar with OnnxRuntime. I don't know if this package exposes that functionality.