Repository navigation
docs(book): the warp chapter says the f32 redux.sync form does not exist - #1053
Merged
Merged
Conversation
`warp-level-programming.md` closes its `redux.sync` section with:
- **Integers only.** There is no `f32`/`f64` form before `sm_100`, so float
reductions keep the butterfly.
NVIDIA#1032 shipped that form. `cuda-device` now exports eight `f32` entry points
that the chapter mentions nowhere:
redux_sync_min_f32 redux_sync_max_f32
redux_sync_min_abs_f32 redux_sync_max_abs_f32
redux_sync_min_nan_f32 redux_sync_max_nan_f32
redux_sync_min_abs_nan_f32 redux_sync_max_abs_nan_f32
A reader following this page today writes the shuffle butterfly for an `f32`
min/max reduction that the hardware can do in one instruction, because the
book told them the instruction does not exist.
Add a subsection for the family and correct the bullet. `f64` still has no
`redux.sync` form, so that half of the claim stands and is kept.
Three things the new subsection is careful about:
- **It is not one function per operation.** The integer family is, and the
page says so. For `f32`, `.abs` and `.NaN` are independent instruction
modifiers, so each of the four combinations is its own entry point.
- **The `.NaN` distinction is stated in the catalog's own terms.** The plain
and `.abs` forms ignore NaN inputs; the `.NaN` forms propagate NaN when any
lane contributes one. That is the difference that decides which to call.
- **The floor is narrower than "sm_100+".** The catalog records PTX 8.6 with a
target union of `sm_100a|sm_100f|sm_103a|sm_103f`, so the intrinsic is not
selected on `sm_110a` or `sm_120a` -- consumer Blackwell included. Saying
"Blackwell" without that would send RTX-50 users down a path that cannot
lower.
No performance claim is made. The integer section's 4.74x is a measurement on
an A10G; the `f32` family needs a B200/GB200, `redux_f32` is in
`SM100_COMPILE_EXAMPLES` so CI checks its emitted PTX rather than running it,
and its `main` skips unless the device reports exactly `sm_100`. The
subsection says that instead of implying a number.
Verified: all eight names exist as `pub fn` in `crates/cuda-device/src/warp.rs`;
the arch union, PTX version and NaN/abs semantics come from
`intrinsics/catalog.json`, not from the merge description. Every one of the
eight is written module-qualified, so `check-book-api-names.sh` now covers all
of them -- it checks 39 qualified names where it checked 35, and renaming one
to `redux_sync_max_abs_nan_f64` makes it fail. Book builds clean under
`sphinx-build -W`.
Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
nihalpasham
approved these changes
Aug 20, 2026
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.
warp-level-programming.mdcloses itsredux.syncsection with:#1032 shipped that form.
cuda-devicenow exports eightf32entry points the chapter mentions nowhere:A reader following this page today writes the shuffle butterfly for an
f32min/max reduction the hardware does in one instruction, because the book told them the instruction does not exist.f64still has no form, so that half of the claim stands and is kept.Three things the new subsection is careful about
It is not one function per operation. The integer family is, and the page says so. For
f32,.absand.NaNare independent instruction modifiers, so each of the four combinations is its own entry point.The
.NaNdistinction is stated in the catalog's own terms. The plain and.absforms ignore NaN inputs; the.NaNforms propagate NaN when any lane contributes one. That is the difference that decides which to call, and it comes from the catalog summaries rather than from my own gloss on IEEE semantics.The floor is narrower than "sm_100+". The catalog records PTX 8.6 with a target union of
sm_100a|sm_100f|sm_103a|sm_103f, so the intrinsic is not selected onsm_110aorsm_120a— consumer Blackwell included. Saying just "Blackwell" would send RTX-50 users down a path that cannot lower.No performance claim
The integer section's 4.74x is a measurement on an A10G. The f32 family needs a B200/GB200,
redux_f32sits inSM100_COMPILE_EXAMPLESso CI checks its emitted PTX rather than running it, and itsmainskips unless the device reports exactlysm_100. The subsection says that instead of implying a number.Verification
pub fnincrates/cuda-device/src/warp.rs.intrinsics/catalog.json.check-book-api-names.shnow covers all of them: it checks 39 qualified names where it checked 35, and renaming one toredux_sync_max_abs_nan_f64makes it fail.sphinx-build -W.