Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile in aarch64/arm64 #567

Closed
3 of 4 tasks
PlutusCN opened this issue Aug 17, 2018 · 11 comments
Closed
3 of 4 tasks

Compile in aarch64/arm64 #567

PlutusCN opened this issue Aug 17, 2018 · 11 comments

Comments

@PlutusCN
Copy link

Does faiss support aarch64/arm64 ?

  • I wanna compile faiss in nvidia Jestson TX2 which is the platform of Ubuntu 16.04 LTS aarch64, but I got the errors:
    c++: error: unrecognized command line option '-m64'
    c++: error: unrecognized command line option '-msse4'
    c++: error: unrecognized command line option '-mpopcnt'
  • So how can I fix the problem ? thanks !

Platform

OS:

  • Ubuntu 16.04 LTS aarch64

Faiss version:

Faiss compilation options:

  • -std=c++11 -fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python
@mdouze
Copy link
Contributor

mdouze commented Aug 17, 2018

The Faiss code will need some adaptation to run on a non-x64 platform, see #529.
If you want to give it a try, we will welcome PRs for a non-intel version of Faiss.

@mdouze
Copy link
Contributor

mdouze commented Aug 17, 2018

Here is a patch that makes it possible to compile on non x64 machines: https://gist.github.com/mdouze/a384a01d0e205bee6d39d52170fb3588
it disables or replaces with scalar code all x64-specific code.
Apparently arm also has SIMD instructions, it would be interesting to use those to speed up Faiss.

@msharmavikram
Copy link

I have enabled for PowerPC by disabling Intel specific instructions. HNSW is not enabled.
Forked version here - https://github.com/msharmavikram/faiss

It should work for ARM too. (as PowerPC specific are guarded). Let me know if you see an issue.

@mdouze
Copy link
Contributor

mdouze commented Aug 17, 2018

Updated the patch
https://gist.github.com/mdouze/a384a01d0e205bee6d39d52170fb3588
to support IndexHNSW. All test pass on an ARM machine.

@PlutusCN
Copy link
Author

@mdouze How about the function of arm64 if compared with x86 ? Are they the same, or not ? Which part of source code has been modified if they not ? Thanks a lot !

@mdouze
Copy link
Contributor

mdouze commented Aug 20, 2018

In this patch, all the occurrences of SSE intrinsics are replaced with normal C code.

@xuchendev
Copy link

How to compile this project on arm64 ? : ] @mdouze

@mdouze
Copy link
Contributor

mdouze commented Aug 27, 2018

Please adjust the makefile.inc manually to remove x86-specific flags and it will compile. The next Faiss release will include some ARM optimized routines.

@mdouze
Copy link
Contributor

mdouze commented Aug 30, 2018

Compilation for arm is supported in 1.4.0

@mdouze mdouze closed this as completed Aug 30, 2018
@xiehaoina
Copy link

I met the same issue in 1.4.0. on tx2

g++ -std=c++11 -DFINTEGER=int -fPIC -fopenmp -m64 -Wno-sign-compare -g -O3 -Wall -Wextra -msse4 -mpopcnt -c IndexFlat.cpp -o IndexFlat.o
g++: error: unrecognized command line option '-m64'
g++: error: unrecognized command line option '-msse4'
g++: error: unrecognized command line option '-mpopcnt'
Makefile:27: recipe for target 'IndexFlat.o' failed

@mdouze
Copy link
Contributor

mdouze commented Oct 31, 2018

Please remove those 3 flags from makefile.inc. There is no specific flag needed to get the ARM NEON instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants