Skip to content

Update GraphCast for model standards#1358

Merged
pzharrington merged 6 commits intoNVIDIA:mainfrom
pzharrington:graphcast-refactor
Feb 3, 2026
Merged

Update GraphCast for model standards#1358
pzharrington merged 6 commits intoNVIDIA:mainfrom
pzharrington:graphcast-refactor

Conversation

@pzharrington
Copy link
Collaborator

PhysicsNeMo Pull Request

Description

Updates GraphCast to comply with model standards, along with misc fixes:

  • Detailed shape documentation and annotation in the model itself
  • Removal of deprecated multimesh_level option
  • Moving recipe-specific items to the example
  • Updating example to use torch fused AdamW instead of apex
  • Update tests to drop old dgl reference

Tests are passing; transformer_engine dependency still needs to be worked out.

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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

This PR successfully updates GraphCast to comply with model standards while making necessary refactoring changes. The main model file now includes comprehensive docstrings with detailed shape annotations using jaxtyping (compatible since jit=False), and the deprecated multimesh_level parameter has been cleanly removed in favor of mesh_level.

Key improvements include:

  • Enhanced documentation with shape annotations for all forward methods
  • Moved recipe-specific code (loss functions, data utilities) from core library to example directory
  • Migrated from apex FusedAdam to PyTorch's native fused AdamW optimizer
  • Updated tests to remove deprecated dgl references and multimesh_level usage
  • Reorganized dependencies to make transformer_engine and netCDF4 optional rather than required for all model installations

All tests are reportedly passing, and the changes maintain backward compatibility at the functional level while cleaning up the API surface.

Important Files Changed

Filename Overview
physicsnemo/models/graphcast/graph_cast_net.py Added comprehensive docstrings, shape annotations using jaxtyping, removed deprecated multimesh_level parameter, and added input validation methods
examples/weather/graphcast/train_graphcast.py Migrated from apex FusedAdam to torch fused AdamW, updated imports to use local loss and data_utils modules
examples/weather/graphcast/data_utils.py Moved from physicsnemo.models.graphcast.utils.data_utils to example directory for recipe-specific use
test/models/graphcast/test_graphcast.py Updated tests to use mesh_level instead of deprecated multimesh_level, removed backward compatibility test
pyproject.toml Moved transformer_engine and netCDF4 out of required model dependencies, reorganized dependency structure

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Collaborator

@mnabian mnabian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a couple of comments.

@pzharrington
Copy link
Collaborator Author

/blossom-ci

@pzharrington
Copy link
Collaborator Author

/blossom-ci

@pzharrington
Copy link
Collaborator Author

/blossom-ci

@pzharrington
Copy link
Collaborator Author

/blossom-ci

1 similar comment
@pzharrington
Copy link
Collaborator Author

/blossom-ci

Copy link
Collaborator

@ktangsali ktangsali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to the toml file look good!

@pzharrington pzharrington added this pull request to the merge queue Feb 3, 2026
Merged via the queue into NVIDIA:main with commit b51aa70 Feb 3, 2026
5 of 7 checks passed
coreyjadams pushed a commit to coreyjadams/physicsnemo that referenced this pull request Feb 6, 2026
* Update for model standards

* Migrate loss to metrics

* format

* Fix CI test
coreyjadams pushed a commit to coreyjadams/physicsnemo that referenced this pull request Feb 6, 2026
* Update for model standards

* Migrate loss to metrics

* format

* Fix CI test
coreyjadams pushed a commit to coreyjadams/physicsnemo that referenced this pull request Feb 6, 2026
* Update for model standards

* Migrate loss to metrics

* format

* Fix CI test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants