Commit Graph

9 Commits (c0052c15336a57f7068a7d098d5ce5b6234a2d70)

Author SHA1 Message Date
Matthijs Douze 2d380e992b Add manifold check for size 0 (#1867)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1867

Merging code for the 1T photodna index seems to fail at

https://www.internalfb.com/phabricator/paste/view/P412975011?lines=174

with
```
terminate called after throwing an instance of 'facebook::manifold::blobstore::StorageException'
  what():  [400] Begin offset and/or length were invalid -- Begin offset must be positive and length must be non-negative. Received: offset = 2642410612, length = 0
Aborted (core dumped)
```
traces back to

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/fbcode/manifold/blobstore/BlobstoreThriftHandler.cpp?lines=671%2C700%2C732

There is a single case where we don't check if the read or write size is 0. So let's try this fix.

In the process I realized that the Manifold tests were non functional due to a name collision on common.py. Also fix this in all dependent files.

Differential Revision: D28231710

fbshipit-source-id: 700ffa6ca0c82c49e7d1eae9e76549ec5ff16332
2021-05-09 22:30:31 -07:00
Matthijs Douze 10c8583b2d Fix order of results for IndexBinaryHash and IndexBinaryMultiHash
Summary: The IndexBinaryHash and IndexBinaryMultiHash knn search functions returned results in a random order. This diff fixes that to the standard decreasing Hamming distance order + adds a test for that. I noticed on a notebook from sc268.

Reviewed By: sc268

Differential Revision: D26324795

fbshipit-source-id: 1444e26950e24bfac297f34f3d481d902d8ee769
2021-02-08 18:22:55 -08:00
Matthijs Douze a2791322d9 Update ProductQuantizer.cpp (#1634)
Summary:
Make error message more clear.
See https://github.com/facebookresearch/faiss/issues/1632

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

Reviewed By: beauby

Differential Revision: D25942961

Pulled By: mdouze

fbshipit-source-id: e96ca808a9a0dcd1de5417a5e048d39431b30a5e
2021-01-20 00:12:54 -08:00
Matthijs Douze 9b2384f305 Fix serialization of large hash indexes
Summary:
64-bit cleanness issue for BitstringWriter.
Shows in HashIndex I/O, see https://github.com/facebookresearch/faiss/issues/1532

Reviewed By: beauby

Differential Revision: D25804891

fbshipit-source-id: d4cd3714d116a1b2fe1c9446eb1e9d3a8acf854e
2021-01-11 05:48:12 -08:00
Matthijs Douze 3dd7ba8ff9 Add range search accuracy evaluation
Summary:
Added a few functions in contrib to:
- run range searches by batches on the query or the database side
- emulate range search on GPU: search on GPU with k=1024, if the farthest neighbor is still within range, re-perform search on CPU
- as reference implementations for precision-recall on range search datasets
- optimized code to plot precision-recall plots (ie. sweep over thresholds)

The new functions are mainly in a new `evaluation.py`

Reviewed By: wickedfoo

Differential Revision: D25627619

fbshipit-source-id: 58f90654c32c925557d7bbf8083efbb710712e03
2020-12-17 17:17:09 -08:00
Lucas Hosseini f3727a62f5 Remove python shebangs in tests.
Reviewed By: mdouze

Differential Revision: D23167048

fbshipit-source-id: 98196f489461bc922e6124e88e0bfb32dfe507ca
2020-08-17 11:46:26 -07:00
Lucas Hosseini ac74f576f7 fbshipit-source-id: 4f3cfa59471d548af93fe118d1b73d45bc648edf 2020-08-04 12:00:38 -07:00
Lucas Hosseini cd38e82f0c
Facebook sync 2020-07-31 (#1308) 2020-08-03 22:15:02 +02:00
Lucas Hosseini a17a631dc3
Sync 20200323. (#1157)
* Sync 20200323.

* Bump version.

* Remove warning filter.
2020-03-24 14:06:48 +01:00