|
1 | 1 | # GGNN: Graph-based GPU Nearest Neighbor Search
|
2 |
| -Fabian Groh, Lukas Ruppert, Patrick Wieschollek, Hendrik P.A. Lensch |
| 2 | +*Fabian Groh, Lukas Ruppert, Patrick Wieschollek, Hendrik P.A. Lensch |
3 | 3 |
|
4 |
| -Abstract |
5 |
| -------------------- |
| 4 | +Approximate nearest neighbor (ANN) search in high dimensions is an integral part of several computer vision systems and gains importance in deep learning with explicit memory representations. Since PQT and FAISS started to leverage the massive parallelism offered by GPUs, GPU-based implementations are a crucial resource for today’s state-of-the-art ANN methods. While most of these methods allow for faster queries, less emphasis is devoted to accelerate the construction of the underlying index structures. In this paper, we propose a novel search structure based on nearest neighbor graphs and information propagation on graphs. Our method is designed to take advantage of GPU architectures to accelerate the hierarchical building of the index structure and for performing the query. Empirical evaluation shows that GGNN significantly surpasses the state-of-the-art GPU- and CPU-based systems in terms of build-time, accuracy and search speed. |
6 | 5 |
|
7 |
| -Approximate nearest neighbor (ANN) search in high dimensions is an integral part of several computer vision systems and gains importance in deep learning with explicit memory representations. Since PQT and FAISS started to leverage the massive parallelism offered by GPUs GPU-based implementations are a crucial resource for today’s state-of-the-art ANN methods. While most of these methods allow for faster queries, less emphasis is devoted to accelerate the construction of the underlying index structures. In this paper, we propose a novel search structure based on nearest neighbor graphs and information propagation on graphs. Our method is designed to take advantage of GPU architectures to accelerate the hierarchical building of the index structure and for performing the query. Empirical evaluation shows that GGNN significantly surpasses the state-of-the-art GPU- and CPU based systems in terms of build-time, accuracy and search speed. |
| 6 | +--- |
8 | 7 |
|
9 |
| -Code |
10 |
| -------------------- |
| 8 | +## How to run the code? |
11 | 9 |
|
12 |
| -Code will be available upon publication. |
13 |
| -If you have any questions please feel free to contact us. |
| 10 | +```bash |
| 11 | +# Get the repository and dependencies |
| 12 | +git clone --recursive https://github.com/cgtuebingen/ggnn.git |
| 13 | +cd ggnn |
14 | 14 |
|
| 15 | +# get the SIFT1M data |
| 16 | +cd data |
| 17 | +./get_sift1m |
| 18 | +cd .. |
15 | 19 |
|
16 |
| -More Resources |
17 |
| -------------------- |
| 20 | +# Build the demo |
| 21 | +mkdir build_local |
| 22 | +cd build_local |
| 23 | +cmake .. |
| 24 | +make |
18 | 25 |
|
19 |
| -- [Arxiv Pre-Print](https://arxiv.org/abs/1912.01059) |
| 26 | +# Usage of demo: |
| 27 | +# ./demo <base.xvecs> <query.xvecs> <gt.ivecs> <tau_build> <refinement_iterations> [<GPU id>] [<graph_cache.ggnn>] |
| 28 | +./demo ../data/sift/sift_base.fvecs ../data/sift/sift_query.fvecs ../data/sift/sift_groundtruth.ivecs 0.5 2 0 --v 0 |
| 29 | +``` |
| 30 | + |
| 31 | + |
| 32 | +### Native build |
| 33 | + |
| 34 | +Requirements: |
| 35 | +* CUDA (>10.2) |
| 36 | +* libgflags-dev (`sudo apt install libgflags-dev`) |
| 37 | + |
| 38 | + |
| 39 | +### Docker build |
| 40 | +An alternative to the native build is to use nvidia-docker. Follow instruction on https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-docker-ce |
| 41 | + |
| 42 | +Prepare the docker image by |
| 43 | + |
| 44 | +```bash |
| 45 | +cd docker |
| 46 | +make |
| 47 | +cd ../ |
| 48 | +``` |
| 49 | + |
| 50 | +Make sure you can run |
| 51 | + |
| 52 | +```bash |
| 53 | +sudo docker run --gpus all cgtuebingen/ggnn:v1 nvidia-smi |
| 54 | +``` |
| 55 | + |
| 56 | +Now build the code via |
| 57 | + |
| 58 | +```bash |
| 59 | +user@host $ sudo docker run --rm -it --user "$(id -u):$(id -g)" -v ${PWD}:/ggnn:rw --gpus all cgtuebingen/ggnn:v1 bash |
| 60 | +user@container $ ./build.sh |
| 61 | + |
| 62 | +cd build_docker |
| 63 | +make |
| 64 | +./demo ../data/sift/sift_base.fvecs ../data/sift/sift_query.fvecs ../data/sift/sift_groundtruth.ivecs 0.5 2 0 --v 0 |
| 65 | +``` |
| 66 | + |
| 67 | +## More Resources |
| 68 | + |
| 69 | +- [Arxiv Pre-Print](https://arxiv.org/abs/1912.01059) |
0 commit comments