Skip to content

Centralize and consolidate checkpoint/metadata utilities #246

@frazane

Description

@frazane

Problem: code and commands related to checkpoint metadata are in different places

Code for dealing with checkpoints metadata is currently a bit scattered across the framework. Here is a short list of modules:

Some utilities to interact with checkpoints metadata are available in the CLIs of anemoi-inference and anemoi-training. Here is a list:

From anemoi-inference:

  • inspect: Inspect the contents of a checkpoint file.
  • metadata: Edit, remove, dump or load metadata from a checkpoint file.
  • patch: Patch a checkpoint file.
  • sanitise: Sanitise a checkpoint file.

From anemoi-training:

  • checkpoint: Commands to interact with training checkpoints.

In most cases, interacting with the metadata of the checkpoint is a simple task that does not require the heavy dependencies that both libraries have, notably PyTorch. It would be ideal if such utilities were moved under anemoi-utils instead, as their primary location, and optionally (and temporarily) be exposed also via the other packages.


Proposal

We could move the code and the commands used to deal with the raw checkpoint metadata under anemoi-utils. We could provide:

  • a single CheckpointMetadata base class that will handle user interactions with the raw metadata. The class makes no assumptions about the actual contents of the metadata;
  • a single CLI entry point anemoi-utils checkpoint, with optionally more sub-commands, providing all the functionality to deal with raw checkpoint metadata (inspection, extraction, editing, etc.)

Out of scope

The implementation of a base class that makes assumptions about the metadata content (e.g. extracts specific information from the metadata, instantiates new objects from it, etc.) is not in scope of this discussion. Nevertheless, the need for such an abstraction for the anemoi framework is recognised and will be explored more in the future.

Implementation plan

Note

Waiting for a proposal to be accepted.

Organisation

MeteoSwiss

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Next Up

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions