Skip to content

[BUG] Missing preprocess_query for Distance in InMemDataStore #609

Open
@wdongyu

Description

@wdongyu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions