Skip to content

cuda.coop: add physical Warp Load and Store - #11205

Draft
tpn wants to merge 4 commits into
codex/cuda-coop-numba-group-storage-scopesfrom
codex/cuda-coop-numba-warp-load-store
Draft

cuda.coop: add physical Warp Load and Store#11205
tpn wants to merge 4 commits into
codex/cuda-coop-numba-group-storage-scopesfrom
codex/cuda-coop-numba-warp-load-store

Conversation

@tpn

@tpn tpn commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why this is needed

The preceding stack establishes the Numba-CUDA-MLIR foundation, completes
Block Load/Store, and makes temporary storage group-scoped. This PR uses those
seams to add the first concrete non-block collective without changing
activation, phase orchestration, caching, or generic rewrite dispatch.

Keeping this layer to complete 32-lane physical warps makes participation,
addressing, storage, and synchronization guarantees reviewable before logical
subwarps are introduced.

Reviewer-visible behavior

  • Portable and qualified cuda.coop.load() and cuda.coop.store() accept
    this_warp() with the same call shape, dtype inference, and lowercase
    selector strings.
  • direct, striped, vectorize, and transpose map to the corresponding
    CUB WarpLoad and WarpStore algorithms.
  • Each physical warp receives an x-major tile origin, so multiple warps in one
    block address consecutive independent tiles before the caller offset.
  • valid_items is relative to one Warp tile. Partial Load preserves invalid
    payload slots unless oob_default is supplied.
  • direct, striped, and vectorize remain allocation- and barrier-free.
  • transpose uses one compiler-owned storage slice per physical warp and an
    exact-scope syncwarp.
  • Incomplete physical warps, logical group_by() warps, non-string or unknown
    selectors, block-only selectors, and explicit Warp TempStorage fail before
    provider materialization.

Validation

  • The exact head passed 889 source-tree tests with the GPU hidden.
  • The exact final-stack wheel at 9b299e894f passed 607 contract, packaging,
    public-surface, and activation tests outside the source tree.
  • That wheel passed 50 real NVRTC LTO/nvJitLink compile tests and all 366
    runtime tests on an RTX PRO 6000.
  • Changed-file pre-commit and git diff --check passed.

Stack and scope

This draft is stacked on #11203. Logical-Warp Load/Store and runtime
ThreadGroup query or synchronization methods remain out of scope. CUDA
12/13 L4 and Windows CI remain external readiness gates.

@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-group-storage-scopes branch from 59b7629 to 47c148d Compare September 4, 2026 16:52
@tpn
tpn force-pushed the codex/cuda-coop-numba-warp-load-store branch from 53edeb5 to 0398389 Compare September 4, 2026 17:24
@tpn
tpn force-pushed the codex/cuda-coop-numba-group-storage-scopes branch from 47c148d to 53a60ea Compare September 4, 2026 17:56
tpn added 4 commits September 4, 2026 10:57
Extend portable contracts and the Numba-CUDA-MLIR provider path.

Lower complete 32-lane warps through every CUB Warp algorithm.

Plan per-warp origins, storage, and synchronization.

Keep logical and incomplete warps unsupported.

Signed-off-by: Trent Nelson <trent@trent.me>
Exercise portable and qualified paths across every CUB Warp layout.

Cover all numeric dtypes, partial tails, and three-dimensional blocks.

Isolate divergent warps and invalid controls, and verify scalar typing.

Signed-off-by: Trent Nelson <trent@trent.me>
Explain exact participation, per-warp origins, and valid counts.

Describe layouts for portable and qualified calls.

Document transpose storage and warp-scoped synchronization.

Signed-off-by: Trent Nelson <trent@trent.me>
Keep the qualified Load and Store surface aligned with the portable API
while retaining the backend physical-warp overloads and memory helpers.

Remove backend-only algorithm enums so both spellings accept the same
string selectors and reject non-string values before materialization.

Export shared payload and storage protocols from the qualified module
and keep their typing contracts structurally compatible.

Signed-off-by: Trent Nelson <trent@trent.me>
@tpn
tpn force-pushed the codex/cuda-coop-numba-warp-load-store branch from 0398389 to 53bf279 Compare September 4, 2026 18:02
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