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

Installation issue - KeyError 'flags' when import faiss #1098

Closed
3 of 4 tasks
houssam7737 opened this issue Jan 30, 2020 · 4 comments
Closed
3 of 4 tasks

Installation issue - KeyError 'flags' when import faiss #1098

houssam7737 opened this issue Jan 30, 2020 · 4 comments
Labels

Comments

@houssam7737
Copy link

Summary

After running all the installation steps, and I run python -c "import faiss" I get a KeyError: 'flags' error. I'm installing faiss in a conda environment. For some reason, running make test_gpu also fails with a TestGpuIndexFlat.cpp:9:29: fatal error: faiss/IndexFlat.h: No such file or directory error. Running make test also fails with 16 errors, all due to the KeyError: 'flags' error.

I am aware of the error in #866 where the egg file does not get unzipped, but even after unzipping I still get the error.

Any help would be much appreciated! I spent a lot of time trying to go through past issues and figure it out but I'm quite stuck.

Platform

OS: Rhel 7.6

Faiss version: faiss 1.6.1, commit e084949

Faiss compilation options:

`
./configure --with-cuda=/usr/local/cuda-10.1 --with-blas=/usr/lib64/libblas.so.3 --with-lapack=/usr/lib64/liblapack.so.3 --prefix=/nobackup/users/houssam/anaconda3/envs/NAME_OF_ENV

make

make install

make SWIG=/home/houssam/swig/bin/swig py

make -C python install`

After this step I proceeded to the site-packages folder and manually unzipped the egg file.

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python

Reproduction instructions

python -c "import faiss" Traceback (most recent call last): File "<string>", line 1, in <module> File "/nobackup/users/houssam/anaconda3/envs/wmlce-1.6.2/lib/python3.6/site-packages/faiss/__init__.py", line 38, in <module> instr_set = instruction_set() File "/nobackup/users/houssam/anaconda3/envs/wmlce-1.6.2/lib/python3.6/site-packages/faiss/__init__.py", line 31, in instruction_set if "avx2" in numpy.distutils.cpuinfo.cpu.info[0]['flags']: KeyError: 'flags'

@houssam7737
Copy link
Author

Also, running in a python shell:

import numpy.distutils.cpuinfo numpy.distutils.cpuinfo.cpu.info[0]
I get: {'uname_m': 'ppc64le', 'processor': '0', 'cpu': 'POWER9, altivec supported', 'clock': '3616.000000MHz', 'revision': '2.1 (pvr 004e 1201)'} so there is actually no 'flags' keyword ??

@houssam7737 houssam7737 changed the title Installation issue on Rhel - KeyError when import faiss Installation issue - KeyError 'flags' when import faiss Jan 30, 2020
@mdouze
Copy link
Contributor

mdouze commented Jan 31, 2020

You are running on an unusual architecture, so I can't really test this, but I am interested in any feedback on Faiss on PPC.
avx2 is specific to intel architectures, so you could add a test case for platform.system() == what your system returns.

@mdouze mdouze added the install label Jan 31, 2020
@mdouze
Copy link
Contributor

mdouze commented Feb 28, 2020

No activity, closing.

@mdouze mdouze closed this as completed Feb 28, 2020
@gilbertfrancois
Copy link

gilbertfrancois commented Apr 23, 2020

Hi, I have the same issue, after compiling on ARMv8 (Jetson Xavier). I ran configure and make with the options:

./configure --with-cuda=/usr/local/cuda --with-cuda-arch="-gencode=arch=compute_53,code=sm_53 -gencode=arch=compute_72,code=sm_72"
make
make -C python
make -C python install

After importing Faiss in python, I see the "KeyError: flags". Running the following in a python interpreter, gives:

>>> import numpy.distutils.cpuinfo
>>> numpy.distutils.cpuinfo.cpu.info[0]
{'uname_m': 'aarch64', 'processor': '0', 'model name': 'ARMv8 Processor rev 0 (v8l)', 'BogoMIPS': '62.50', 'Features': 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp', 'CPU implementer': '0x4e', 'CPU architecture': '8', 'CPU variant': '0x0', 'CPU part': '0x004', 'CPU revision': '0', 'MTS version': '45309758'}

>>> import platform
>>> platform.system()
'Linux'

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

No branches or pull requests

3 participants