Repository navigation
feat(cutile-rs): add per-operation atomic aggregation - #1558
Open
robertream wants to merge 1 commit into
Open
robertream wants to merge 1 commit into
robertream wants to merge 1 commit into
Conversation
robertream
force-pushed
the
feat/aggregation-per-operation
branch
3 times, most recently
from
October 20, 2026 05:22
ee609da to
4b79c27
Compare
robertream
marked this pull request as ready for review
October 20, 2026 05:34
robertream
force-pushed
the
feat/aggregation-per-operation
branch
5 times, most recently
from
October 21, 2026 02:49
02f84e7 to
087e532
Compare
robertream
requested review from
binarybana,
cryos,
kkraus14,
nihalpasham,
roivanov and
rparolin
as code owners
October 21, 2026 02:49
Adds typed atomic aggregation capabilities with compile-time operation and element validation, launch-time alias checks, and compile-only and GPU test coverage. Depends on NVIDIA#1557 (fix/cutile-compiler: preserve unsigned integer literal ranges). Storage identity is opaque: `Tensor::storage_id`, the stored-binding traits, and `validate_binding_aliases` carry a `StorageId` (equality is its whole public surface) rather than a bare `usize` address. Library kernels built on these capabilities live in `cutile-kernels`, generic over the element wherever the added value comes from an input (`scatter_add`, `embedding_backward_scatter_add`, `segment_sum`, `weighted_histogram` over `AtomicAdd`; `max_reduce` over `AtomicOrd` with the element selecting signed vs unsigned for both the intra-tile reduction and the atomic; `bitmask_or` over `AtomicBitwise`). Compile-only tests drive each kernel across its whole element set asserting the emitted mode per pair, host references cover the edge cases, and device tests compare against them. GPU correctness of the unsigned-comparison and bf16/64-bit-constant cells depends on the literal-encoding fixes (PR NVIDIA#1557); the combined tree passed 20/20 required tests on an H100 (sm_90). `ElementType` gains a `ONE` constant, so every kernel is generic over its element, `histogram` included (its increment is `E::ONE` materialized on-device). Signed-off-by: Robert Ream <154010+robertream@users.noreply.github.com>
robertream
force-pushed
the
feat/aggregation-per-operation
branch
from
October 21, 2026 02:59
087e532 to
6fdc67e
Compare
This branch has not been deployed
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.
Adds typed per-operation atomic aggregation capabilities to cuTile: AddTensor, AndTensor, OrTensor, XorTensor, MaxTensor, and MinTensor.
Each capability exposes only its matching reduction, validates supported element types, enforces tiling and index bounds, rejects invalid aliases, and includes compile-only and GPU test coverage.
The implementation is compile-verified against cutile_ir::Module. All nine GPU tests passed against the aggregation implementation included in this PR.
Depends on PR #1557, which preserves full-width integer literal encodings required by unsigned max/min tests.
I used an AI assistant (Claude) to write and check this change. I reviewed the diff and validated it.