cuda.coop: add Numba Scan prefix callbacks - #11217
Draft
tpn wants to merge 9 commits into
Draft
Conversation
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
force-pushed
the
codex/cuda-coop-numba-base-scan
branch
2 times, most recently
from
September 4, 2026 18:47
1eef1a3 to
8a594e5
Compare
Represent stateless and stateful prefix callbacks in normalized Scan semantics and place their parameters in CUB overload order. Reject invalid prefix combinations and unsupported scopes before a backend materializes a provider. Signed-off-by: Trent Nelson <trent@trent.me>
Expose an immutable qualified descriptor for device callables and state dtypes. Lower the generic core contract to a target-aware pointer ABI with callable-based semantic identity and stable cache keys. Signed-off-by: Trent Nelson <trent@trent.me>
Expose Block-only prefix callbacks through the qualified Scan API. Canonicalize the compatibility spelling, validate explicit per-thread state before inference, and preserve runtime operands through provider lowering. Cover every spelling, algorithm, storage mode, and the two-phase compiler path. Signed-off-by: Trent Nelson <trent@trent.me>
Correlate callback arguments and results with scalar and per-thread array payloads. Carry state and value types through StatefulFunction while retaining functor-class support through its bound call shape. Allow explicit None forwarding for every qualified runtime parameter. Reject nonnumeric, wrong-arity, and mismatched callback forms during strict consumer checks. Signed-off-by: Trent Nelson <trent@trent.me>
Require the qualified StatefulFunction implementation and declaration in the cuda-coop wheel while preserving the deferred-module exclusions. Exercise lazy import, callable identity, runtime signatures, and package origins from an isolated installed-wheel process. Signed-off-by: Trent Nelson <trent@trent.me>
Describe qualified Block Scan callback spellings, state lifetime, and thread-zero authority. Explain callable exclusions and the interaction between persistent prefix state, temporary storage, and reuse barriers. Signed-off-by: Trent Nelson <trent@trent.me>
Keep callback coverage aligned with portable Scan by spelling shared algorithm controls as lowercase strings. Remove stale enum claims from API documentation so qualified extensions do not imply alternate selector types. Signed-off-by: Trent Nelson <trent@trent.me>
Make prefix_op the only qualified Scan keyword for stateless and stateful prefix callbacks. Remove duplicate overloads and legacy planner canonicalization while preserving the callback provider paths. Keep signature, wheel, typing, compiler, and runtime coverage focused on the canonical spelling, with a negative regression for the removed keyword. Signed-off-by: Trent Nelson <trent@trent.me>
Keep the qualified export list in portable order. Append backend-only names as one coherent extension block. Assert that every shared Scan parameter retains its portable contract. Account explicitly for the positional state and keyword callback extensions. Signed-off-by: Trent Nelson <trent@trent.me>
tpn
force-pushed
the
codex/cuda-coop-numba-scan-prefix-callbacks
branch
from
September 4, 2026 19:00
d28b8cc to
9b299e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this is needed
The base Scan PR deliberately leaves prefix callbacks out so its operator,
result, and storage contracts can be reviewed independently. This follow-up
adds qualified Block Scan prefix callbacks through the same registered family
and generic operator interfaces without changing activation, root dispatch,
caching, or rewrite orchestration.
Prefix callbacks are a compiler-specific extension. The portable API and its
import surface remain unchanged.
Reviewer-visible behavior
ExclusiveScan, InclusiveSum, and ExclusiveSum.
prefix_opkeyword. The removedblock_prefix_callback_opcompatibility alias is rejected.StatefulFunctiondescriptorswith explicit numeric, one-item-per-thread state.
matching.
after the call. Callers initialize every participating state cell equally.
manual reuse synchronization.
Warp groups, nonnumeric state, or stateful scan operators before provider
compilation.
callback parameters are additive qualified extensions.
Validation
At exact head
9b299e894feeaeeb98867009f72cb244b3822b5f:packaging, public-surface, and activation tests.
git diff --checkpassed.Stack and scope
This draft is stacked on #11212. Portable callbacks, Warp callbacks, stateful
binary scan operators, structured state, and grid workspace policy remain
deferred.
The inherited private compatibility shim remains limited to the supported
Numba-CUDA-MLIR 0.5.x contract. CUDA 12/13 L4 and Windows CI remain external
readiness gates.