Skip to main content

Git-like experiment tracking for deep learning with exact computational resumption

Project description

Syckpt

Git-like experiment tracking for deep learning with exact computational resumption, zero-copy safetensors memory-mapping, and delta-compression.

syckpt is a lightweight, local-first experiment version control system designed to perfectly reconstruct massive computational states—model weights, optimizer momentum, mixed-precision GradScalers, Random Number Generators, and Stateful DataLoaders—without perturbing the loss curve.


How syckpt Works (The Architecture)

syckpt solves checkpoint bloat by treating machine learning parameters exactly like source code in a Git repository.

  1. Content-Addressable Storage (CAS) & Delta-Compression: Computes purely elemental arrays of delta = current - base to save disk space over epochs.
  2. Sub-Layer Freezing: Identifies immutable layers (e.g. frozen backbones) and uses virtual hard-links to achieve zero-cost storage.
  3. Locality-Sensitive Hashing (LSH): Hyperparameters hash into unique prefixes. Mathematically similar training runs intentionally collide into the identical hash bucket to instantly query the Git tree.
  4. Asynchronous Multiprocessing: Offloads I/O and delta math to background systems to prevent GPU stalling and bypass the GIL.
  5. Exact Mathematical Resumption: Restores RNG bit-states specifically across PyTorch, CUDA, Numpy, and isolated StatefulDataLoaders with $O(1)$ efficiency.

Installation

pip install syckpt

Workflows and Example Usages

1. Integrating into an Existing Training Flow

If you have a massive Vision Transformer (ViT) looping over a billion-image dataset on S3, slotting in syckpt takes 4 lines.

import torch
import torch.nn as nn
import torch.optim as optim
from syckpt import CheckpointManager
from syckpt.dataloader import StatefulRandomSampler
from torch.utils.data import DataLoader, TensorDataset

model = nn.Linear(10, 2)
optimizer = optim.SGD(model.parameters(), lr=0.01)
dataset = TensorDataset(torch.randn(100, 10), torch.randn(100, 2))

# Use StatefulRandomSampler for O(1) resumption
sampler = StatefulRandomSampler(dataset, batch_size=32)
loader = DataLoader(dataset, batch_size=32, sampler=sampler)

with CheckpointManager("./.syckpt") as ckpt:
    ckpt.model = model
    ckpt.optimizer = optimizer
    ckpt.sampler = sampler
    
    for epoch in ckpt.loop(epochs=10):
        for batch_idx, (x, y) in enumerate(loader):
            # Training happens here...
            ckpt.step_up()
            
        ckpt.save()

2. Hyperparameter Search Efficiency

Evaluating thousands of configurations linearly is deeply inefficient. Because syckpt utilizes Locality-Sensitive Hashing on the config object, running an efficient grid search is incredibly fast.

def evaluate_run(learning_rate: float):
    with CheckpointManager("./ml_logs/.syckpt") as ckpt:
        ckpt.model = ResNet50()
        ckpt.config.lr = learning_rate
        
        # Resumes directly from similar runs if hashes collide in LSH space
        for epoch in ckpt.loop(epochs=50):
            train_one_epoch()
            ckpt.save()

3. Distributed Resumption (PyTorch DDP)

syckpt seamlessly integrates with massive GPU topologies, employing dist.barrier() natively to guarantee exact write structures.

4. Exporting Monolithic Assets (.ckpt)

When the checkpoint has achieved optimal convergence, collapse the internal Git-Tree branches into a single flattened standard portable format.

with CheckpointManager("./experiments") as ckpt:
    ckpt.export_ckpt(hash_or_branch="main", output_path="final-model.ckpt")

Architectural Deep-Dive

Curious how syckpt leverages Git pointers, fsspec atomic cloud mechanisms, manages PyTorch tensors, and accelerates training via Zero-Copy Safetensors?

Read our comprehensive documentation reports across the docs/ suite:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syckpt-0.0.2.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syckpt-0.0.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file syckpt-0.0.2.tar.gz.

File metadata

  • Download URL: syckpt-0.0.2.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for syckpt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 df33c57370810e0f267136702287db2130778d4d7b9b0ea6202b011eecbfa7fa
MD5 272e2c1bd52092dec335eae4d4cfc158
BLAKE2b-256 7a91056a2cb9abc003e479592268dce109e986d6d287cdebed1e34a40757158f

See more details on using hashes here.

Provenance

The following attestation bundles were made for syckpt-0.0.2.tar.gz:

Publisher: publish.yml on SykChw/syckpt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syckpt-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: syckpt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for syckpt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2070015418490c37a0f0bd2fd4776ad6a73c0d14ad6a6fbb05e975556f4b7802
MD5 a7ad46356a51641509efa54e9d4b26dc
BLAKE2b-256 a924ab8291de23005935303b4aec6d82e5d829db805f1ab4b6e508e082069595

See more details on using hashes here.

Provenance

The following attestation bundles were made for syckpt-0.0.2-py3-none-any.whl:

Publisher: publish.yml on SykChw/syckpt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page