Improve load balancing in DistributedPointsToGrid - #2276
Merged
kmuseth merged 3 commits intoAug 12, 2026
Merged
Conversation
kmuseth
approved these changes
Aug 10, 2026
kmuseth
left a comment
Contributor
There was a problem hiding this comment.
looks okay to me but it's a lot of code changes for merely an 8% performance improvement. Can you try to run this on a more recent GPU thanks a 3090? I wonder if you have two GPUs connected via PCI-e will change the picture?
matthewdcong
force-pushed
the
improve_mgpu_load_balancing
branch
from
August 11, 2026 15:28
bab4732 to
56e3451
Compare
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
matthewdcong
force-pushed
the
improve_mgpu_load_balancing
branch
from
August 11, 2026 19:23
56e3451 to
d0e7fa6
Compare
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.
The existing DistributedPointsToGrid implementation sorts on each local range independently, followed by a pairwise merge tree to obtain a globally sorted range. The existing merge-tree approach halves the number of devices utilized at each step, which leaves the remaining GPUs idle.
This PR improves throughput by involving all the GPUs during the pairwise merge. At a high-level, instead of being limited to one GPU writing the left half of the output (sub)array and another GPU writing to the right half of the output (sub)array, we further subdivide the output (sub)array across all available GPUs so that each GPU writes a section of the output (sub)array. Moreover, this allows us to generalize the pairwise merge to non power-of- two GPU counts.
With 65,536 points sampled on a torus on two RTX 3090s, this improves end-to-end construction time by 8%.