Skip to content

Add CUTLASS compiler integration and direct block Load/Store - #11526

Draft
tpn wants to merge 5 commits into
codex/coop-launch-bounds-20260914from
codex/cuda-coop-cutlass-00-compiler
Draft

tpn wants to merge 5 commits into
codex/coop-launch-bounds-20260914from
codex/cuda-coop-cutlass-00-compiler

Conversation

@tpn

@tpn tpn commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Prerequisite: #11392.

This adds a CUTLASS/CuTe DSL backend so kernels can call the common
cuda.coop API or its qualified cuda.coop.cutlass counterpart. The first
operations are direct block Load and Store. Load fills an existing
ThreadData payload and returns None; partial loads preserve initialized
invalid items unless a default is supplied. Direct operations use no shared
scratch.

A separate preparatory commit gives inherited Numba examples and consumers
the numba_coop alias. CUTLASS examples use cutlass_coop or coop; this
keeps the naming consistent from the first layer without rewriting #11392.

The compiler bridge collects typed CUB provider requests into one NVRTC
LTO-IR bundle per trace and attaches it during scoped finalization. It uses
compiler-provided exact launch dimensions, retains artifacts through linking,
and isolates nested traces and failed compilations. Shared dispatcher changes
let CUTLASS identify its active compiler environment while preserving explicit
compiler scope precedence.

The base cuda-coop wheel remains dependency-free, and importing only the
common API stays host-only. coop.register("cutlass") supports explicit
activation in either import order. The qualified namespace includes typed
payloads and CuTe register conversions; an executable example shows common
and qualified calls.

The compiler must support external NVIDIA LTO-IR linking, exact launch facts,
and scoped finalization. An official public artifact has not yet passed the
consumer tests, so this PR adds no CUTLASS installation extra or minimum
version claim.

Validation

The included tests cover dispatch and activation rollback, repeated and
nested compilation, compile/link failure recovery, payload control flow,
partial multidimensional tiles, and provider-call elimination in the final
cubin. Fresh-wheel consumers check module origins, strict typing, and both
backend import orders. These passed in the prior 12-layer tip's Linux / CUDA
13.3 / SM 120 regression with a compatible development compiler. That
run covered the prior cumulative tip; intermediate PR heads have not been separately
rerun.

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 1 of 16 above #11392. Previous: #11392 · Next: #11527.
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.

tpn added 5 commits September 20, 2026 21:27
Name the Numba integration numba_coop in examples, generated test
kernels, and typing consumers. Keep common coop imports distinct.

Signed-off-by: Trent Nelson <trent@trent.me>
Signed-off-by: Trent Nelson <trent@trent.me>
Connect common cooperative calls to compiler-owned CuTe traces.
Collect typed providers into an NVRTC LTO-IR bundle and finalize links
with isolated trace state and validated artifact caching.

Provide in-place block Load/Store, per-thread payload conversions,
optional activation, typing, installed-wheel coverage, and examples.

Signed-off-by: Trent Nelson <trent@trent.me>
Recognize an imported CUTLASS runtime as an optional backend.
Keep compiler activation lazy for host-only common API imports.

Signed-off-by: Trent Nelson <trent@trent.me>
Accept cutlass alongside the existing Numba aliases while preserving
backend initialization errors and host-only root imports. Document the
optional consumer prerequisites and cover retry and compiler
coexistence.

Signed-off-by: Trent Nelson <trent@trent.me>
@tpn
tpn force-pushed the codex/cuda-coop-cutlass-00-compiler branch from a4aaed4 to 7b552b7 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