3 Commits

Author SHA1 Message Date
Bhavik Sheth
d296b2ce01 Prevent reordering of imports by auto formatter to avoid crashes (#3826)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3826

Apparently this is the generally accepted way to do this.

https://usort.readthedocs.io/en/stable/guide.html#import-blocks

What do you think?

Reviewed By: kuarora, mengdilin

Differential Revision: D62147522

fbshipit-source-id: b9cf034ff6119595956a3c46e7094a2a8b0cb2cc
2024-09-03 18:24:48 -07:00
Ramil Bakhshyiev
a5ad7148fc Re-order imports in Python tests to avoid crashing (#3806)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3806

No explanation for why this works but importing faiss prior to torch causing Python to crash on certain test cases under pytest. This is a temporary workaround with a full RCA required.

Reviewed By: pankajsingh88

Differential Revision: D61956515

fbshipit-source-id: d33992d0b92e87d58ddff1f160990cba487b9927
2024-08-29 01:06:34 -07:00
Matthijs Douze
dd72e4121d QINCo implementation in CPU Faiss (#3608)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3608

This is a straightforward implementation of QINCo in CPU Faiss, with encoding and decoding capabilities (not training).

For this, we translate a simplified version of some torch classes:

- tensors, restricted to 2D and int32 + float32

- Linear and Embedding layer

Then the QINCoStep and QINCo can just be defined as C++ objects that are copy-constructable.

There is some plumbing required in the wrapping layers to support the integration. Pytroch tensors are converted to numpy for getting / setting them in C++.

Reviewed By: asadoughi

Differential Revision: D59132952

fbshipit-source-id: eea4856507a5b7c5f219efcf8d19fe56944df088
2024-07-11 02:40:38 -07:00