Skip to content

cuda.coop: plan storage by cooperative group scope - #11203

Draft
tpn wants to merge 2 commits into
codex/cuda-coop-numba-block-load-store-algorithmsfrom
codex/cuda-coop-numba-group-storage-scopes
Draft

cuda.coop: plan storage by cooperative group scope#11203
tpn wants to merge 2 commits into
codex/cuda-coop-numba-block-load-store-algorithmsfrom
codex/cuda-coop-numba-group-storage-scopes

Conversation

@tpn

@tpn tpn commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why this is needed

PR #11200 completes CUB Block Load and Store, but later cooperative families
need one CTA to contain several independent execution groups. Treating
temporary storage as one block-wide slice would make Warp providers alias
storage and synchronize at the wrong scope.

This PR carries the resolved lowering plan through the generic provider marker
so storage layout and synchronization follow the concrete group topology.

Reviewer-visible behavior

  • Storage-bearing providers reserve one aligned slice per block, physical or
    logical warp, or thread.
  • Repeated calls reuse storage only when their execution topology and reuse
    synchronization are compatible.
  • Block providers emit syncthreads, Warp providers emit syncwarp with the
    appropriate subgroup mask, and thread-scoped providers emit no barrier.
  • Caller-owned TempStorage retains the existing single-block
    shared/exclusive contract.
  • Multi-instance caller storage and unsupported group scopes fail before
    provider compilation.
  • Legacy providers without a lowering plan remain accepted only when execution
    and synchronization are both block-scoped.
  • Lowering plans reject topology, participation, storage, and launch facts that
    do not describe the resolved group.

Extensibility proof

A lazily registered test family exercises portable and qualified callable
identity, storage-free and storage-bearing providers, scalar/array/pair
results, physical and logical Warp groups, per-thread storage, x-major ranks,
subgroup masks, and registry cleanup. It requires no changes to activation,
root dispatch, provider caching, header selection, or primitive-family code.

Validation

The exact final-stack head 9b299e894f, which includes this layer, passed:

  • 1,440 source-tree tests with the GPU hidden.
  • 607 installed-wheel contract, packaging, public-surface, and activation
    tests outside the source tree.
  • 50 installed-wheel real NVRTC LTO/nvJitLink compile tests.
  • 366 installed-wheel runtime tests on an RTX PRO 6000.

Stack and scope

This draft is stacked on #11200, which is stacked on #11182. It adds the
generic per-execution-group storage and synchronization seam only. Public Warp
Load/Store APIs and providers are introduced by the next PR.

@copy-pr-bot

copy-pr-bot Bot commented Sep 4, 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.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Sep 4, 2026
@tpn
tpn force-pushed the codex/cuda-coop-numba-block-load-store-algorithms branch from 8ecfb54 to 39755f7 Compare September 4, 2026 16:52
@tpn
tpn force-pushed the codex/cuda-coop-numba-group-storage-scopes branch from 59b7629 to 47c148d Compare September 4, 2026 16:52
@tpn
tpn force-pushed the codex/cuda-coop-numba-block-load-store-algorithms branch from 39755f7 to a4d8965 Compare September 4, 2026 17:54
tpn added 2 commits September 4, 2026 10:55
Carry the resolved lowering plan through the generic provider marker.
The before-inference rewrite can then lay out shared storage by
execution topology.

Allocate aligned slices per block, warp, logical warp, or thread.
Derive reuse barriers and logical-warp masks from plan metadata.
Keep caller-owned block descriptors unchanged, and fail closed for
unrepresentable scopes or inconsistent contracts.

Signed-off-by: Trent Nelson <trent@trent.me>
Extend the lazy registered family across storage-free, block, warp,
logical-warp, and per-thread providers without changing dispatch.

Assert aligned per-instance slices, x-major ranks, subgroup masks,
barrier selection, reuse isolation, caller-storage rejection, and
removal of planner-only metadata from rewritten IR.

Signed-off-by: Trent Nelson <trent@trent.me>
@tpn
tpn force-pushed the codex/cuda-coop-numba-group-storage-scopes branch from 47c148d to 53a60ea Compare September 4, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant