Skip to content

Commit

Permalink
max disk read in rerank
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanhaoji2 committed Mar 2, 2025
1 parent cd2bf73 commit e7f7f96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const float GRAPH_SLACK_FACTOR = 1.3f;
// SSD Index related limits
const uint64_t MAX_GRAPH_DEGREE = 512;
const uint64_t SECTOR_LEN = 4096;
const uint64_t MAX_N_SECTOR_READS = 128;
const uint64_t MAX_N_SECTOR_READS = 500;

// following constants should always be specified, but are useful as a
// sensible default at cli / python boundaries
Expand Down
4 changes: 2 additions & 2 deletions src/pq_flash_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,8 +1677,8 @@ void PQFlashIndex<T, LabelT>::cached_beam_search(const T *query1, const uint64_t

std::vector<AlignedRead> vec_read_reqs;

if (full_retset.size() > k_search * FULL_PRECISION_REORDER_MULTIPLIER)
full_retset.erase(full_retset.begin() + k_search * FULL_PRECISION_REORDER_MULTIPLIER, full_retset.end());
if (full_retset.size() > defaults::MAX_N_SECTOR_READS)
full_retset.erase(full_retset.begin() + defaults::MAX_N_SECTOR_READS, full_retset.end());

for (size_t i = 0; i < full_retset.size(); ++i)
{
Expand Down

0 comments on commit e7f7f96

Please sign in to comment.