Skip to content

Commit

Permalink
add indexing docs/sec column to knnPerfTest tabular output
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemccand committed Oct 30, 2024
1 parent d9d5c64 commit 0cdcbb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/main/knn/KnnGraphTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,10 @@ private void testSearch(Path indexPath, Path queryPath, Path outputPath, int[][]
} else {
quantizeDesc = "no";
}
double reindexSec = reindexTimeMsec / 1000.0;
System.out.printf(
Locale.ROOT,
"SUMMARY: %5.3f\t%5.3f\t%d\t%d\t%d\t%d\t%d\t%s\t%d\t%.2f\t%.2f\t%d\t%.2f\t%.2f\t%s\n",
"SUMMARY: %5.3f\t%5.3f\t%d\t%d\t%d\t%d\t%d\t%s\t%d\t%.2f\t%.2f\t%.2f\t%d\t%.2f\t%.2f\t%s\n",
recall,
totalCpuTimeMS / (float) numIters,
numDocs,
Expand All @@ -702,7 +703,8 @@ private void testSearch(Path indexPath, Path queryPath, Path outputPath, int[][]
beamWidth,
quantizeDesc,
totalVisited,
reindexTimeMsec / 1000.0,
reindexSec,
numDocs / reindexSec,
forceMergeTimeSec,
indexNumSegments,
indexSizeOnDiskMB,
Expand Down
10 changes: 5 additions & 5 deletions src/python/knnPerfTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@
#'fanout': (20, 100, 250)
'fanout': (6,),
#'quantize': None,
'quantizeBits': (32,),
#'quantizeBits': (32,),
'numMergeWorker': (12,),
'numMergeThread': (4,),
'encoding': ('float32',),
# 'metric': ('angular',), # default is angular (dot_product)
#'quantize': (True,),
'quantizeBits': (4,),
'quantizeBits': (4, 7, 32),
#'fanout': (0,),
'topK': (10,),
'quantizeCompress': (True, False),
'quantizeCompress': (False,),
#'niter': (10,),
}

Expand Down Expand Up @@ -143,7 +143,7 @@ def run_knn_benchmark(checkout, values):
'-docs', doc_vectors,
'-reindex',
'-search-and-stats', query_vectors,
#'-metric', 'euclidean',
'-metric', 'mip',
# '-parentJoin', parentJoin_meta_file,
# '-numMergeThread', '8', '-numMergeWorker', '8',
'-forceMerge',
Expand All @@ -170,7 +170,7 @@ def run_knn_benchmark(checkout, values):
all_results.append(summary)
print('\nResults:')

header = 'recall\tlatency (ms)\tnDoc\ttopK\tfanout\tmaxConn\tbeamWidth\tquantized\tvisited\tindex s\tforce merge s\tnum segments\tindex size (MB)\tselectivity\tfilterType'
header = 'recall\tlatency (ms)\tnDoc\ttopK\tfanout\tmaxConn\tbeamWidth\tquantized\tvisited\tindex s\tindex docs/s\tforce merge s\tnum segments\tindex size (MB)\tselectivity\tfilterType'

# crazy logic to make everything fixed width so rendering in fixed width font "aligns":
headers = header.split('\t')
Expand Down

0 comments on commit 0cdcbb3

Please sign in to comment.