diff --git a/include/knowhere/comp/knowhere_config.h b/include/knowhere/comp/knowhere_config.h index de845b6c..1071543f 100644 --- a/include/knowhere/comp/knowhere_config.h +++ b/include/knowhere/comp/knowhere_config.h @@ -40,6 +40,17 @@ class KnowhereConfig { static std::string SetSimdType(const SimdType simd_type); + /** + *The purpose of this interface is: part of the sealed indexes default to using bf16 as the base data to achieve + *higher capacity; to ensure consistency in computation between growing and sealed, it is necessary to maintain the + *same precision in growing calculations as in sealed. + */ + static void + EnablePatchForComputeFP32AsBF16(); + + static void + DisablePatchForComputeFP32AsBF16(); + /** * Set openblas threshold * if nq < use_blas_threshold, calculated by omp diff --git a/src/common/comp/knowhere_config.cc b/src/common/comp/knowhere_config.cc index 126529d2..415be16a 100644 --- a/src/common/comp/knowhere_config.cc +++ b/src/common/comp/knowhere_config.cc @@ -89,6 +89,16 @@ KnowhereConfig::SetSimdType(const SimdType simd_type) { return simd_str; } +void +KnowhereConfig::EnablePatchForComputeFP32AsBF16() { + LOG_KNOWHERE_INFO_ << "Just interface adaptation. Enable patch for compute fp32 as bf16"; +} + +void +KnowhereConfig::DisablePatchForComputeFP32AsBF16() { + LOG_KNOWHERE_INFO_ << "Just interface adaptation. Disable patch for compute fp32 as bf16"; +} + void KnowhereConfig::SetBlasThreshold(const int64_t use_blas_threshold) { LOG_KNOWHERE_INFO_ << "Set faiss::distance_compute_blas_threshold to " << use_blas_threshold;