8000 GitHub - qieqieplus/fast_topk: A lightweight, header-only C++20 library for highly optimized numeric top-k selection · GitHub
[go: up one dir, main page]

Skip to content
qieqieplusPublic

About

A lightweight, header-only C++20 library for highly optimized numeric top-k selection

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Fast Top-K

License C++20 Header-Only

A lightweight, header-only C++20 library for highly optimized numeric top-k selection, well-suited for vector database applications.

Overview

This fast top-k library adopts codes from Google Research's ScaNN (Scalable Nearest Neighbors) project.

It is refactored as a lean, header-only library with no external dependencies beyond the standard library. Makes it easy to integrate into various projects without the complexity of managing additional dependencies like Bazel, Abseil or TensorFlow, which ScaNN might utilize.

Getting Started

Check test or benchmark as examples.

Performance

Benchmarks

  • CPU: Intel Core i9-9880H @ 2.30GHz
  • Compiler: Apple clang version 16.0.0
  • Sources: fast topk and faiss
  • Other methods, such as torch.topk and std::nth_element, were also benchmarked but showed significantly worse results.

Future Plans

  • GPU accelerated implementation with radix k-th selection.

Acknowledgements

This library benefits from the excellent work done by the Google Research's ScaNN (Scalable Nearest Neighbors) project.

About

A lightweight, header-only C++20 library for highly optimized numeric top-k selection

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages

0