Overview
A memory-first, lightning-fast, ready-to-use ML checkpointing library.
Adapters for PyTorch DCP, Megatron-LM and NeMo 2.0 are readily available for seamless integration. They are built on top of the core checkpointing APIs, which can also be used directly for custom integrations.
If interested in a native integration with another framework, please let us know by creating a feature request or upvoting an existing one!
For learning more about using the library and its performance, check out the user documentation. Below you will find development instructions for contributors.
Installation
This library defines core dependencies, as well as additional optional dependencies for specific adapters, to avoid polluting consumers with unnecessary dependencies.
See the adapters installation commands below for examples of the available options, and the pyproject.toml as the source of truth for all available adapters.
Core Library
pip install -e .
To avoid building C++ tests (and pulling test dependencies), such as when using for production:
pip install -e . --config-settings=cmake.define.BUILD_TESTING=OFF
NOTE: Currently C++ binaries are expected to be in the package alongside the code, so editable mode (-e) is used.
With Adapters
# PyTorch
pip install -e .[pytorch]
# Megatron-LM
pip install -e .[megatron]
# Multiple
pip install -e .[pytorch,megatron]
Development
Check out our CodeWiki for AI-generated documentation of the code structure and implementation.
Python version
Ensure you have the correct Python version. As of this writing, the project uses Python 3.10, due to limitations in NeMo's dependencies.
To confirm, see which versions of python come up when tab-completing python in your shell.
You could install pyenv to manage different Python versions: https://github.com/pyenv/pyenv?tab=readme-ov-file#installation.
And then install the desired Python version with it e.g. pyenv install 3.10.
Build and Installation
NOTE: If you already have a .venv for a different version in this repository, run rm -rf .venv first.
To set up the development environment, run (at the project root):
# Create and activate a virtual environment (e.g., using venv) in your local env (only needed once, but is safe to rerun)
python3.10 -m venv .venv
source .venv/bin/activate
# Install the package in editable mode with development dependencies
pip install -e .[dev]
Linting and Testing
All code changes must be accompanied by comprehensive unit tests, and integration tests where feasible. With AI coding tools, there's no good reason to cut corners or omit tests. You can prompt your coding tool to "create a comprehensive test plan for X, covering edge cases and corner cases" that you can review.
-
Build C++ Components: The C++ components are built automatically when you run one of the
pip installcommands from above. -
Python Format: To apply automated fixes, run (with caution): NOTE: This may also modify lines that do not violate the lint rules, so use cautiously!
ruff check --fix . ruff format .
-
Python Lint: To check for code style violations, run:
ruff check .
-
C++ Format: To apply automated fixes, run:
# install clang-format-18 sudo apt-get update && sudo apt-get install -y clang-format-18 # format all C++ files find src -name '*.cpp' -o -name '*.h' | xargs clang-format-18 -i
-
C++ Lint: Check for style violations, run:
find src -name '*.cpp' -o -name '*.h' | xargs clang-format-18 --dry-run --Werror
-
GitHub Actions Lint: To pin action versions, first install
ratchet- one way is viago install:go install github.com/sethvargo/ratchet@latest
Then run it on the workflow yaml file:
ratchet pin .github/workflows/build-and-test.yml # Or if installed to a specific location not in your path, something like: ~/go/bin/ratchet pin ./.github/workflows/build-and-test.yml
-
Test: To run all tests (Python and C++), run:
pytest
- Python tests should be in the
testsdirectory, in a package matching the subject-under-test, and the test files should start withtest_. - C++ tests should be in a
testdirectory next to the subject-under-test (so within thesrcdirectory), and should end with_test.cpp.
- Python tests should be in the
Code Coverage
To calculate code coverage, run ./run_coverage.sh from the project root.
It will activate the venv located at .venv, remove build files, re-install the project, and produce coverage reports.
Conventional Commits
This project uses conventional commits, and the commit message should complete the sentence: "This change will...".
Specifying the scope for commits is optional, but highly recommended.
Typically, the scope will match the package the change relates to, and can use / for sub-packages, e.g.:
chore(replication): add the ReplicationManager skeleton class
feat(adapter/nemo): implement the callback to trigger MLFlashpoint checkpoints
Logging
- Keep useful, low-frequency progress logs and major state changes or important function entries at
INFOlevel. High level important performance metrics can beINFOas well (see the note below onDEBUGlogging). - Warnings and things that should be notified to the user, but not necessarily halt immediately, should be
WARNINGlevel. This includes things that are potentially unexpected, or could lead to unwanted behavior/performance. - All errors and exceptions (whether swallowed/handled or not) should be logged at
ERRORlevel - these should always be noteworthy and worth trying to address. If it is not worth fixing, make itWARNING. - Everything else, such as low-level details on branch logic, progress within a function, and more specific performance details should be
DEBUG.
Here is a guideline for VLOG levels to use in C++.
NOTE: The rule of thumb is to use VLOG(3) for DEBUG logging in C++, equivalent to when you'd use debug logging in other languages.
| Level | Usage Case | Frequency |
|---|---|---|
VLOG(2) |
Detailed events: Per-request or per-connection logic (e.g., "Connection X added to active set"). | Medium |
VLOG(3) |
Deep tracing: Logic branches inside loops or complex conditionals. | High |
VLOG(4)+ |
Extremely noisy: Byte-level data, heartbeats, or internal mutex locking/unlocking details. | Very High |
Releases
We use release tags of the form vX.Y.Z for production releases, following semver, starting with zerover.
Releases should be created as GitHub Releases, which can be done here.
The helper script create_release.py will generate release notes that can be added to the Release.
Command: ./scripts/create_release.py.
Add -h for help.
Requirements:
- These release tags MUST be immutable - they cannot be modified or deleted after they are created.
- These release tags MUST be created from an approved and merged commit, typically from the
mainbranch. - They MUST NOT be created from unapproved, unmerged commits, such as a feature branch or patchset. The commit used to create the release tag must always be accessible and not temporary.
User Documentation Site
User documentation is all maintained in the docs/ directory, and is generated using mkdocs-material.
See the .example-syntax.md file for guidance on certain supported syntax.
When making changes, you can view them locally via mkdocs serve.
Once changes are merged to main, they are automatically deployed to the documentation site, available at https://google.github.io/ml-flashpoint.
Metadata
Release files for ml-flashpoint 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ml_flashpoint-0.0.10.tar.gz | 277.0 kB | With provenance | Details for ml_flashpoint-0.0.10.tar.gz |
Release files / ml_flashpoint-0.0.10.tar.gz
| Download URL | ml_flashpoint-0.0.10.tar.gz |
|---|---|
| Size | 277.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c27fa2e73026ca083a11dfe3fb5e5a170980acbab2a48f5aee5ee0463bdf1730
|
|
BLAKE2b-256 checksum How to use checksums |
0f0a3c1928940a958638727e6a0a2b7feec873c3cd34f0d5ed52f21d89e6ad0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Oct 16, 2026.
Transparency logSecurity for ml-flashpoint 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for ml_flashpoint-0.0.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Oct 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.