Skip to content

[2186] Scaling utils#2231

Open
florianscheidl wants to merge 86 commits into
ecmwf:developfrom
florianscheidl:ekfs/scaling-plots-20260417
Open

[2186] Scaling utils#2231
florianscheidl wants to merge 86 commits into
ecmwf:developfrom
florianscheidl:ekfs/scaling-plots-20260417

Conversation

@florianscheidl

@florianscheidl florianscheidl commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Description

Contains utility we used for scaling experiments, namely to capture elapsed time metrics in the trainer and run_train.
Small code modifications became necessary as we trained on more than 16 nodes. Specifically:

  • Lower bound on warmup, cooldown, and decay steps in lr_scheduler
  • Lower bound on beta2 used in Adam optimizer (negative values are illegal). Set to 0.9 now, based on Internet suggestion, but open to suggestions.
  • Lower bound on len_per_rank when setting mini_epoch_base (avoiding zero-division error for small configs).

The data extraction and plot generation script are addressed in https://gitlab.jsc.fz-juelich.de/esde/WeatherGenerator-private/-/merge_requests/180.

Example plots and tables:

jupiter_weak_scaling_table jupiter_weak_scaling

Issue Number

Fixes #2186

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

- Track startup_time_seconds: time from run() start to training loop
- Track total_training_time_seconds: time in training/validation cycles
- Track overall_time_seconds: total wall-clock time from launch to finish
- All metrics logged only on root rank to avoid file contention
- Metrics written to metrics.json, automatically uploaded to MLflow
- Console logs show timing summaries for quick monitoring
- Created .hermes/ directory with skills/, tasks/, docs/ subfolders
- Added skills overview (README.md) with task-type skills
- Implemented 'planning' and 'metrics' skills
- Documented timing metrics task in tasks/2026-04-17-timing-metrics/
- Added agent structure documentation
- Updated .gitignore with optional .hermes/ entry
- Added 2-3 month review cycle recommendation
- Defined criteria for skill consolidation
- Included usage frequency thresholds
- Documented when to merge or remove skills
@florianscheidl florianscheidl marked this pull request as ready for review May 4, 2026 09:49
@github-actions github-actions Bot added the performance Work related to performance improvements label May 4, 2026
Comment thread src/weathergen/train/trainer.py Outdated
@github-project-automation github-project-automation Bot moved this to In Progress in WeatherGen-dev May 8, 2026
@florianscheidl

Copy link
Copy Markdown
Contributor Author

@clessig, anything blocking?

@clessig clessig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See detailed comments.

Comment thread packages/performance/README.md Outdated
stddev_all: dict,
avg_loss: list[float] = None,
lr: float = None,
elapsed_training_time_seconds: float | None = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you open a PR that we change plot_train so that we can plot losses against training time.

Comment thread src/weathergen/run_train.py Outdated
- Replace --x_type ('step'/'reltime') with --x-axis column selector
  ('samples', 'elapsed_training_time')
- Add x_axis param to plot_loss_avg (previously hardcoded num_samples)
- Add friendly x-axis labels: 'elapsed training time [s]' when
  plotting against elapsed_training_time_seconds
- plot_lr, plot_loss_avg, plot_loss_per_stream, plot_loss_per_run all
  now respect x_axis; xlabel is auto-derived from column name
- Remove dead x_type parameter from plot_loss_per_stream
@florianscheidl

Copy link
Copy Markdown
Contributor Author

I've implemented the changes discussed here and in #2501. The latter will only have the plotting changes.

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

Labels

performance Work related to performance improvements

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Create scaling plots for compute time proposal

3 participants