A Reference on Optimizing Vector Search on IBM Power

The vector-on-power-reference repository provides high-performance implementations of distance computation kernels—the backbone of vector databases like FAISS, PGVector, and Knowhere—specifically optimized for IBM Power architectures.

The project achieves significant speedups by moving beyond generic C++ code to leverage Power-specific hardware features:

  • Source-Level Optimization: Utilizing vector data types for better compiler auto-vectorization.
  • Intrinsic-Level Optimization: Directly invoking AltiVec and IBM-specific built-in functions for maximum control over hardware registers.

Whether on RHEL (using gcc) or AIX (using IBM Open XL C/C++), the build process is streamlined via specialized Makefiles.

To test a 32-dimension vector using intrinsic optimizations:

make
./bin/test -s 32 --run_intrinsic_code

The repository includes a testing framework that compares base implementations against Power-optimized versions.

Early benchmarks show optimized ppc64le code can reduce execution time to roughly 40% of the original, delivering a 2.5x performance boost for critical Euclidean and Hamming distance calculations. Note: Hamming distance optimizations require Power 8+ due to the vec_popcnt() requirement.

Reference

  • https://github.com/IBM/vector-distance-reference/tree/main