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
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
.
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