Fix quaternion gradient accumulation in GaussianProjectionJaggedBackward#534
Merged
Merged
Conversation
…JaggedBackward kernel Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
…ting - Introduced `TestProjectionGradsMultiCamera` to verify correct summation of Gaussian parameter gradients across multiple cameras during the projection backward pass. - Implemented tests for both dense and jagged paths, ensuring gradients are accurately computed and compared against independent single-camera renders. Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
matthewdcong
approved these changes
Mar 11, 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.
This pull request introduces a new unit test to verify that Gaussian parameter gradients are correctly accumulated across multiple cameras in the projection backward pass, addressing a potential issue with warp-level reductions. It also includes a minor fix in the GaussianProjectionJaggedBackward kernel to ensure proper gradient accumulation for quaternions. The changes are grouped below by theme.
Testing improvements:
TestProjectionGradsMultiCameratest class totests/unit/test_gaussian_splat_3d.py, which verifies that gradients for all Gaussian parameters are correctly summed across cameras in both dense and jagged projection backward passes. This test ensures that warp-level reductions (warpSum) do not drop camera contributions, preventing silent bugs when multiple cameras share a warp for the same Gaussian.CUDA kernel fix:
src/fvdb/detail/ops/gsplat/GaussianProjectionJaggedBackward.cuby adding awarpSumcall for quaternion gradients (dLossDQuat), ensuring all camera contributions are properly accumulated in the jagged projection backward kernel.