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

Faiss imported after Torch leads to segfault #3401

Closed
2 of 4 tasks
anfatima opened this issue Apr 30, 2024 · 2 comments
Closed
2 of 4 tasks

Faiss imported after Torch leads to segfault #3401

anfatima opened this issue Apr 30, 2024 · 2 comments
Labels

Comments

@anfatima
Copy link

anfatima commented Apr 30, 2024

If Faiss is imported after Torch, training in Faiss segfaults.

This can be reproduced using the example k-means clustering code in the Wiki.

Platform

OS: Big Sur version 11.6

Faiss version: 1.7.4 stable

Installed from: conda and brew

conda install faiss-cpu

Faiss compilation options:

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python

Reproduction instructions

d = 128                           # dimension
nb = 100000                      # database size
nq = 10000                       # nb of queries
np.random.seed(1234)             # make reproducible
x = np.random.random((nb, d)).astype('float32')

ncentroids = 1024
niter = 20
verbose = True
d = x.shape[1]
kmeans = faiss.Kmeans(d, ncentroids, niter=niter, verbose=verbose)
kmeans.train(x)
@mdouze mdouze added the install label May 6, 2024
@mdouze
Copy link
Contributor

mdouze commented May 6, 2024

please install via conda only

@anfatima
Copy link
Author

anfatima commented May 7, 2024

I did and I also installed it from source. I think the issue is with MKL and OpenMP conflicts between the Faiss installation and Torch.

The workaround works for now.

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