#! /bin/bash # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. set -e todo=$1 # other options can be transmitted shift # the training data of the Deep1B dataset deep1bdir=/datasets01_101/simsearch/041218/deep1b traindata=$deep1bdir/learn.fvecs # this is for small tests nvec=1000000 k=4000 # for the real run # nvec=50000000 # k=1000000 # working directory for the real run workdir=/checkpoint/matthijs/ondisk_distributed mkdir -p $workdir/{vslices,hslices} if [ -z "$todo" ]; then echo "nothing to do" exit 1 elif [ $todo == test_kmeans_0 ]; then # non distributed baseline python distributed_kmeans.py \ --indata $traindata --i1 $nvec \ --k $k elif [ $todo == test_kmeans_1 ]; then # using all the machine's GPUs python distributed_kmeans.py \ --indata $traindata --i1 $nvec \ --k $k --gpu -1 elif [ $todo == test_kmeans_2 ]; then # distrbuted run, with one local server per GPU ngpu=$( echo /dev/nvidia? | wc -w ) baseport=12012 # kill background porcesses on output of this script trap 'kill -HUP 0' 0 hostports='' for((gpu=0;gpu $workdir/vslices/slice$i.bash < $workdir/hslices/slice$i.bash <