studio-ousia / bpr

Binary Passage Retriever (BPR) - an efficient passage retriever for open-domain question answering
Other
168 stars 11 forks source link

Can we load and search the BPR Flat Binary Index in GPU #7

Open astar10239 opened 2 years ago

astar10239 commented 2 years ago

Hi,

I have a 2.5GB Flat Binary Index.

I want to put it in GPU to search,

I tried this

res = faiss.StandardGpuResources() self.index = faiss.GpuIndexBinaryFlat(res, binary_index)

It loads in GPU, but while searching the GPU becomes 100% and dies.

Any idea how to load it and search.

I have a Tesla V100 16GB.

ikuyamada commented 2 years ago

Hi @astar10239, We haven't tested our model with the faiss GPU index, so we do not have knowledge on using our model on the index.

astar10239 commented 2 years ago

@ikuyamada oh, actually i loaded the model some by breaking it in gpu but the time is around 1.2 in gpu where as in cpu 6 cores its 455ms

how did you get 85ms for binary flat on 21m articles ? was it on cpu, how many cores or any optimisation ?

ikuyamada commented 2 years ago

Hi @astar10239, As mentioned in our paper (section 4), we used a server with two Intel Xeon E5-2698 v4 CPUs in our experiments. We did not perform any optimization, and simply used Faiss to measure the query time.