jvector icon indicating copy to clipboard operation
jvector copied to clipboard

Usage of imprecise fp-model=fast.

Open jbhateja opened this issue 5 months ago • 1 comments

With ANN search, we accept giving up accuracy for speed. Since most of the code in jvector_simd.c deals in floating-point computations, it may make sense to pass—fp-model=fast to the GCC compiler at build time. Even though most of the code is directly coded using intrinsics, there should be no harm in passing this option.

With a fast floating point model, the compiler attempts several value-unsafe optimizations[1], like reassociation and parallel reductions (maybe we can replace reduction intrinsics with equivalent C-code and let the compiler do the magic).

Best Regards, Jatin [1] https://www.nccs.nasa.gov/images/FloatingPoint_consistency.pdf

jbhateja avatar Sep 19 '24 18:09 jbhateja