FlashML-org/flashlib

Fast and memory-efficient classical machine learning operators

What it solves

FlashLib provides high-performance GPU implementations of classical machine learning operators (such as clustering, dimensionality reduction, and regression) that are often slower or less efficient than modern deep learning kernels. It aims to bring the efficiency of "Flash" style optimizations to traditional ML tasks.

How it works

Built on Triton and CuteDSL, the library implements a wide array of primitives as both top-level functions and scikit-learn style classes. It includes specialized Approximate Nearest Neighbor (ANN) indexes like IVFFlat (for high recall), IVFPQ (for memory compression), and CAGRA (for high-throughput search using fused greedy traversal on proximity graphs).

Who it’s for

Data scientists and ML engineers who need to run classical ML algorithms on massive datasets using GPUs to reduce computation time and memory overhead.

Highlights

  • Broad Coverage: Includes 18 high-level primitives across clustering, nearest neighbors, decomposition, manifold learning, regression, and classification.
  • Optimized ANN Search: Offers multiple indexing strategies (IVF-Flat, IVF-PQ, CAGRA) to balance speed, recall, and memory usage.
  • Multi-precision GEMM: Provides a Pareto-frontier of GEMM variants (e.g., TF32, BF16, FP16, Int8) for flexible precision and performance.
  • Resource Estimation: A flashlib.info submodule that predicts runtime, FLOPs, and HBM bytes on the CPU without needing a GPU or heavy imports.

Related

  • Project
  • Project
  • Project
  • Project
  • Project