Skip to content

[Rust] Support callable Block Reduce with uniform i32 captures - #12248

Closed
tpn wants to merge 333 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-callables-stable199
Closed

tpn wants to merge 333 commits into
NVIDIA:mainfrom
tpn:codex/cuda-coop-rust-callables-stable199

Conversation

@tpn

@tpn tpn commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #12119, which now owns this implementation within its complete feature family. The original commits, branch and validation evidence remain available. This draft is closed unmerged.


Historical scope and validation below refer to the original source heads.

Allow function items and closures in full-input i32 Block Reduce with explicit Raking. The operator must be associative. A closure may capture one immutable i32 by value when the compiler proves it is block-uniform. The actual callable passes through generic helpers while participation, payload validity and scratch reuse remain checked; scalar reduction uses the same path.

Follows Run Length Decode #12247 and uses the capture-capable compiler owned by cuda-rust #1625. Review the combined owning diff: nine implementation/example/docs files and 68 Cargo pin/lock files. GitHub's main-based diff includes prerequisites.

Consolidates #12249 while retaining separate stateless and capture commits. The terminal source and compiler pin are exactly the accepted capture version. References, mutable/general captures, other types, Warp groups, other algorithms and partial inputs remain unsupported.

Original qualification covers host/docs/native checks, admission controls, Normal/Full public and scalar builds, ordinary and fresh HTTPS compiler installations, and callback ABI/resource inspection. Stateless and capture validation each passed eight GPU runs, including six sanitizer checks; capture execution used ordinary Normal binaries. Capture Full-profile and HTTPS GPU execution remain unverified. Whole artifacts differ across transports; no performance improvement is claimed. The accepted endpoint passed host CI (115 tests/doctests; 20 native tests excluded); checks for this updated draft are tracked separately.

tpn added 30 commits October 21, 2026 08:45
Shift blocked-order values by one item while preserving input and
returning a fresh payload. Keep the exposed edge invalid until the
caller initializes it, and guard the native output read at that
boundary.

Include inferred generic helpers, a runnable example and guide, and
behavioral coverage for boundary validity and collective
participation.
Preserve the input and return fresh differences with typed neighbors
and counts. Copy inactive suffix items and validate the complete input
before native reads, including calls with a zero count.

Reuse the existing payload and scratch interfaces for the seven CUB
forms. Add the generic example, guide and focused compiler and runtime
coverage. Correct the synchronization function name in Shuffle
documentation.
Return fresh head and tail flags while preserving numeric inputs.
Support typed outside neighbors and independent paired results with
existing payload, validity and shared-storage interfaces.

Add a generic XYZ example, guide and focused compiler and runtime
coverage for the eight supported CUB forms.

Signed-off-by: Trent Nelson <[email protected]>
Return fresh striped counters with a selectable type and extent while
preserving the input payload. Validate sample bounds before native CUB
execution and plan the complete counter and algorithm scratch region.

Include a generic example, behavioral checks and the compiler
requirement in the Rust guide.

Signed-off-by: Trent Nelson <[email protected]>
Sort selected key bits in either direction into a fresh blocked payload.
Preserve input values through the checked collective and storage APIs,
with inferred types and independent static or runtime bounds.
Return fresh key and value payloads with stable selected-digit ordering
and preserve both inputs. Use the native CUB pair specialization with
independent payload types, alignments and checked validity.

Signed-off-by: Trent Nelson <[email protected]>
Return stable selected-digit ranks as fresh i32 payloads and preserve
integer keys. Support static digit widths and checked uniform bounds on
complete XYZ blocks through the native CUB rank specialization.

Signed-off-by: Trent Nelson <[email protected]>
Sort numeric keys into fresh results with checked prefix validity and
configurable order and temporary storage.

Signed-off-by: Trent Nelson <[email protected]>
Carry numeric values with their keys through Block and Warp merge
sorts, returning fresh payloads with checked prefix validity.
Add a generic example and document storage and comparator behavior.

Signed-off-by: Trent Nelson <[email protected]>
Provide min and max selection for keys and key-value pairs with typed
counts, partial input limits, fresh results and checked validity.
Select one native call per operation so exclusive storage charges one
scratch region. Include generic examples and focused diagnostics.

Signed-off-by: Trent Nelson <[email protected]>
Decode fresh windows or complete streams into checked destinations.
Preserve independent run, window and ownership extents. Validate run
lengths and offsets, retaining input payloads and result validity.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
Keep the owning implementation and tests unchanged while applying
its scoped compiler, lock and documentation compatibility updates.

Signed-off-by: Trent Nelson <[email protected]>
tpn added 20 commits October 23, 2026 16:19
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Merge the corrected prerequisite while preserving this owner.

Signed-off-by: Trent Nelson <[email protected]>
Pass function items and stateless closures through the consuming
binary_op builder for full-input i32 Block Raking reductions. Keep
built-in operators, inferred payloads and root-only results intact.

Serve the existing callback protocol from the native provider and pin
the compiler support used by the public example and generic helper.

Signed-off-by: Trent Nelson <[email protected]>
Document immutable i32 captures through the existing consuming options
and generic helper. Exercise two runtime bias values while preserving
the existing built-in results and inputs. Pin the matching compiler
revision that proves the actual shared capture contents.

Signed-off-by: Trent Nelson <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Oct 24, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Oct 24, 2026
@tpn tpn changed the title [Rust] Support stateless callable Block Reduce [Rust] Support callable Block Reduce with uniform i32 captures Oct 24, 2026
@tpn tpn closed this Oct 25, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CCCL Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant