Skip to content

Add performance profiling harness and baseline document - #91

Merged
maritsandstad merged 2 commits into
basefrom
perf/profiling-harness
Jul 31, 2026
Merged

Add performance profiling harness and baseline document#91
maritsandstad merged 2 commits into
basefrom
perf/profiling-harness

Conversation

@benmsanderson

Copy link
Copy Markdown
Owner

Summary

  • Adds a parameterized cProfile + tracemalloc harness for METEOR training and generation workloads.
  • Captures NorESM2-MM baseline numbers across six generation workloads and one training workload.
  • Documents a ranked list of optimization targets to be addressed in follow-up PRs.

What's here

  • scripts/profiling/run_profile.py — one workload per invocation, output to scripts/profiling/results/ as .prof + .json
  • scripts/profiling/analyze.py — summary table, hotspot leaderboard, and per-run drill-down
  • docs/profiling_baseline.md — baseline results and identified targets

No library behavior change

Follow-up PRs land the optimizations that populate the "Optimization outcomes" placeholder in the doc.

Test plan

  • python scripts/profiling/run_profile.py --list prints workloads
  • python scripts/profiling/run_profile.py --workload gen_no_noise --tag smoke completes and writes a .prof + .json
  • python scripts/profiling/analyze.py prints a coherent table

🤖 Generated with Claude Code

Reproducible cProfile + tracemalloc harness with parameterized workloads
covering both training and generation paths. Baseline numbers for
NorESM2-MM (training + six generation workloads: global timeseries at
varying N, multi-scale aggregation, degree-days impacts, no-noise
climatology, and gridded output) are captured in docs/profiling_baseline.md
alongside a ranked list of optimization targets to be tackled in follow-up
PRs.

The harness is standalone — one workload per invocation, output to
scripts/profiling/results/ as .prof + .json for post-hoc analysis via
scripts/profiling/analyze.py.

No library behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@maritsandstad maritsandstad 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.

This looks good and very useful to me, and doesn't really interfere with anything. The problem with the notebook not running is not to do with this PR, so as far as I can see this can probably just go in as is

@maritsandstad

Copy link
Copy Markdown
Collaborator

Alright, so the failing notebook here, fails because it is too resource intensive and github actions kills it. Don't think I will bother to solve that now before merging...

@maritsandstad
maritsandstad merged commit 1f83b0d into base Jul 31, 2026
13 of 16 checks passed
@maritsandstad
maritsandstad deleted the perf/profiling-harness branch August 3, 2026 18:05
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.

2 participants