Skip to content

[cudax][cuco] Add fixed_capacity_set core APIs - #11869

Merged
PointKernel merged 17 commits into
NVIDIA:mainfrom
PointKernel:cuco-fixed-capacity-set-11126
Oct 29, 2026
Merged

PointKernel merged 17 commits into
NVIDIA:mainfrom
PointKernel:cuco-fixed-capacity-set-11126

Conversation

@PointKernel

Copy link
Copy Markdown
Member

Description

Closes #11126.

This PR migrates the core cuCollections static_set APIs to CCCL as fixed_capacity_set and fixed_capacity_set_ref, reusing the shared open-addressing implementation.

Includes static, dynamic, and load-factor construction; synchronous/asynchronous insert, contains, and clear; scalar and cooperative-group device operations; and corresponding tests and benchmarks.

Storage alignment is derived at compile time to provide aligned, padded allocations for subword atomics while preserving existing map allocation behavior.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Add owning and non-owning sets with constructors, insert, contains, clear,
capacity accessors, and scalar/cooperative device operations for NVIDIA#11126.

Request padded, atomically aligned set storage through an optional internal
allocation alignment argument while preserving map allocation defaults.
Add focused C2H coverage, compile-failure checks, and NVBench benchmarks.
Derive slot alignment from the storage type in a shared constexpr and use
it for every allocation path while retaining natural map alignment.
Accept CUDA-trivially-copyable keys and exercise a half2 wrapper.

Simplify allocation tests and adapt upstream cross-stream, atomic-storage,
and large-input regressions, with broader heterogeneous probing coverage.
@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Use double hashing with cooperative group size four and xxHash32 for
fixed_capacity_set, preserving the cuCollections static_set defaults.
Document the default policy and cover its propagation to the device ref
and prime-based capacity rounding.
@PointKernel PointKernel added the cuco cuCollections label Oct 5, 2026
@PointKernel

Copy link
Copy Markdown
Member Author

/ok to test

@github-actions

This comment has been minimized.

@PointKernel

Copy link
Copy Markdown
Member Author

/ok to test

@github-actions

This comment has been minimized.

@PointKernel

Copy link
Copy Markdown
Member Author

/ok to test

@github-actions

This comment has been minimized.

@PointKernel
PointKernel marked this pull request as ready for review October 15, 2026 19:38
@PointKernel
PointKernel requested review from a team as code owners October 15, 2026 19:38
@PointKernel
PointKernel requested a review from shwina October 15, 2026 19:38
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: c51dcd0
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 47d41379-d7cc-4d81-891a-dc317c32d7c3
Commits

Reviewing files that changed from the base of the PR and between dc380ad and 09c3bf9.

Files selected for processing: 2
  • cudax/benchmarks/bench/cuco/CMakeLists.txt
  • cudax/test/cuco/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added fixed-capacity GPU sets for unique keys, with configurable capacity, equality, and probing behavior.
    • Added owning and non-owning interfaces for synchronous and asynchronous insertion, lookup, and clearing.
  • Bug Fixes
    • Improved storage alignment for fixed-capacity sets and maps, including for smaller key types.
  • Benchmarks
    • Added benchmarks for set insertion and membership checks.
  • Tests
    • Expanded coverage of set capacity, insertion, lookup, references, and custom configurations, plus map alignment.

Adds an owning fixed-capacity set and a non-owning reference with insertion, lookup, clearing, and capacity APIs. Updates open-addressing allocation alignment and insertion-slot scanning. Adds tests and benchmarks for the set and its reference.

Changes: Fixed-capacity set

Layer / File(s) Summary
Open-addressing storage and insertion scan
cudax/include/cuda/experimental/__cuco/detail/open_addressing/*, cudax/test/cuco/fixed_capacity_map/test_capacity.cu
Open-addressing allocations now request alignment based on the stored type. The bucket scan uses cuda::static_for to find an insertion slot. Map tests check allocation alignment and insertion around rehash.
Non-owning set reference
cudax/include/cuda/experimental/__cuco/fixed_capacity_set_ref.cuh, cudax/test/cuco/fixed_capacity_set/test_ref.cu
fixed_capacity_set_ref adds accessors and single-thread and cooperative-group insert and lookup operations. Tests cover external storage, key types, extents, and thread scopes.
Owning set API and validation
cudax/include/cuda/experimental/__cuco/fixed_capacity_set.cuh, cudax/test/cuco/fixed_capacity_set/*, cudax/test/cuco/CMakeLists.txt
fixed_capacity_set adds constructors, clear, insert, contains, capacity, accessors, and reference creation. Tests cover capacity, policies, alignment, insertion, lookup, and clearing.
Set benchmarks
cudax/benchmarks/bench/cuco/CMakeLists.txt, cudax/benchmarks/bench/cuco/fixed_capacity_set/*
Adds insertion and containment benchmarks with input-count, occupancy, matching-rate, and key-multiplicity sweeps.

Assessment against linked issues

Objective Addressed Explanation
Add fixed-capacity set constructors and insert, contains, capacity, and clear APIs, with corresponding tests and benchmarks [#11126] ✅

Possibly related issues

Priority: Normal

Merge Risk: Minimal · up to 09c3b

The fixed-capacity set test and benchmark directories are wired consistently, and the reviewed storage alignment behavior has no remaining merge-blocking risk.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cccl/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: f267d7d3-f1b9-4f40-a2f0-3fcb9f874d73
📥 Commits

Reviewing files that changed from the base of the PR and between b99fc82 and 3c834cb.

📒 Files selected for processing: 16
  • cudax/benchmarks/bench/cuco/CMakeLists.txt
  • cudax/benchmarks/bench/cuco/fixed_capacity_set/CMakeLists.txt
  • cudax/benchmarks/bench/cuco/fixed_capacity_set/contains.cu
  • cudax/benchmarks/bench/cuco/fixed_capacity_set/insert.cu
  • cudax/include/cuda/experimental/__cuco/detail/open_addressing/open_addressing_impl.cuh
  • cudax/include/cuda/experimental/__cuco/detail/open_addressing/open_addressing_ref_impl.cuh
  • cudax/include/cuda/experimental/__cuco/fixed_capacity_set.cuh
  • cudax/include/cuda/experimental/__cuco/fixed_capacity_set_ref.cuh
  • cudax/test/cuco/CMakeLists.txt
  • cudax/test/cuco/fixed_capacity_set/CMakeLists.txt
  • cudax/test/cuco/fixed_capacity_set/test_capacity.cu
  • cudax/test/cuco/fixed_capacity_set/test_capacity_fail.cu
  • cudax/test/cuco/fixed_capacity_set/test_common.cuh
  • cudax/test/cuco/fixed_capacity_set/test_insert_and_contains.cu
  • cudax/test/cuco/fixed_capacity_set/test_key_size_fail.cu
  • cudax/test/cuco/fixed_capacity_set/test_ref.cu

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…-set-11126

# Conflicts:
#	cudax/benchmarks/bench/cuco/CMakeLists.txt
@PointKernel
PointKernel enabled auto-merge (squash) October 29, 2026 17:40
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 26m: Pass: 100%/73 | Total: 17h 42m | Max: 1h 11m | Hits: 74%/62608

See results here.

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

Labels

cuco cuCollections

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[CUCO][FEA]: Add fixed_capacity_set container skeleton and constructors

4 participants