Skip to content

Avoid mixing allocators in mGPU fused losses - #840

Merged
matthewdcong merged 2 commits into
openvdb:mainfrom
matthewdcong:fix_allocator_mixup
Oct 30, 2026
Merged

matthewdcong merged 2 commits into
openvdb:mainfrom
matthewdcong:fix_allocator_mixup

Conversation

@matthewdcong

@matthewdcong matthewdcong commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Fused L1 and L1 + SSIM currently allocate CUDA tensors for scratch in the mGPU path. The CUDACachingAllocator retains unused blocks, causing GPU memory contention with the kPrivateUse1 unified-memory pool. This PR switches mGPU scratch to cudaMallocAsync with stream-ordered cleanup while retaining torch::empty for kCUDA. Allocation and reduction now live in the backend entry points, and the shared tile helpers take caller-owned buffers.

This also removes the prematurely added mGPU test variants from #820. mGPU tests do not yet exist elsewhere and will be added in the future. CUDA test coverage is kept.

Avoid mixing the CUDA caching allocator with the PrivateUse1 allocator for
temporary fused loss buffers. Use cudaMallocAsync and stream-ordered cleanup
on mGPU, while keeping CUDA scratch in torch::empty tensors.

Move allocation and reduction into the backend entry points and pass
caller-owned buffers to the shared tile helpers.

Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong requested a review from a team as a code owner October 29, 2026 14:41
Comment thread src/fvdb/detail/ops/gsplat/FusedL1.cu Resolved
Comment thread src/fvdb/detail/ops/gsplat/FusedL1.cu Resolved

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

Looks good to me. Two cleanup comments, feel free to address if you think they're useful, otherwise I don't see any issues

Signed-off-by: Matthew Cong <mcong@nvidia.com>
@matthewdcong
matthewdcong enabled auto-merge (squash) October 30, 2026 16:02
@matthewdcong
matthewdcong merged commit 0df2ce1 into openvdb:main Oct 30, 2026
44 checks passed
@matthewdcong
matthewdcong deleted the fix_allocator_mixup branch October 30, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants