Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing preprocess_query for Distance in InMemDataStore #609

Open
wdongyu opened this issue Dec 9, 2024 · 0 comments
Open

[BUG] Missing preprocess_query for Distance in InMemDataStore #609

wdongyu opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wdongyu
Copy link

wdongyu commented Dec 9, 2024

Expected Behavior

For cosine metric, InMemDataStore use AVXNormalizedCosineDistanceFloat to compute distances and preprocess_query should be called when query. But it seems missing after #384.

  1. Before Adding a new PQ Distance Metric and PQ Data Store #384, in diskann::Index::search and some other snippets, preprocess_query is called through the dist_fn()
_data_store->get_dist_fn()->preprocess_query(query, _data_store->get_dims(), scratch->aligned_query());
  1. After Adding a new PQ Distance Metric and PQ Data Store #384, it change to call _data_store->preprocess_query. But when we navigate to the implementation of InMemDataStore, it only complete the memcpy but missing preprocess_query
template <typename data_t>
void InMemDataStore<data_t>::preprocess_query(const data_t *query, AbstractScratch<data_t> *query_scratch) const
{
    if (query_scratch != nullptr)
    {
        memcpy(query_scratch->aligned_query_T(), query, sizeof(data_t) * this->get_dims());

        // We should add implementation for preprocess_query here?
    }
    else
    {
        ...
    }
}

Actual Behavior

Describe above.

Example Code

Describe above.

Dataset Description

Error

Your Environment

  • Operating system:Debian GNU/Linux 8
  • DiskANN version: from main branch

Additional Details

@wdongyu wdongyu added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant