Skip to content

Proposal: Remove Single Query Mode for Better Flexibility #571

Open
@mesibo

Description

@mesibo

Hi, I am filing this issue to propose simplifying ann_benchmarks by maintaining only one mode instead of the current single and batch modes and presenting unified benchmarking results independent of mode (currently shown separately). This is based on our discussion on: #568

Currently, the single query mode feeds queries one by one to the algorithm and expects results synchronously, while in batch mode, ann_benchmarks feeds all queries at once to the algorithm and expects results synchronously. The problem arises when an algorithm processes vectors in parallel. In this case, single query mode becomes unusable because it requires immediate output for each query.

If we remove single query mode and keep only batch mode, algorithms would have the flexibility to process queries however they prefer—sequentially or in parallel—while still returning results in the same expected format.

This should not matter for ann_benchmarks since it is essentially the same operation—only the task of feeding query vectors moves from ann_benchmarks to the algorithm, allowing each algorithm to decide on its optimal processing strategy.

This change would also simplify ann_benchmarks as it does not need to support two modes and can present a unified benchmarking view across all algorithms, independent of their internal processing. Since only the final results matter for benchmarking, how the query should be processed should be determined by the algorithm implementation.

The same approach has been used for index building, where all vectors are fed in bulk to the fit() function, and we are proposing the same for queries too. Looking forward to your insights and perspective. We have made some minor changes for this, let me know if we can submit.

On a side note, we have found that batch mode currently does not generate all plots and reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions