feat: support for embedded files - #316
Open
b8raoult wants to merge 5 commits into
Open
Conversation
b8raoult
marked this pull request as ready for review
June 17, 2026 09:33
Contributor
|
What problem does this change solve? Is this idea just about storing the data of constant forcing with the checkpoint or are other files considered as well? For the latter, did you consider storing the respective tensors directly in the model? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Embedded files in Anemoi checkpoints
Anemoi checkpoints are zip archives that bundle model weights together with
metadata and supporting arrays. This branch adds the ability to embed
arbitrary files inside a checkpoint, list them, extract them, remove them,
and read them back transparently at runtime through a new
checkpoint://URI scheme.
The goal is to create standalone checkpoint file for inference. Imagine that we add the bathymetry as NetCDF in a checkpoint, we should be able to have the following run config:
Embedded files are stored inside the checkpoint zip under a dedicated folder:
A new
embedded-filesCLIThe command is exposed through the
anemoi-utilsentry point. Exactly oneaction (
--list,--add,--remove,--extract, or--cat) must be given.List embedded files
Prints each embedded file name followed by its size and modification time, e.g.:
Add files
The file's base name is used as the embedded name. You cannot embed the
checkpoint into itself.
Without
--overwrite, adding a file whose name already exists raises an error.Remove files
Remove embedded files by name:
Extract files
Extract by name to the current directory, or to a chosen directory:
Extraction fails if a target file already exists unless
--overwriteis given,and fails if a requested name is not present in the checkpoint.
Read via the
checkpoint://scheme (--cat)--catis a test/demo of thecheckpoint://resolution: it resolvescheckpoint://<name>to a local path throughcheckpoint_file(...)and printsthe decoded contents to stdout.
What problem does this change solve?
What issue or task does this change relate to?
Additional notes
As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/
By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.