Skip to content

Add CUTLASS built-in block and warp Scan - #11531

Draft
tpn wants to merge 1 commit into
codex/cuda-coop-cutlass-04-groups-reducefrom
codex/cuda-coop-cutlass-05-scan
Draft

tpn wants to merge 1 commit into
codex/cuda-coop-cutlass-04-groups-reducefrom
codex/cuda-coop-cutlass-05-scan

Conversation

@tpn

@tpn tpn commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Prerequisite: #11530.

CuTe kernels can compute inclusive and exclusive Scan and Sum with built-in
operators. Blocks accept scalars or fixed per-thread payloads; physical and
logical warps accept scalar values. The five entry points preserve inputs and
return a scalar or fresh ThreadData, so their results can feed later
cooperative operations.

The qualified API adds valid warp prefixes and one-item aggregate outputs.
The aggregate excludes the exclusive initial value and is available to each
participating lane. Exclusive operators validate initial values against the
input dtype. Block calls support algorithm selection and implicit or explicit
scratch; warp scratch and reuse synchronization remain scoped to each group.
Custom operators and stateful Scan prefix callbacks remain unsupported.

Qualified signatures, executable examples, and contract documentation
accompany the implementation.

Validation

Tests cover supported dtypes and built-in operators, three block algorithms,
logical warp widths, initial values, prefix aggregates, invalid runtime counts,
and payload preservation. Mixed Load/Scan/Store loops exercise shared and
exclusive scratch reuse, with focused race checks and provider-call
elimination checks in final cubins.

These tests passed in the prior 12-layer tip's local regression on Linux with
CUDA 13.3 and SM 120, using a compatible development compiler. That
run covered the prior cumulative tip; intermediate PR heads have not been separately
rerun. Official public CUTLASS artifacts remain unqualified.

Final integrated regression: Passed: 879 shared-contract checks, 1,415 Numba host/compiler checks, 798 Numba GPU checks, seven standalone Numba commands, 1,757 CUTLASS host/compiler checks, and 2,136 CUTLASS GPU/compiler-lifecycle checks. Both GPU suites ran with race checking enabled; there were no failures or skips.
Final installed-wheel qualification: Fresh-wheel checks passed: all 252 Python sources/stubs match the final source, 40 packaging/typing tests passed, and base-only imports plus four mixed-backend activation cases passed. Installed GPU consumers passed 20 common/qualified example runs, four storage variants, runtime-first and disabled-auto-registration modes, and three executable guide tests.
Final documentation qualification: Full Sphinx rendered with only three existing libcu++ warnings; focused cooperative pages build without warnings. API signatures, 39 source excerpts, downloads, anchors, and local links pass. Local and live browser checks passed for 32 CUTLASS objects and all 14 explorers. The published docs match the tested source; 396 served resources match build hashes and the separate Numba docs remain unchanged.

Stack

Part 6 of 16 above #11392. Previous: #11530 · Next: #11532.
Complete stack and current common API coverage: #11541.

@copy-pr-bot

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

Support inclusive and exclusive scans and sums through the shared
planner, including typed initial values and qualified prefix aggregates.
Defer block scratch allocation with exact layout probes and retain
independent warp storage and scoped reuse synchronization.

Signed-off-by: Trent Nelson <trent@trent.me>
@tpn
tpn force-pushed the codex/cuda-coop-cutlass-05-scan branch from a210e0f to 41dfd29 Compare September 21, 2026 04:31
@tpn
tpn force-pushed the codex/cuda-coop-cutlass-04-groups-reduce branch from b034a29 to 1500e1e Compare September 21, 2026 04:31
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