Optimize joffsets construction via pinned memory#403
Merged
Conversation
Signed-off-by: Matthew Cong <mcong@nvidia.com>
1a68226 to
f717775
Compare
Contributor
Author
|
With Unified Memory, the training runs about 1.06x faster. The benefits for the PyTorch CUDA backend are more marginal because host to device transfers call |
swahtz
approved these changes
Jan 7, 2026
swahtz
left a comment
Contributor
There was a problem hiding this comment.
Nice, good catch. I wonder if there are other situations with similar small CPU tensors that need to be created and then moved that we could apply this to.
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.
During Gaussian splat training, we construct several JaggedTensor instances where the small joffsets tensor is initialized on the host and then copied over to the device. Page-locking these small tensors on the host enables them to be read at a higher bandwidth by the device which accelerates the subsequent host to device transfer. Furthermore, with the Unified Memory backend, this reduces the amount of host <-> device synchronization required enabling the the subsequent small kernels to be launched with lower latency.
NB: The
torch::tensor(...)call with the initialization list performs the initialization on the host before copying the contents to the device.