Skip to content
forked from baidu/puck

Puck is a high-performance ANN search engine

License

Notifications You must be signed in to change notification settings

xiaozxiong/X-puck

 
 

Repository files navigation

Usage Steps

Before Running

The MKL library is required.

source /opt/intel/oneapi/mkl/latest/env/vars.sh
cmake -DCMAKE_BUILD_TYPE=Release -DMKLROOT=${MKLROOT} -DBLA_VENDOR=Intel10_64lp_seq -DBLA_STATIC=ON -B build .
cd build && make -j

Train and Build

Firstly, we need to create directory output to store index and dataset to link dataset directory. The input file is in .fvecs format.

ln -s /mnt/data1/xzx/tinker_output output
ln -s /mnt/data0/ANN-Datasets dataset

The .conf file in tools/demo/conf/ can be modified to set traing and building parameter:

  • tools/demo/conf/puck_train.conf
  • tools/demo/conf/tinker_train.conf

Then we can run the shell script puck_train_control.sh in tools/script/ to train and build index. It is worthy to note that the current path of puck_train_control.sh is project directory and the parameters in .conf file should be set basing on it. If this script fails to run, the possible reason is the writing permission so you should add sudo.

cd tools/script
./puck_train_control.sh -t -b

After that, all index information would be stored in derectory output for specified dataset such as output/sift10K.

Search

We can set search parameters in:

  • demo/conf/puck.conf
  • demo/conf/tinker.conf

Then we can run the following command to perform searching, the query file is in .fvecs format and gt file is in .ivecs format.

./bin/search_client QUERY_FILE GT_FILE --flagfile=demo/conf/puck.conf
# or
./bin/search_client QUERY_FILE GT_FILE --flagfile=demo/conf/tinker.conf
# 

For example:

./bin/search_client dataset/deep1M/deep1M_query.fvecs dataset/deep1M/deep1M_groundtruth.ivecs --flagfile=demo/conf/tinker.conf

About

Puck is a high-performance ANN search engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 29.9%
  • C++ 24.2%
  • C 24.0%
  • Python 18.7%
  • CMake 1.6%
  • Shell 1.3%
  • Other 0.3%