Releases#
Unreleased#
Discoverability improvements
METHODS.md: new root-level catalog table covering every method class and forward function with columns for forward fn, loss class, key callbacks, and paper reference.stable_pretraining/forward.pymodule docstring now cross-referencesstable_pretraining/methods/andMETHODS.mdfor the fullLightningModulecatalog.Type annotations on the forward functions in
stable_pretraining/forward.py:batch: dict[str, Any],stage: str, and-> dict[str, torch.Tensor]return types. Addedstable_pretraining/py.typedPEP 561 marker so mypy and pyright treat the package as typed.Top-level namespace:
stable_pretraining.methodsis now exposed as a lazy submodule. A curated set of common method classes (SimCLR,BYOL,DINO,DINOv2,VICReg,MAE,NNCLR,SwAV,BarlowTwins) are hoisted into the top-level__all__and_LAZY_ATTRS, makingimport stable_pretraining as spt; spt.SimCLRwork without a deep import. The full catalog remains understable_pretraining.methods.Agent compatibility files:
AGENTS.md(canonical instructions for all coding agents — repository layout, import patterns, core concepts, naming conventions, step-by-step guide for adding a new SSL method, and key design decisions);CLAUDE.mdupdated to point toAGENTS.mdand add Claude-specific workflow notes;.github/copilot-instructions.mdand.cursor/rulesadded as thin wrappers for GitHub Copilot and Cursor respectively.Moduledocstrings: added or expanded docstrings fortraining_step,validation_step,test_step,predict_step,on_train_start,rescale_loss_for_grad_acc, andafter_manual_backward.sptCLI: newspt websubcommand launches a local, dependency-free web viewer (stdlibhttp.server+ Server-Sent Events, NFS-safe). Readssidecar.json+metrics.csv(and optionalmedia.jsonl) under a given directory and renders a wandb-like UI with a metric tree, multi-run filter chips, group-by/sort, light/dark theme toggle, in-chart synced cursor tooltip, run-config modal, and a landing-page activity overview.spt webdefaults to{cache_dir}/runswhen no path is passed.RegistryLogger.log_image/log_video: new methods matching Lightning’sWandbLoggersignatures. Existing callbacks gating onhasattr(logger, "log_image")start writing to disk without code changes. Files land under{run_dir}/media/<safe_tag>/with an append-onlymedia.jsonlmanifest. The web viewer renders these alongside scalar charts in the same metric tree.Manager._resolve_run_diris now DDP-safe: rank-0 picks therun_dirand atomically publishes it under{cache_dir}/.rank_handoff/<launch_key>; non-zero ranks block on that handoff and adopt the same value. Prevents ranks from generating divergent uuids and writing inconsistent.slurm_indexentries (a silent data-loss source on multi-rank preempt+requeue). Rank detection uses Lightning’srank_zero_only.rank. Override timeout viaSPT_RANK_HANDOFF_TIMEOUT_S.New documentation pages: Cache directory & run layout (run directory layout, resume / requeue / DDP semantics, media layout) and CLI reference (full
spt run/spt web/spt registryreference).New API pages: stable_pretraining.registry (RegistryLogger + Registry query) and stable_pretraining.web (
serveentry point).
Version 0.1#
Added matmul_precision config parameter to control TensorFloat-32 (TF32) precision on Ampere and newer GPUs.
Base trainer offering the basic functionalities of stable-SSL (logging, checkpointing, data loading etc).
Template trainers for supervised and self-supervised learning (general joint embedding, JEPA, and teacher student models).
Examples of self-supervised learning methods : SimCLR, Barlow Twins, VicReg, DINO, MoCo, SimSiam.
Classes to load templates neural networks (backbone, projector, etc).
LARS optimizer.
Linear warmup schedulers.
Loss functions: NTXEnt, Barlow Twins, Negative Cosine Similarity, VICReg.
Base classes for multi-view dataloaders.
Functionalities to read the loggings and easily export the results.
RankMe, LiDAR metrics to monitor training.
Examples of extracting run data from WandB and utilizing it to create figures.
Fixed a bug in the logging functionality.