Commit Graph

2 Commits (da20af4ca5cf7e077270f7443bd1a01c7db2cbb0)

Author SHA1 Message Date
Sergii Dymchenko 383b5d908c Use weights_only for load (#3796)
Summary:
`torch.load` without `weights_only` parameter is unsafe. Explicitly set `weights_only` to False only if you trust the data you load and full pickle functionality is needed, otherwise set `weights_only=True`.

If `weights_only=True` doesn't work for some cases, then explicit `weights_only=False` should be used.

Found with https://github.com/pytorch-labs/torchfix/

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3796

Reviewed By: asadoughi

Differential Revision: D61824340

Pulled By: kit1980

fbshipit-source-id: bc013d06d4f368f730ffee6898e75fd0b0ff1d40
2024-08-30 12:01:55 -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