Skip to content

Support of BBQ Dataset View - #2506

Open
lowener wants to merge 1 commit into
NVIDIA:mainfrom
lowener:26.10-bbq-api
Open

Support of BBQ Dataset View#2506
lowener wants to merge 1 commit into
NVIDIA:mainfrom
lowener:26.10-bbq-api

Conversation

@lowener

@lowener lowener commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR introduce the structures used for the BBQ API. Related PR #2175
Those structures will be used for the support of compressed dataset in CAGRA and NN-Descent (#2326), as well as the BBQ Preprocessing Quantizer (#2162)

The quantizer views, dataset types and aliases are in the preprocessing/quantize/bbq.hpp to avoid circular dependencies

Signed-off-by: Mickael Ide <mide@nvidia.com>
@lowener
lowener requested review from a team as code owners August 25, 2026 19:51
@lowener lowener added the feature request New feature or request label Aug 25, 2026
@lowener lowener added non-breaking Introduces a non-breaking change C++ labels Aug 25, 2026
@lowener lowener changed the title Initial add of BBQ Quantizer View API Support of BBQ Dataset View Aug 25, 2026
@cjnolet cjnolet moved this from Todo to In progress in cuVS Library & Integrations Roadmap Aug 26, 2026
Comment on lines +311 to +319
template <typename T, typename IdxT, typename Accessor>
using dense_owning_vector = std::conditional_t<Accessor::is_device_accessible,
raft::device_vector<T, IdxT>,
raft::host_vector<T, IdxT>>;

template <typename T, typename IdxT, typename Accessor>
using dense_view_vector = std::conditional_t<Accessor::is_device_accessible,
raft::device_vector_view<T, IdxT>,
raft::host_vector_view<T, IdxT>>;

@achirkin achirkin Aug 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a funny one :)

Suggested change
template <typename T, typename IdxT, typename Accessor>
using dense_owning_vector = std::conditional_t<Accessor::is_device_accessible,
raft::device_vector<T, IdxT>,
raft::host_vector<T, IdxT>>;
template <typename T, typename IdxT, typename Accessor>
using dense_view_vector = std::conditional_t<Accessor::is_device_accessible,
raft::device_vector_view<T, IdxT>,
raft::host_vector_view<T, IdxT>>;
template <typename T, typename IdxT, typename Accessor>
using vector = raft::mdarray<T, raft::vector_extent<IdxT>, raft::layout_c_contiguous, Accessor>
template <typename T, typename IdxT, typename Accessor>
using vector_view = raft::mdspan<T, raft::vector_extent<IdxT>, raft::layout_c_contiguous, Accessor>
  1. Don't use host/device aliases as the base type - just use the accessor itself on the raw type
  2. We have an established naming scheme for these: scalar/vector/matrix/mdarray and corresponding {object}_view
  3. In the end, they really belong to raft rather than cuvs

You can have a look an mimic the definitions at https://github.com/NVIDIA/raft/blob/main/cpp/include/raft/core/device_mdarray.hpp and https://github.com/NVIDIA/raft/blob/main/cpp/include/raft/core/device_mdspan.hpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ feature request New feature or request non-breaking Introduces a non-breaking change

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants