[NV] Allow ext dist coeffs tensors to live on CPU#943
Open
frtrudel wants to merge 1 commit into
Open
Conversation
frtrudel
marked this pull request as draft
May 5, 2026 16:22
frtrudel
marked this pull request as ready for review
May 28, 2026 18:05
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.
!! KEEPING AS DRAFT UNTIL PREREQUISITES CHANGES ARE MERGED !!
Allows external distortion coefficients tensors to live on the CPU and avoid potential CPU-GPU sync(s).
Verdict: The fix correctly removes the targeted DtoH copies (~1 per step per type), but the performance impact is negligible. The removed copies were too small (~2-3 us each) to cause meaningful synchronization stalls.
What the Fix Changed
The fix removes two small DtoH Device→Pageable copies per training step by creating the ext dist coefficient tensor on the CPU/host side instead of on GPU:
Total DtoH Device→Pageable: 5,605 → 3,409 (-2,196 copies, -11 ms GPU time).
The remaining 28 and 4 copies at those sizes are one-time operations (not per-step). The removed copies were 24-byte and 60-byte DtoH transfers at ~2-3 us each. At that size, they complete in a single PCIe transaction and don't create a pipeline stall.
Full Memory Transfer Comparison
Synchronization Comparison
The fix has 2,928 fewer sync calls but each is slightly longer on average.
NVTX Training Step Comparison
All within run-to-run noise (1-2%).
Top Kernel Comparison
All kernel times are within noise.