Add Gaussian perturbation checkpoint state#922
Conversation
Greptile SummaryThis PR opts the
|
| Filename | Overview |
|---|---|
| earth2studio/perturbation/gaussian.py | Adds _GaussianCheckpointState dataclass and wires an internal torch.Generator to the checkpoint framework; pre/post state capture logic and device-aware generator selection look correct. |
| test/perturbation/test_gaussian.py | New test_gaussian_checkpoint exercises level-1 and level-2 round-trips correctly; name in the PR description does not match the actual test function name. |
Reviews (2): Last reviewed commit: "Rename Gaussian checkpoint test" | Re-trigger Greptile
53c611c to
99c112a
Compare
99c112a to
8eaa079
Compare
019a23f to
4362a36
Compare
|
/blossom-ci |
3 similar comments
|
/blossom-ci |
|
/blossom-ci |
|
/blossom-ci |
|
/blossom-ci |
Earth2Studio Pull Request
Description
Second PR in the checkpointing stack.
Adds checkpoint opt-in state to the Gaussian perturbation so restartable workflows can preserve its internal
torch.Generatorstate without relying on global Torch or NumPy RNG state. The generator remains internal to the perturbation; checkpointing is controlled through the bound checkpoint state proxy and the selectedstate_policy.Stack
Validation
uv run ruff check earth2studio/perturbation/gaussian.py test/perturbation/test_gaussian.pyuv run pytest test/perturbation/test_gaussian.py::test_gaussian_checkpoint_state_round_trip -qgit diff --checkFull
test/perturbation/test_gaussian.pywas not clean in this local environment becausetorch_harmonicsis not installed for the optionalCorrelatedSphericalGaussiantests.Checklist
Dependencies
Depends on #912.