Edge-parallel segment sum support for GNN - #173
Open
nathan-az wants to merge 6 commits into
Open
Conversation
nathan-az
requested review from
benrhodes26,
jg8610,
reactiv and
vsimkus
as code owners
August 9, 2026 14:15
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.
Motivation:
The most memory-expensive part of the GNN is the edge-wise operations. When using sigmoid gates (as with orbmol v2), if sharding over the edge dim, many operations can be completed independently with only two relatively cheap collectives required after the segment sums.
This basic PoC is designed to be non-obtrusive and easily testable. It:
I recommend only enabling one of these at a time. Chunking if you want data-parallel inference on large systems, parallelism (probably intra-node) for multi-GPU. Effectiveness of each will depend on hardware.
Distributed edge-wise operations
Since these collectives are relatively small and the edge operations are the most runtime expensive, I expect near embarrassingly parallel runtime benefits to the GNN as well, but unfortunately I don't have a multi-GPU setup to test this. All testing was done locally on CPU with gloo backend.
Chunked edge-wise operations
This incurs additional recompute in the backward step in conservative force inference but trades massively reduced memory usage by checkpointing around each chunk.
Further work required:
This is not complete as-is. From my testing this requires gradient scaling according to the mesh size (imagine it works similarly to DP) which is an inference-time concern with the conservative force estimates. For a mature implementation this needs:
Notes: