faiss icon indicating copy to clipboard operation
faiss copied to clipboard

Support interruption for NNdescent

Open mdouze opened this issue 2 years ago • 1 comments

NNdescent cannot be interrupted. It would be nice to support the InterruptCallback

https://github.com/facebookresearch/faiss/blob/be1242775a6e7c025c3ab48388d95bb6a5377d8c/faiss/impl/AuxIndexStructures.cpp#L223

mdouze avatar Dec 13 '23 14:12 mdouze

Context: most slow operations have an explicit way of checking for interruptions. This is to avoid having to kill the process or handle signals that arrive asynchronously. The main usage now is in Python to handle keyboard interrupts. On the C++ side, this is done by periodically checking am InterruptCallback (between 1 and 100 times per second). See for example

https://github.com/facebookresearch/faiss/blob/main/faiss/IndexHNSW.cpp#L239 https://github.com/facebookresearch/faiss/blob/366a8146aa8744277c02328987bec95acf364ba7/faiss/utils/distances.cpp#L256

mdouze avatar Apr 10 '24 08:04 mdouze