GithubHelp home page GithubHelp logo

iOS support about nnpack HOT 14 CLOSED

maratyszcza avatar maratyszcza commented on July 28, 2024
iOS support

from nnpack.

Comments (14)

Maratyszcza avatar Maratyszcza commented on July 28, 2024 1

iOS is supported since we landed CMake configs.

from nnpack.

Maratyszcza avatar Maratyszcza commented on July 28, 2024

What do you mean by supporting iOS?
The PSIMD implementation can be built for any architecture supported by clang. Performance, of course, wouldn't be as good as native assembly.

from nnpack.

joker512 avatar joker512 commented on July 28, 2024

Actually, I don't understand what is PSIMD implementation...
That's what I see in your README.md:

NNPACK can be build on OS X and Linux
...

and

Cross-compilation for Native Client
...

Both are not about compilation for iOS.

from nnpack.

Maratyszcza avatar Maratyszcza commented on July 28, 2024

Its not yet documented, but you can configure with --enable-psimd option, and NNPACK will use kernels from src/psimd

from nnpack.

joker512 avatar joker512 commented on July 28, 2024

Ok, I see, thank you.

We've tried this option on iPhone 6S and got only 10% performance boost. Is it correct or we did something wrong? Or maybe, not all capabilities of ARM architecture are used in the current NNPACK and you could support ARM better in future.

In short, do you think it is possible to get more boost on iOS?

from nnpack.

Maratyszcza avatar Maratyszcza commented on July 28, 2024

The PSIMD branch is generic 128-bit SIMD, it misses many ARM-specific optimization opportunities. It is possible to do much better on ARM, but currently I have no time to work on it.

However, you can get some perf boost on ARM with little effort: in the src/psimd/blas replace multiplication-accumulation with FMA (a * b + c -> vmlaq_f32).

from nnpack.

carlodelmundo-zz avatar carlodelmundo-zz commented on July 28, 2024

@joker512 Did you roll out your own version of ARM-based intrinsics in lieu of the SSE/AVX2 versions of @Maratyszcza ?

I'm interested in a fast iOS port as well.

from nnpack.

bhack avatar bhack commented on July 28, 2024

@carlodelmundo There is some initial NEON support in master (I suppose mainly blas)

from nnpack.

wangxuewen99 avatar wangxuewen99 commented on July 28, 2024

@Maratyszcza for ios, i have tried to compile nnpack with --enable-psimd option,but some error occurred. ld: warning: ignoring file *****/libnnpack.a, file was built for archive which is not the architecture being linked (arm64): *****/libnnpack.a. how can i solve this problem?3x

from nnpack.

Maratyszcza avatar Maratyszcza commented on July 28, 2024

For iOS you'd have to create XCode project and do some porting. Its not supported out of the box.

from nnpack.

wangxuewen99 avatar wangxuewen99 commented on July 28, 2024

@Maratyszcza I see ,thanks a lot for your reply

from nnpack.

vpatil131 avatar vpatil131 commented on July 28, 2024

The PSIMD branch is generic 128-bit SIMD, it misses many ARM-specific optimization opportunities. It is possible to do much better on ARM, but currently I have no time to work on it.

@Maratyszcza I see that you have added optimized NEON intrinsic BLAS code under src/neon since your above comment. However, input & output Fourier transform is still using generic 128-bit SIMD code from src/psimd.

Do you think it's possible to get performance boost by writing ARM NEON intrinsics for input & output transform as well?

Thanks

from nnpack.

Maratyszcza avatar Maratyszcza commented on July 28, 2024

@vpatilvasu Yes, I believe so.

from nnpack.

Yangqing avatar Yangqing commented on July 28, 2024

You can potentially build it manually with the set of source files - here is how you can do it for example:

https://github.com/caffe2/caffe2/blob/58113f945426b0bacc33020ec499384417b86952/cmake/External/nnpack.cmake#L57-L122

from nnpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.