4 ms·
Hi, I’m the author of the Faiss GPU code. The GPU implementation depends upon a lot of particularities in CUDA (warp shuffles and warp ballots, tricks with usi
by jhj 10y ago
Hi, I’m the author of the Faiss GPU code.
The GPU implementation depends upon a lot of particularities in CUDA (warp shuffles and warp ballots, tricks with using register memory), and gets much of its speed in this way.
Much of the code would be much slower if unable to use register file memory and instead forced to use shared memory instead (the k-selection most notably). Some needed functionality is supported in OpenCL 2.0; e.g.,
https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/cl_khr_subgroups.html https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xht...
but are still extensions or implementation specific, and I wouldn’t hold my breath for them to work well.
OpenCL tends to be lowest common denominator and for bleeding-edge GPU programming it won’t map well. I don’t think shuffles are supported at all in OpenCL (?). They are available directly in AMD’s GPU ISA, but have slightly different semantics, and at that point you're just using something that is as proprietary as CUDA. Not to mention trying to support wavefront size 64 vs. warp size 32 etc:
http://gpuopen.com/amd-gcn-assembly-cross-lane-operations/ http://gpuopen.com/amd-gcn-assembly-cross-lane-operations/
- visarga 10y agoGreat work! As a demo, could you make a Reddit comment or thread search engine based on document embeddings? It would be interesting to search through the treasure trove with word vectors. The comment dataset is already available in the wild.
- ethanwillis 10y agoVery interesting. GPU programming is not my area at all so I don't mean to discount your work! Thanks for the thoughtful response and all the work you put into Faiss.