hollance / neural-engine

Everything we actually know about the Apple Neural Engine (ANE)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do you have any workarounds about pooling layer?

y-ich opened this issue · comments

Hello, Hollemans san.

Thank you for your useful repository!

I found that a pooling layer which follows a convolution prevents the convolution to run on ANE.
Do you know any workarounds to avoid it?

The pooling layer is actually a global average pooling layer.
I tried to turn on/off globalPooling and to replace it with reduce mean, but no better effects.

Thanks.

[Additional Information]
I found that padding="VALID" causes the problem.
If you use padding="SAME", the model runs on ANE, but you know it is useless since the activation outputs an output with different shape.

Ah interesting. I don't think I've used a model with VALID padding on the ANE before.

Thank you for your comment!

I will investigate further.

I noticed similar problem. While running the model with profiler on, os_log output says something like "kernel size > 13 is not supported in ANE". Setting globalPooling to true also didn't work.

@teijeong Interesting, thanks!

By the way, what do you mean by "While running the model with profiler on"? Which profiler is this?

Oh I mean, the Xcode Instruments tool

@teijeong System Trace or another instrument?

There's an instrument called os_log. (as seen here: https://developer.apple.com/videos/play/wwdc2018/405/)

Great, thanks. I don't think I've used that one before, should come in handy. 😄

Great! Hope you enjoy the power 😎

Neural Engine on A14 seems to have a unit for pooling.
Models with pooling layers run super fast on it. Amazing.

wonder if there is a benchmark for such models