Skip to content

Commit

Permalink
Merge pull request #296 from jinwei14/overwrite_pq_dim
Browse files Browse the repository at this point in the history
allow QD to overwrite derived pq dim from -B
  • Loading branch information
gopalrs authored Apr 3, 2023
2 parents 4c8041b + 844f751 commit b6eccbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/disk_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ int build_disk_index(const char *dataFilePath, const char *indexFilePath, const

if (param_list.size() >= 9 && atoi(param_list[8].c_str()) <= MAX_PQ_CHUNKS && atoi(param_list[8].c_str()) > 0)
{
std::cout << "Use quantized dimension (QD) to overwrite derived quantized dimension from search_DRAM_budget (B)"
<< std::endl;
num_pq_chunks = atoi(param_list[8].c_str());
}

Expand Down
8 changes: 1 addition & 7 deletions tests/build_disk_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char **argv)
desc.add_options()("max_degree,R", po::value<uint32_t>(&R)->default_value(64), "Maximum graph degree");
desc.add_options()("Lbuild,L", po::value<uint32_t>(&L)->default_value(100),
"Build complexity, higher value results in better graphs");
desc.add_options()("search_DRAM_budget,B", po::value<float>(&B)->default_value(0),
desc.add_options()("search_DRAM_budget,B", po::value<float>(&B)->required(),
"DRAM budget in GB for searching the index to set the "
"compressed level for data while search happens");
desc.add_options()("build_DRAM_budget,M", po::value<float>(&M)->required(),
Expand Down Expand Up @@ -131,12 +131,6 @@ int main(int argc, char **argv)
}
}

if (QD && B)
{
std::cout << "Error: error passing in both quantized dimension (QD) and search_DRAM_budget(B) " << std::endl;
return -1;
}

std::string params = std::string(std::to_string(R)) + " " + std::string(std::to_string(L)) + " " +
std::string(std::to_string(B)) + " " + std::string(std::to_string(M)) + " " +
std::string(std::to_string(num_threads)) + " " + std::string(std::to_string(disk_PQ)) + " " +
Expand Down

0 comments on commit b6eccbf

Please sign in to comment.