Update geotransolver for 2d and 3d use cases#1502
Update geotransolver for 2d and 3d use cases#1502coreyjadams wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Greptile SummaryThis PR extends GeoTransolver with structured 2D and 3D convolutional paths, mirroring the existing Transolver structured mesh support. The refactoring extracts shared logic into reusable functions (
Important Files Changed
Last reviewed commit: a0cd8b0 |
| class StructuredContextProjector(_SliceToContextMixin, nn.Module): | ||
| r"""Context projector with Conv2d/Conv3d geometry encoding on structured grids. | ||
|
|
||
| Same output interface as :class:`ContextProjector`—slice tokens | ||
| :math:`(B, H, S, D)`—but projects per-cell geometry via spatial convolutions | ||
| aligned with structured GALE attention. | ||
| """ |
There was a problem hiding this comment.
Minimal class docstring for public API
StructuredContextProjector is exported in __init__.py as part of the public API, but its class docstring is much shorter than the sibling ContextProjector. Per the project's coding standards (MOD-003c), public class docstrings should include Parameters, Forward, Outputs, See Also, and Examples sections. The forward method (line 507) also lacks a docstring entirely (MOD-003d).
Consider adding documentation to match the level of detail in ContextProjector to help users understand the interface (e.g., expected spatial_shape, how it relates to ContextProjector, and a usage example).
File Used: CODING_STANDARDS/MODELS_IMPLEMENTATION.md (source)
| class GALEStructuredMesh2D(_GALEStructuredForwardMixin, PhysicsAttentionStructuredMesh2D): | ||
| r"""GALE with Conv2d slice projection for 2D structured grids (see :class:`GALE`).""" |
There was a problem hiding this comment.
Minimal docstrings on public classes
GALEStructuredMesh2D and GALEStructuredMesh3D (line 402) are exported in __init__.py but have single-line docstrings. Per the project's coding standards (MOD-003c), public classes should have Parameters, Forward, Outputs, See Also, and Examples sections. Consider expanding the docstrings to document the constructor parameters (especially spatial_shape, context_dim, and kernel) and include a usage example, similar to the GALE class above.
File Used: CODING_STANDARDS/MODELS_IMPLEMENTATION.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
PhysicsNeMo Pull Request
This PR adds the same structured 2d and 3d convolutional steps to geotransolver that are available in transolver.
To make sure the code is not overly duplicating, it refactors a few places to ensure the implementation can reuse core components as much as possible.
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.