Skip to content

cuda.coop: add logical Warp Load and Store - #11207

Draft
tpn wants to merge 5 commits into
codex/cuda-coop-numba-warp-load-storefrom
codex/cuda-coop-numba-logical-warp-load-store
Draft

cuda.coop: add logical Warp Load and Store#11207
tpn wants to merge 5 commits into
codex/cuda-coop-numba-warp-load-storefrom
codex/cuda-coop-numba-logical-warp-load-store

Conversation

@tpn

@tpn tpn commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why this is needed

The preceding stack establishes complete Block and physical-Warp Load/Store
plus topology-aware storage and synchronization. This PR proves that those
same contracts support logical subwarps without changing generic dispatch,
caching, or rewrite orchestration.

Reviewer-visible behavior

  • Portable and qualified cuda.coop.load() and cuda.coop.store() accept
    this_warp().group_by(width) with the same call shape, dtype inference, and
    lowercase selector strings.
  • Supported logical widths are 1, 2, 4, 8, 16, and 32 lanes. The enclosing
    block must contain complete physical warps.
  • direct, striped, vectorize, and transpose map to the corresponding
    CUB WarpLoad and WarpStore algorithms at the selected width.
  • Each logical group receives an x-major consecutive tile origin before the
    caller offset, and valid_items is relative to that logical tile.
  • Partial transpose loads without oob_default preserve invalid payload slots
    using the logical lane rank.
  • direct, striped, and vectorize remain allocation- and barrier-free.
  • transpose uses one compiler-owned storage slice per logical group and an
    exact-mask syncwarp, allowing sibling logical groups to diverge.
  • Invalid widths, incomplete physical warps, non-string or unknown selectors,
    unsupported selectors, and explicit Warp TempStorage fail before provider
    materialization.

Validation

  • The exact head passed 998 source-tree tests with the GPU hidden.
  • All 148 focused Warp runtime tests passed on an RTX PRO 6000, including all
    supported widths and algorithms, all ten numeric dtypes, logical tails,
    x-major 3-D blocks, divergent subwarps, and isolated invalid-runtime traps.
  • The exact final-stack wheel at 9b299e894f passed 607 contract, packaging,
    public-surface, and activation tests, 50 real NVRTC LTO/nvJitLink compile
    tests, and all 366 runtime tests on the same GPU.
  • Changed-file pre-commit and git diff --check passed.

Stack and scope

This draft is stacked on #11205. It supports logical groups formed with
this_warp().group_by(width); mappings such as warps_within_block 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.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Sep 4, 2026
@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-warp-load-store branch from 53edeb5 to 0398389 Compare September 4, 2026 17:24
@tpn
tpn force-pushed the codex/cuda-coop-numba-logical-warp-load-store branch from 16dbc79 to a1439f9 Compare September 4, 2026 17:24
@tpn
tpn force-pushed the codex/cuda-coop-numba-warp-load-store branch from 0398389 to 53bf279 Compare September 4, 2026 18:02
tpn added 5 commits September 4, 2026 11:02
Allow this_warp().group_by(width) to select every supported CUB Warp
Load and Store specialization.

Carry logical topology through provider selection, offset planning,
storage slicing, and masked synchronization without adding runtime
ThreadGroup APIs.

Signed-off-by: Trent Nelson <trent@trent.me>
Exercise portable and qualified logical-Warp calls across all supported
widths, algorithms, and scalar data types.

Cover per-group offsets and validity, divergent transpose calls, runtime
traps, real NVRTC compilation, cache identity, and strict typing.

Signed-off-by: Trent Nelson <trent@trent.me>
Describe supported logical widths, per-group indexing and validity, and
the storage and convergence contracts for Warp Load and Store.

Keep ThreadGroup descriptor-only and call out that explicit Warp
TempStorage remains unsupported.

Signed-off-by: Trent Nelson <trent@trent.me>
Exercise logical Warp Load and Store with runtime offsets loaded from an
array and varied independently across groups.

Document that runtime validity, default, and offset controls must remain
uniform within each participating group.

Signed-off-by: Trent Nelson <trent@trent.me>
Use the same lowercase string algorithm selectors for portable and
qualified logical-Warp Load and Store calls.

Retain negative coverage for non-string and unsupported selectors
without reintroducing backend enum artifacts.

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