-
Notifications
You must be signed in to change notification settings - Fork 547
feat: add diskann index #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e38efb9
43c9db5
043456d
dae465c
1202e42
d9503d3
c24cd82
87a1b8c
4e668da
fe60376
dc3d0a8
071d275
78eea04
41f893d
4cc1ecb
35192e7
53f9ef9
f3ee4ca
9ac2c3f
f78ff5d
9d0a63b
1e23806
12ae920
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,14 @@ jobs: | |
| sudo apt-get install -y clang libomp-dev | ||
| shell: bash | ||
|
|
||
| - name: Install AIO | ||
| if: runner.os == 'Linux' && runner.arch == 'X64' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| libaio-dev | ||
| shell: bash | ||
|
|
||
| - name: Print CPU info | ||
| if: runner.os == 'Linux' | ||
| run: lscpu | ||
|
|
@@ -89,7 +97,7 @@ jobs: | |
| pytest \ | ||
| scikit-build-core \ | ||
| setuptools_scm | ||
| shell: bash | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 把bash加回去吧,统一一点,并且如果后续这里是多行命令,在非bash为默认shell的环境下可能会出问题
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| shell: bash | ||
|
|
||
| - name: Build from source | ||
| run: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -361,4 +361,4 @@ class LloydCluster { | |
| }; | ||
|
|
||
| } // namespace ailego | ||
| } // namespace zvec | ||
| } // namespace zvec | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,26 +19,51 @@ set(SRC_LISTS | |
| pybind11_add_module(_zvec ${SRC_LISTS}) | ||
|
|
||
| if (CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
| target_link_libraries(_zvec PRIVATE | ||
| -Wl,--whole-archive | ||
| $<TARGET_FILE:core_knn_flat_static> | ||
| $<TARGET_FILE:core_knn_flat_sparse_static> | ||
| $<TARGET_FILE:core_knn_hnsw_static> | ||
| $<TARGET_FILE:core_knn_hnsw_rabitq_static> | ||
| $<TARGET_FILE:core_knn_hnsw_sparse_static> | ||
| $<TARGET_FILE:core_knn_ivf_static> | ||
| $<TARGET_FILE:core_knn_vamana_static> | ||
| $<TARGET_FILE:core_knn_cluster_static> | ||
| $<TARGET_FILE:core_mix_reducer_static> | ||
| $<TARGET_FILE:core_metric_static> | ||
| $<TARGET_FILE:core_utility_static> | ||
| $<TARGET_FILE:core_quantizer_static> | ||
| -Wl,--no-whole-archive | ||
| zvec_db | ||
| ) | ||
| target_link_options(_zvec PRIVATE | ||
| "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports.map" | ||
| ) | ||
| if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|arm") | ||
| target_link_libraries(_zvec PRIVATE | ||
| -Wl,--whole-archive | ||
| $<TARGET_FILE:core_knn_flat_static> | ||
| $<TARGET_FILE:core_knn_flat_sparse_static> | ||
| $<TARGET_FILE:core_knn_hnsw_static> | ||
| $<TARGET_FILE:core_knn_hnsw_rabitq_static> | ||
| $<TARGET_FILE:core_knn_hnsw_sparse_static> | ||
| $<TARGET_FILE:core_knn_ivf_static> | ||
| $<TARGET_FILE:core_knn_vamana_static> | ||
| $<TARGET_FILE:core_knn_cluster_static> | ||
| $<TARGET_FILE:core_mix_reducer_static> | ||
| $<TARGET_FILE:core_metric_static> | ||
| $<TARGET_FILE:core_utility_static> | ||
| $<TARGET_FILE:core_quantizer_static> | ||
| -Wl,--no-whole-archive | ||
| zvec_db | ||
| ) | ||
| target_link_options(_zvec PRIVATE | ||
| "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports.map" | ||
| ) | ||
| else () | ||
| target_link_libraries(_zvec PRIVATE | ||
| -Wl,--whole-archive | ||
| $<TARGET_FILE:core_knn_flat_static> | ||
| $<TARGET_FILE:core_knn_flat_sparse_static> | ||
| $<TARGET_FILE:core_knn_hnsw_static> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 代码有重复,可以调整一下 |
||
| $<TARGET_FILE:core_knn_hnsw_rabitq_static> | ||
| $<TARGET_FILE:core_knn_hnsw_sparse_static> | ||
| $<TARGET_FILE:core_knn_ivf_static> | ||
| $<TARGET_FILE:core_knn_vamana_static> | ||
| $<TARGET_FILE:core_knn_diskann_static> | ||
| $<TARGET_FILE:core_knn_cluster_static> | ||
| $<TARGET_FILE:core_mix_reducer_static> | ||
| $<TARGET_FILE:core_metric_static> | ||
| $<TARGET_FILE:core_utility_static> | ||
| $<TARGET_FILE:core_quantizer_static> | ||
| -Wl,--no-whole-archive | ||
| zvec_db | ||
| aio | ||
| ) | ||
| target_link_options(_zvec PRIVATE | ||
| "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports.map" | ||
| ) | ||
| endif() | ||
| elseif (APPLE) | ||
| target_link_libraries(_zvec PRIVATE | ||
| -Wl,-force_load,$<TARGET_FILE:core_knn_flat_static> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果用户的环境没有装libaio-dev,会发生什么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在默认使用是需要安装libaio,可以通过配置的方式进行区分,千问的建议是通过linux安装包的方式安装libaio库:
Installation
zvec requires the
libaiosystem library on linux platform.On Ubuntu/Debian:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果没有安装,会发生什么?这里预期的行为应该是 如果用户不安装aio,不影响除diskann的其他功能使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在新的PR里做了调整:#378