-
Notifications
You must be signed in to change notification settings - Fork 143
Vamana build improvement and added docs #558
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
Conversation
|
/ok to test |
e4b557d to
f125b6d
Compare
f125b6d to
61819c5
Compare
docs/source/indexes/vamana.rst
Outdated
| Vamana builds a graph that is stored in device memory. However, in order to serialize the index and write it to a file for later use, it must be moved into host memory. If the `include_dataset` parameter is also set, then the dataset must be resident in host memory when calling serialize as well. | ||
|
|
||
| Device memory usage | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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.
I'm surprised the docs built without error. I'm sure there's a warning in there about having the underlining for headings be longer the text.
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.
Fixed all the DiskANN/vamana docs.
docs/source/indexes/vamana.rst
Outdated
|
|
||
| The built index represents the graph as fixed degree, storing a total of :math:`graph_degree * n_index_vectors` edges. Graph construction also requires the dataset be in device memory (or it copies it to device during build). In addition, device memory is used during construction to sort and create the reverse edges. Thus, the amount of device memory needed depends on the dataset itself, but it is bounded by a maximum sum of: | ||
|
|
||
| - vector dataset: :math:`n_index_vectors * n__dims * sizeof(T)` |
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.
I think you might need to escape all of the _'s in here. Have you checked to see how this formats?
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.
Did a quick scan but didn't look at all the formatting details. Thanks for checking, I'll do a pass over the format of the final built docs.
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.
Fixed.
tfeher
left a comment
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.
Thanks @bkarsin for the PR, it looks great! I have just a few small suggestions below.
| T* s_coords = reinterpret_cast<T*>(&smem[sort_smem_size]); | ||
| DistPair<IdxT, accT>* new_nbh_list = | ||
| reinterpret_cast<DistPair<IdxT, accT>*>(&smem[dim * sizeof(T) + sort_smem_size]); | ||
| int align_padding = (((dim - 1) / alignof(ShmemLayout)) + 1) * alignof(ShmemLayout) - dim; |
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.
| int align_padding = (((dim - 1) / alignof(ShmemLayout)) + 1) * alignof(ShmemLayout) - dim; | |
| // #include <raft/util/cuda_dev_essentials.cuh> | |
| int align_padding = raft::alignTo<int>(dim, alignof(ShmemLayout)) - dim; |
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.
Thanks, done.
8d00af5 to
c14e002
Compare
tfeher
left a comment
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.
Thanks @bkarsin for the updates, the PR looks good to me!
|
/merge |
Includes several fixes and improvements to Vamana, primarily:
The edge case fix adds padding to all shared memory size and offset calculations so any dataset dimension is supported (tests added that verify this). A bug was also fixed with the L2 distance metric causing incorrect results in some rare cases.
This PR addresses the most pressing items in #393 and stabilize the index construction sufficiently to remove the experimental namespace.