Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add byte-oriented sizing and validation utilities for `bloom_filter`

已关闭
#829 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@yuweih205 已经在做这个了。

开始于 2026年9月5日。

  • #841 来自 @yuweih205 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
data

调研方向

从定义了 words_per_block 和 max_filter_blocks 的 include/cuco/detail/bloom_filter/parametric_filter_policy.cuh 开始,然后追踪现有的 cuco::bloom_filter 按 block 数量构造的构造函数和大小计算入口。添加面向字节的构造与大小计算工具,确保结果经过对齐、为正值且受 policy 限制,并采用一致的验证方式;完成标准是调用方不再需要重新实现这些约束。

由索引模型根据 Issue 内容生成。

描述

helps: rapids topic: bloom_filter type: feature request

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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/cuCollections 的其他 Issue

查看 NVIDIA/cuCollections 的全部 Issue

相似的 Issue

更多 Data Engineering Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。