Add byte-oriented sizing and validation utilities for `bloom_filter`
维护者通常 1 天内回复
评估
调研方向
从定义了 words_per_block 和 max_filter_blocks 的 include/cuco/detail/bloom_filter/parametric_filter_policy.cuh 开始,然后追踪现有的 cuco::bloom_filter 按 block 数量构造的构造函数和大小计算入口。添加面向字节的构造与大小计算工具,确保结果经过对齐、为正值且受 policy 限制,并采用一致的验证方式;完成标准是调用方不再需要重新实现这些约束。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
cuco::bloom_filter is currently sized only by num_blocks (a raw count of filter blocks). Callers that think in terms of a storage budget in bytes, which is the natural unit for memory allocation and for distributed work, have to convert bytes to blocks themselves and re-derive the policy's constraints: a filter size must be a positive multiple of the block size (words_per_block * sizeof(word_type)) and no greater than the policy maximum (max_filter_blocks).
This came up in rapidsai/cudf#23067, where libcudf_streaming's device_bloom_filter wrapper re-implements this sizing logic: a byte-sized constructor, an aligned_size(bytes) helper that rounds a byte count down to the largest valid filter size, and a max_size() accessor for the policy's upper bound. This is general-purpose logic that every cuco bloom filter user needs, not something specific to cudf, so it belongs in cuco with the corresponding validation checks rather than being re-derived by each caller.
Describe the solution you'd like
Expose byte-oriented sizing utilities directly on cuco::bloom_filter / its policy, mirroring the convenience constructors HyperLogLog already provides (cuco::sketch_size_kb, cuco::standard_deviation). Concretely:
- A way to construct or size a filter from a target storage size in bytes, alongside the existing block-count path.
- An
aligned_size-style helper that returns the largest valid filter size not exceeding a requested byte count (a positive multiple of the block size, capped at the policy maximum). - An accessor for the maximum storage size supported by the filter policy.
- The associated validation (positive, multiple of block size, within the policy limit) built into these utilities so callers get consistent error checking.
Describe alternatives you've considered
Keeping the conversion in each downstream project, as libcudf_streaming does today. This duplicates the block-size and maximum-size rules across users and risks them drifting from the policy's actual constraints.
Additional context
Origin discussion: https://github.com/rapidsai/cudf/pull/23067#discussion_r3562252707. The relevant policy constants (words_per_block, max_filter_blocks) live here: https://github.com/NVIDIA/cuCollections/blob/0883368d39296f3bef3a058033141bcc642c5c54/include/cuco/detail/bloom_filter/parametric_filter_policy.cuh#L101-L119
- 主要语言
- Cuda
- 星标
- 674
- 派生
- 123
- 平均合并
- 3 天 9 小时
- 30 天内合并 PR
- 10
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/cuCollections 的其他 Issue
-
Add cuco::detail::stream_sync(cuda::stream_ref) to centralize CCCL version-specific API naming可能重新可做 @0z5a 于 30 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
NVIDIA/cuCollections#840 · 1 条评论 ·
维护者通常 1 天内回复
-
nvidia-runners
难度 1/5 1-3 小时 新手友好度 25/100
NVIDIA/cuCollections#853 ·
维护者通常 1 天内回复
-
topic: performance type: feature request
难度 5/5 一周以上 新手友好度 35/100
NVIDIA/cuCollections#817 · 7 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
good first issue P2: Nice to have type: improvement
难度 4/5 3-5 天 新手友好度 38/100
NVIDIA/cuCollections#805 · 4 条评论 ·
维护者通常 1 天内回复
-
[FEA] Add MPSC/MPMC concurrent queue可能重新可做 @sleeepyjack 于 270 天前认领,目前没有进行中的 PR。 未关闭maintainer-only type: feature request
NVIDIA/cuCollections#791 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 NVIDIA/cuCollections 的全部 Issue
相似的 Issue
-
good first issue lead variant:container
难度 2/5 1-3 小时 新手友好度 76/100
radialmonster/orf-cleanroom#10 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
-
dataset good first issue
难度 2/5 1-3 小时 新手友好度 84/100
National-Digital/publicdata.au#218 ·
维护者通常 1 天内回复
-
freshness freshness:observed-only
难度 2/5 1-3 小时 新手友好度 68/100
thoroc/context-radar#280 ·
-
area:data data-quality
难度 2/5 1-3 小时 新手友好度 68/100
reacher-z/Awesome-CUA#1468 ·
维护者通常 1 天内回复