Repository navigation
Conversation
The sparse screen-space rasterizer saved the pixel selection's jdata, joffsets and jlidx and rebuilt the JaggedTensor in backward with JaggedTensor.from_data_offsets_and_list_ids. fvdb-core's checked constructors validate their structure (openvdb/fvdb-core#722), which costs a device-to-host sync, so the rebuild would add one sync to every sparse backward step. The JaggedTensor is already valid, so hold it on ctx and reuse it. Integer pixel coordinates need no gradient and are not modified in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
swahtz
requested review from
blackencino and
matthewdcong
and removed request for
a team
October 8, 2026 21:40
6 of 8 tasks
This branch has not been deployed
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.
Summary
_RasterizeScreenSpaceGaussiansSparseFnsaved the pixel selection'sjdata,joffsetsandjlidx, then rebuilt theJaggedTensorin backward withJaggedTensor.from_data_offsets_and_list_ids. This PR keeps the originalJaggedTensoronctxand reuses it in backward.Why
openvdb/fvdb-core#812 (fixing openvdb/fvdb-core#722) makes fvdb-core's checked
JaggedTensorconstructors validate their structure. Validation reads the structure tensors on the host, so after that PR the rebuild would add one device-to-host sync to every sparse backward step.Measured on an RTX PRO 6000, the checked ldim-1 constructor costs about 16–19 µs per call with an idle GPU, against 4–8 µs on current main. Its sync also stops the host from running ahead of queued GPU work.
The pixel
JaggedTensorfrom forward is already valid, so backward doesn't need to rebuild it.This change is preventive. With current fvdb-core the ldim-1 rebuild does not sync, so today it saves only a small jidx kernel and binding overhead. It only affects sparse rendering; dense training never goes through this path.
Notes
ctxis safe. A tensor held as actxattribute skips saved-tensor hooks and the in-place modification check. Pixel coordinates are integer, need no gradient, and are not modified in place, so neither check matters here.Test plan
upstream/mainwith the same seed, on the sparse scene fromtest_sparse_matches_oo_and_backward_runs:means,quatsandlog_scales, which is atomicAdd ordering noise.logit_opacities,sh0andshN.black --check --target-version=py311 --line-length=120passes.🤖 Generated with Claude Code