Geotransolver flare domain parallel - #1902
Open
coreyjadams wants to merge 5 commits into
Open
Conversation
Contributor
CODEOWNERS review mapCurrent for commit ⏳ @coreyjadams — 13 file(s)
⏳ @loliverhennigh — 1 file(s)
No CODEOWNER
Comment |
coreyjadams
marked this pull request as ready for review
August 10, 2026 15:07
Contributor
Greptile SummaryThis PR adds model-level domain parallelism for FLARE and GeoTransolver, including mixed-placement attention, a shard-aware linear path, plain-tensor promotion for registered handlers, and reusable gradient-boundary operations.
Important Files Changed
Reviews (1): Last reviewed commit: "Update Changelog" | Re-trigger Greptile |
Collaborator
Author
|
/ok to test cd2316b |
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.
PhysicsNeMo Pull Request
This PR adds support for FLARE and GeoTransolver domain parallelism at the model level. It does not include datapipe support or recipe support yet. Those will come in follow ups.
The models are coming together because FLARE attention is a backend for GeoTransolver; to support GeoT we have to have FLARE anyways so it's cleanest to bring them both together.
There is one tweak to
shard_tensor.pyincorporated into the PR that needs to be addressed, that really only rears its head in FLARE: when using a wrapper in shard tensor, where we have atorch.Tensorentering the wrapper, it is currently possible for a plain tensor to enter that wrapper. FLARE has this as a parameter that enters the attention mechanism, which is unusual compared to all the other models we see.To address this, in this PR I add a tweak to fix this in shard tensor: plain
torch.Tensorobjects will fire promotion (to replicated DTensor, since it's mathematically the same and the machinery is all there) before going to handlers.New wrappers
There are several new operations in
domain_parallel/shard_utils/: alinear_patches.pyis the most consequential, andattention_patches.pyhas substantial additions. A new filegrad_ops.pyconsolidates backward-only operations from several other files (point_cloud_ops.py,conv_patches.py,attention_patches.py) into one logical file andtest_grad_ops.pyintroduces some tests.Linear Patches
Linear layers are embarrassingly parallel, however pytorch's DTensor op flattens them prior to operating. For some tensors, the
viewoperation itself become problematic especially if the sharded dimension is not the last dimension.To fix this, the PR adds a custom linear path which routes all linear operations through a local, differentiable op that doesn't hit view issues.
Attention wrappers
The standard attention path in physicsnemo currently is ring attention. FLARE, however, has one tensor which is NOT sharded. This PR adds an attention path for a replicated tensors: it doesn't have to traverse a ring, and so we use a different algorithm.
Layer Updates
For both
gale.pyandcontext_projector.py, we have to do a reduction after the tokenization/projection. We duck type, so import shard tensor is unnecessary, and trigger a redistribute. The sharded placement after projecting back out is automatic, just like with transolver.Description
Checklist
Dependencies
Review Process
All PRs are reviewed by the PhysicsNeMo team before merging.
Depending on which files are changed, GitHub may automatically assign a maintainer for review.
We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.
AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.