Skip to content

ProjectedGaussianSplats opacities uses expand/view and accessors instead of per-camera copies#451

Merged
swahtz merged 6 commits into
openvdb:mainfrom
swahtz:js/gaussian_opacities_view
Feb 10, 2026
Merged

ProjectedGaussianSplats opacities uses expand/view and accessors instead of per-camera copies#451
swahtz merged 6 commits into
openvdb:mainfrom
swahtz:js/gaussian_opacities_view

Conversation

@swahtz

@swahtz swahtz commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Addresses a FIXME of using a view for projected gaussian opacities (when not using antialiasing). Accessors were already being used in the kernels so this was just a matter of updating the ProjectedGaussianSplats.opacities() method and using this access method whenever perGaussianOpacities was used. This reduces the redundant per-camera copies of opacities being made when antialiasing is not enabled.

Because of this view that is created for projected gaussian opacities to make them per-camera quantities, I changed the way the number of bytes we prefetch is calculated when we call memPrefetchAsync before forward/backward rasterization. These calculations are now robust to this change for all the tensors so we get the correct number of bytes if the tensor is a non-contiguous expanded view or if it's a sliced tensor with a non-zero storage offset (i.e. t[4:])

…not using antialiasing)

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
@swahtz swahtz requested a review from a team as a code owner February 9, 2026 04:35
@swahtz swahtz added the Gaussian Splatting Issues related to Gaussian splattng in the core library label Feb 9, 2026
@swahtz swahtz requested review from Copilot, matthewdcong and sifakis and removed request for matthewdcong and sifakis February 9, 2026 04:35

Copilot AI 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.

Pull request overview

This PR aims to reduce redundant per-camera opacity tensor copies for ProjectedGaussianSplats when antialiasing is disabled by storing opacities as [N] and lazily expanding to [C, N] via an accessor.

Changes:

  • Updated ProjectedGaussianSplats::opacities() to expand [N] -> [C, N] via unsqueeze().expand().
  • Changed projection codepaths to store opacities as [N] when antialias == false, and updated rasterization call sites to use the opacities() accessor instead of the raw member tensor.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
src/fvdb/GaussianSplat3d.h Adds an opacities() accessor that expands [N] opacities to a [C, N] view.
src/fvdb/GaussianSplat3d.cpp Stores opacities as [N] in non-antialias projection results and switches rasterization call sites to use the accessor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/GaussianSplat3d.h
Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/GaussianSplat3d.cpp
…ward/Backward to calculate the data size of the expanded view tensors

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
…es()

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.cu Outdated
Comment thread src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.cu Outdated
Comment thread src/fvdb/GaussianSplat3d.h
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.cu Outdated
Comment thread src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.cu Outdated
Comment thread src/fvdb/GaussianSplat3d.h
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

A question and a comment.

Comment thread src/fvdb/GaussianSplat3d.cpp
Comment thread src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.cu

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

Thanks for correcting my confusion and adding explanation.

@swahtz swahtz merged commit fc1954c into openvdb:main Feb 10, 2026
38 checks passed
@swahtz swahtz deleted the js/gaussian_opacities_view branch February 10, 2026 01:22
matthewdcong added a commit that referenced this pull request Apr 13, 2026
…ing implementations (#600)

Currently, we unsqueeze and expand the opacities (following the
optimization in #451) creating a non-contiguous view. However, the image
space mGPU rasterization and world space rasterization implementations
require contiguous expanded opacities. This PR changes opacities to
always be expanded for consistent behavior across multiple splatting
implementations. Note that we can't simply call `contiguous()` in the
specific operator impl because the shared autograd code caches the
opacities for the backwards pass.

This undoes the optimization in #451 and results in a small (~0.5%)
decrease in performance in the single GPU case. However, this is
outweighed by the corresponding speedups in the mGPU and world space
case due to one fewer allocation and more efficient paging.

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
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

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants