Skip to content

Speed up SH backward camera-gradient reduction - #751

Merged
matthewdcong merged 4 commits into
openvdb:mainfrom
matthewdcong:improve_sh_bwd_reduce
Aug 24, 2026
Merged

Speed up SH backward camera-gradient reduction#751
matthewdcong merged 4 commits into
openvdb:mainfrom
matthewdcong:improve_sh_bwd_reduce

Conversation

@matthewdcong

Copy link
Copy Markdown
Contributor

Instead of allocating a full view-direction gradient intermediate in unified memory, we instead allocate more compact device-local per-block sums. The per-block sums are written to after a block reduce in the SH kernel followed by a CUB DeviceSegmentedReduce. On dual RTX 3090s:

Gaussians Cameras Before full op After full op Speedup
1M 1 1.671 ms 0.948 ms 43.3%
1M 4 4.374 ms 3.347 ms 23.5%
10M 1 12.774 ms 5.799 ms 54.6%
10M 4 22.928 ms 15.813 ms 31.0%
100M 1 135.826 ms 57.659 ms 57.5%
100M 4 260.342 ms 156.974 ms 39.7%

Launch the spherical harmonics backward kernel with one grid row per camera and simplify the resulting indexing. Performance was verified to be unchanged.

Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong requested a review from a team as a code owner August 22, 2026 03:47
Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong force-pushed the improve_sh_bwd_reduce branch from f83a90b to 1c87f56 Compare August 22, 2026 04:00
Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong force-pushed the improve_sh_bwd_reduce branch from 2f578ad to c4849d9 Compare August 23, 2026 20:38
@swahtz swahtz added the Gaussian Splatting Issues related to Gaussian splattng in the core library label Aug 24, 2026
@swahtz swahtz added this to the v0.6 milestone Aug 24, 2026

@swahtz swahtz 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.

Overall looks good to me, just a few minor checks/fixes.

Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu
Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu
Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu Outdated
Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu Outdated
Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu Outdated
Comment thread src/fvdb/detail/ops/gsplat/EvaluateSphericalHarmonicsBackward.cu Outdated

@swahtz swahtz 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.

Let's go! 🚀

Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong force-pushed the improve_sh_bwd_reduce branch from 3b9c00d to bb087ca Compare August 24, 2026 05:34
@matthewdcong
matthewdcong enabled auto-merge (squash) August 24, 2026 05:34
@matthewdcong
matthewdcong merged commit 48b0828 into openvdb:main Aug 24, 2026
40 checks passed
@matthewdcong
matthewdcong deleted the improve_sh_bwd_reduce branch August 24, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gaussian Splatting Issues related to Gaussian splattng in the core library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants