facebookresearch / facebookresearch/faiss

Feature request: create_direct_map for GPU indexes and allow reconstruct

Open
#2,181 1 comment 0 reactions 0 assignees View on GitHub
enhancement GPU
Dominant language
C++
Stars
40.9k
Forks
4.5k
PR merge metrics
No merged PRs in 30d

Description

# Summary

Would it be possible to `make_direct_map()` on GPU indexes, to allow calling `index.reconstruct`?
If not, is there another way to reconstruct quickly using the GPU?
Thanks!

# Platform

OS: Ubuntu

Faiss version: 1.7.1

Installed from: `pip install faiss-gpu`

Running on:
- [ ] CPU
- [X] GPU

Interface:
- [ ] C++
- [X] Python

# Reproduction instructions

Load any index, convert it to GPU:
```
import faiss

indexfile = 'my_knn.index'
cpu_index = faiss.read_index(indexfile, faiss.IO_FLAG_ONDISK_SAME_DIR)
co = faiss.GpuClonerOptions()
co.useFloat16 = True
gpu_index = faiss.index_cpu_to_gpu(faiss.StandardGpuResources(), 0, cpu_index, co)
```

Now, it would be great if I could run:
```
gpu_index.make_direct_map()
```
(which currently results in: `AttributeError: 'GpuIndexIVFPQ' object has no attribute 'make_direct_map'`)

and then ideally I would like to run:
```
gpu_index.reconstruct(5)
gpu_index.reconstruct(8)
gpu_index.reconstruct(7)
...
```
(which currently results in: `faiss/faiss/Index.cpp:48: reconstruct not implemented for this type of index`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.