COIL icon indicating copy to clipboard operation
COIL copied to clipboard

How to use GPU to retrieve?

Open jingtaozhan opened this issue 4 years ago • 4 comments

Thank you for sharing the codes. COIL achieves very impressive retrieval performance. I wonder how to use GPU for retrieval.

jingtaozhan avatar Jul 03 '21 10:07 jingtaozhan

The current public retriever implementation uses pytorch API calls, so technically it will take as little as adding a few .cuda() calls to make it run on GPU. Optimizing it may take some efforts. I can make a patch but that could take some time as I am currently having quite a few things on my plate..

luyug avatar Jul 03 '21 23:07 luyug

Thanks. I can implement it myself by just adding a few .cuda() calls. But can I achieve the GPU latency reported in the paper in this way?

jingtaozhan avatar Jul 04 '21 04:07 jingtaozhan

As I said, optimizing it could take some effort. Some considerations include keeping memory aligned and contiguous. GPU topk efficiency is also tricky. It is also likely to be hardware dependent.

luyug avatar Jul 04 '21 05:07 luyug

I see. The original experimental implementation includes many optimization tricks. I will try simply adding the .cuda() calls and look forward to the your optimized GPU retrieval codes. Thank you!

jingtaozhan avatar Jul 04 '21 06:07 jingtaozhan