Update StormScope model package#938
Conversation
Greptile SummaryThis PR refreshes the StormScope model package to target the new
|
| Filename | Overview |
|---|---|
| earth2studio/models/px/stormscope.py | Major refactor: drops legacy EDMPrecond/DropInDiT shim in favour of physicsnemo.Module.from_checkpoint; adds registry-driven model loading, mixed GLM normalization, static invariant buffers, AMP/torch.compile support. One issue: deprecated variant's fill constant is a post-construction instance attribute not preserved through state_dict save/load. |
| earth2studio/data/goes_glm.py | Adds GOESGLMGrid: wraps GOESGLM into a gridded 0.1-degree product via 5-min binning and histogram2d; also fixes session-reuse bug in GOESGLM._fetch. Looks correct. |
| earth2studio/models/nn/stormscope_util.py | File deleted - removes the legacy EDMPrecond, DropInDiT, and model_wrap shim layer. No longer needed. |
| test/models/px/test_stormscope.py | Adds parametrized tests for AMP/compile flags, mrms_coverage_mask AND-combination, and fill-constant behavior for default and legacy paths. |
| examples/04_nowcasting/03_stormscope_goes_example.py | Updated to 3km_10min CONUS nowcasting variant; adds GLM channel fetch/stack, removes GFS_FX conditioning, fixes output filename and plot coordinates. |
| pyproject.toml | Bumps nvidia-physicsnemo minimum from 2.0 to 2.1.0 for the stormscope extra. |
| earth2studio/data/init.py | Exports GOESGLMGrid alongside existing GOESGLM. |
Reviews (3): Last reviewed commit: "nits" | Re-trigger Greptile
|
/blossom-ci |
NickGeneva
left a comment
There was a problem hiding this comment.
one last comment, approving!
|
/blossom-ci |
…ton/earth2studio into stormscope-sfe-version
|
/blossom-ci |
Earth2Studio Pull Request
Description
Updates the StormScope model in Earth2Studio to target the refreshed

nvidia/stormscope-goes-mrmspackage (commit62f0fd2), replacing the legacyDiT-wrapping approach with directphysicsnemo.Moduleloading.New models enable GOES, MRMS, and GLM Lightning predictions at CONUS-wide 3km / 10 minute spatiotemporal resolution. Example output:
Summary
Drop legacy shim layer — deleted
earth2studio/models/nn/stormscope_util.py(EDMPrecond,DropInDiT,model_wrap). Checkpoints now load viaphysicsnemo.Module.from_checkpoint; the returned module is stored directly inmodel_spec. Sampler calls updated to the new preconditioner signature (forward(x, t, condition=None), noround_sigma, noclass_labels).Registry-driven model loading —
load_modelresolves variant names (and aliases) fromregistry.jsonrather than hard-coded indices. Normalization statistics andvariables/conditioning_varslists are now selected by name from the registry's top-levelnormalizationblock.Mixed normalization (GLM channels) — per-channel
glm_mask/conditioning_glm_maskbuffers gate betweenlog1p/expm1(GLM channels) and standard mean/std normalization, applied in_forwardandnormalize_conditioning.Static invariant channels —
topoandnexrad_proximityarrays are loaded from the package and registered as buffers; appended inbuild_condition(nexrad then topo, broadcast over batch), enabling MRMS+GLM variants.GOESGLMGriddata source — new class inearth2studio/data/goes_glm.pywrappingGOESGLMevent parsing into a gridded 0.1° product via 5-minute binning andhistogram2d, matching preprocessing that was applied to model training data. Emitsxr.DataArray[time, variable, lat, lon]withglm_densityandglm_energy_densityvariables; exported fromearth2studio.data. Also fixes a session-reuse bug inGOESGLM._fetchwhere the aiobotocore client could be torn down between repeated calls.AMP +
torch.compilesupport —StormScopeBasegainsampandcompileconstructor arguments. Whenamp=True, DiT forward passes run undertorch.autocast; sampler latent math stays in fp64.compile_experts()wraps each staged expert withtorch.compile(mode="reduce-overhead"). Roughly 5x speedup for inferenceDependency bump —
nvidia-physicsnemo>=2.1.0(was>=2.0).Tests — new parametrized tests cover AMP/compile flag propagation,
mrms_coverage_maskAND-combination with the interpolator mask, and invalid fill-constant behavior for both the default and legacy paths.Checklist
Dependencies