Skip to content

Commit

Permalink
enhance: [Cherry-pick] Custom bitset and bitset_view implementations (#…
Browse files Browse the repository at this point in the history
…31592)

Issue: #31285
pr: #30454

Basically, I've replaced FixedVector<bool> and boost::dynamic_bitset
with custom bitset and bitsetview in order to reduce the memory
bandwidth & increase performance for the filtering.

(cherry picked from commit 5dcecc8)
  • Loading branch information
alexanderguzhva committed Mar 26, 2024
1 parent 17eb0c2 commit 3addc68
Show file tree
Hide file tree
Showing 90 changed files with 15,250 additions and 5,571 deletions.
4 changes: 1 addition & 3 deletions internal/core/src/CMakeLists.txt
Expand Up @@ -33,6 +33,4 @@ add_subdirectory( query )
add_subdirectory( segcore )
add_subdirectory( indexbuilder )
add_subdirectory( exec )
if(USE_DYNAMIC_SIMD)
add_subdirectory( simd )
endif()
add_subdirectory( bitset )
33 changes: 33 additions & 0 deletions internal/core/src/bitset/CMakeLists.txt
@@ -0,0 +1,33 @@
set(BITSET_SRCS
detail/platform/dynamic.cpp
)

if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
list(APPEND BITSET_SRCS
detail/platform/x86/avx2-inst.cpp
detail/platform/x86/avx512-inst.cpp
detail/platform/x86/instruction_set.cpp
)

set_source_files_properties(detail/platform/x86/avx512-inst.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512vl -mavx512dq")
set_source_files_properties(detail/platform/x86/avx2-inst.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mavx -mfma")

# set_source_files_properties(detail/platform/dynamic.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512vl -mavx512dq")
# set_source_files_properties(detail/platform/dynamic.cpp PROPERTIES COMPILE_FLAGS "-mavx2 -mavx -mfma")
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm*")
list(APPEND BITSET_SRCS
detail/platform/arm/neon-inst.cpp
detail/platform/arm/sve-inst.cpp
)

# targeting AWS graviton,
# https://github.com/aws/aws-graviton-getting-started/blob/main/c-c%2B%2B.md

# let dynamic.cpp know that SVE is available
# comment it out for now
# set_source_files_properties(detail/platform/dynamic.cpp PROPERTIES COMPILE_FLAGS "-mcpu=neoverse-v1")

set_source_files_properties(detail/platform/arm/sve-inst.cpp PROPERTIES COMPILE_FLAGS "-mcpu=neoverse-v1")
endif()

add_library(milvus_bitset ${BITSET_SRCS})

0 comments on commit 3addc68

Please sign in to comment.