Skip to content

Add bfloat16 support to JaggedTensor reduce operators#501

Merged
swahtz merged 1 commit into
openvdb:mainfrom
swahtz:jagged_reduce_bfloat16_support
Mar 5, 2026
Merged

Add bfloat16 support to JaggedTensor reduce operators#501
swahtz merged 1 commit into
openvdb:mainfrom
swahtz:jagged_reduce_bfloat16_support

Conversation

@swahtz

@swahtz swahtz commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Add bfloat16 support to JaggedTensor reduce operators: add c10::kBFloat16 to the AT_DISPATCH_V2 type list in JaggedReduce.cu, enabling jsum/jmin/jmax to accept bfloat16 tensors. JaggedSort already supported bfloat16; JaggedReduce was the only jagged kernel missing it.

Expand test_jagged_tensor.py to cover bfloat16 on both CUDA and CPU, with appropriately wider tolerances and smaller dataset sizes to account for bfloat16's 7-bit mantissa. Skip tests that depend on grid-building ops (GridBatch.from_points) which do not yet support bfloat16.

fixes #395

Add c10::kBFloat16 to the AT_DISPATCH_V2 type list in JaggedReduce.cu,
enabling jsum/jmin/jmax to accept bfloat16 tensors. JaggedSort already
supported bfloat16; JaggedReduce was the only jagged kernel missing it.

Expand test_jagged_tensor.py to cover bfloat16 on both CUDA and CPU,
with appropriately wider tolerances and smaller dataset sizes to account
for bfloat16's 7-bit mantissa. Skip tests that depend on grid-building
ops (GridBatch.from_points) which do not yet support bfloat16.

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
@swahtz swahtz self-assigned this Mar 5, 2026
@swahtz swahtz requested a review from a team as a code owner March 5, 2026 00:07
@swahtz swahtz added the core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module label Mar 5, 2026
@swahtz swahtz requested review from areidmeyer and phapalova March 5, 2026 00:07

@harrism harrism left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that was easy. :)

@swahtz swahtz enabled auto-merge (squash) March 5, 2026 00:28
@swahtz swahtz added this to the v0.4 milestone Mar 5, 2026
@swahtz swahtz merged commit e90252e into openvdb:main Mar 5, 2026
35 checks passed
@swahtz swahtz deleted the jagged_reduce_bfloat16_support branch March 5, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support bfloat16 JaggedReduce, etc.

2 participants