Skip to content

[2803][datareader] Output the encoded initial conditions with the latent writer - #2804

Open
evenmn wants to merge 70 commits into
ecmwf:developfrom
metno:evenmn/dev/latent_writer_encoded_initcond
Open

evenmn wants to merge 70 commits into
ecmwf:developfrom
metno:evenmn/dev/latent_writer_encoded_initcond

Conversation

@evenmn

@evenmn evenmn commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Functionality for writing the latent space to file is already implemented in develop. However, this writer can only be combined with the forecast engine, as it writes out the forecasted latent space from the forecast engine. For many applications this is sufficient, but sometimes it would be useful to write the encoded initial conditions as well. An example is when generating a dataset of latent states to train tail networks on.

Here, this feature is implemented in the most minimal way

Issue Number

Closes #2803

Is this PR a draft? Mark it as draft.

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

FastEvaluation

  • I have updated the public documentation if necessary

evenmn and others added 30 commits March 11, 2026 15:05
Signed-off-by: evenmn <evenmn@mn.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
…nput. Updated ModelParams and ModelOutput classes accordingly

Signed-off-by: evenmn <evenmn@fys.uio.no>
…n with targets.physical

Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
…atherGenerator into evenmn/fix/incremental-rollout2
…hunk_size to number of steps, keeping the original behavior

Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
… peak memory footprint

Signed-off-by: evenmn <evenmn@fys.uio.no>
Conflict resolutions:
- engines.py: keep branch's incremental index_copy_ embedding loop; add develop's
  assert message, get_scatter_idxs_vectorized, Local2GlobalSumEngine, IdentityEngine,
  and spherical RoPE updates. Fix: restore missing scatter_idxs computation.
- model.py: keep branch's rollout_steps param and chunked forward pass; add develop's
  spherical RoPE, pushforward trick, IdentityEngine fallback for fe_num_blocks=0,
  and enabled-flag filtering for loss terms. Fix: restore if self.forecast_engine: guard.
- target_and_aux_ssl_teacher.py: adopt develop's EncoderTeacher/EMATeacher/FrozenTeacher
  refactor; update both forward_teacher methods to pass rollout_steps=batch.get_output_len().
- trainer.py: auto-merged cleanly.

Known pre-existing failures on ecmwf/develop (not introduced by this merge):
- small1_test / small_multi_stream_test: ValueError in _add_lead_time_coord
  (dataarray_postprocessing.py, PR ecmwf#2140) - source_interval_start varies per ipoint
- jepa1_test: omegaconf DictConfig/ListConfig mismatch - jepa1.yaml model_input
  uses old list format incompatible with develop's default_config.yml dict format
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: evenmn <evenmn@fys.uio.no>
Signed-off-by: Even Marius Nordhagen <evnor2743@met.no>
…ith develop

Signed-off-by: Even Marius Nordhagen <evnor2743@met.no>
…atherGenerator into evenmn/fix/incremental-rollout2
tnipen and others added 7 commits August 24, 2026 18:57
@github-actions github-actions Bot added data Anything related to the datasets used in the project model Related to model training or definition (not generic infra) labels Sep 9, 2026
@github-actions github-actions Bot added the infra Issues related to infrastructure label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Anything related to the datasets used in the project infra Issues related to infrastructure model Related to model training or definition (not generic infra)

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Output the encoded initial conditions with the latent writer

4 participants