-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
"Segmentation Fault" happened when import faiss #2465
Comments
So I assume speech_py_impl.py is the source code you show, otherwise there is no reason that faiss gets called from Azure code. Would it be possible to get a C++ stack trace of the error with a debugger, to give an idea where the conflict is? |
The speech_py_impl.py is not my source code, it's from And, any recommended tools for debug python's C stack? |
It seems that import azure.cognitiveservices.speech as speechsdk
import faiss will overwrite |
According to SWIG doc Section 15.3, it seems that there needs some devices to use multiple swig modules, doesn't it? |
Excellent, thanks for the debugging. So what can we do? |
My suggestion as a workaround would be to call either speechsdk or faiss as a subprocess of the main code with a pool of a single process the coordination between multiple swig modules lined out in the doc is only possible if their compilation is coordinated, this is not possible with Faiss and speechsdk. Ideally it would be possible to make the symbols used by the two SWIG .so files completely disjoint (eg. with some module-specific prefix). However this functionality is not implemented in SWIG I think. |
I agree this. That is technically possible on the point of view from SWIG, but it would be practically impossible when at least speechsdk is not written to coexist with other SWIG modules. Another option would be to stop using SWIG in faiss and generate Python bindings using pybind11 or something like that, but even if this project will decide to do it, there would be a lot of work... Anyway, the workaround using subprocess looks better way to go at moment IMO. |
Thanks, I will try to use speechsdk in a single process pool, it seems the easiest way. |
Summary
"Segmentation Fault" happened when use azure tts sdk and faiss at the same time.
Platform
I'm not sure this problem can be reproducted on other platform
OS: Ubuntu 18.04
Faiss version: 1.7.2
Installed from: anaconda
Faiss compilation options: Not compiled from source
conda install -c pytorch faiss-cpu
Running on:
Interface:
Reproduction instructions
And if I comment the
import faiss
, the code is passedAnd if I comment the azure tts code, the code is passed too
The text was updated successfully, but these errors were encountered: