Lightning Integration
SimpCatLogger is a PyTorch Lightning Logger that sends metrics to Simpcat. It’s a drop-in replacement for WandbLogger.
Prerequisites
Section titled “Prerequisites”SimpCatLogger requires lightning, which is already installed in any Lightning-based training environment. No special extras needed — just pip install simpcat.
Basic usage
Section titled “Basic usage”from simpcat import SimpCatLoggerimport lightning as L
logger = SimpCatLogger(project="my-project", name="experiment-1")trainer = L.Trainer(logger=logger, max_epochs=10)trainer.fit(model, datamodule)The logger automatically:
- Creates a run on
trainer.fit() - Logs all training/validation metrics
- Records hyperparameters via
log_hyperparams() - Keeps the run open across Lightning stages such as
validate(),fit(), andtest() - Stores local SimpCat state under
save_dir/simpcatwhensave_diris provided, otherwise under the default.simpcat/run-data directory
Run lifecycle
Section titled “Run lifecycle”Lightning calls logger finalization hooks after each trainer entrypoint, not only
when the whole experiment is done. SimpCatLogger therefore does not finish the
SimpCat run from Lightning finalization. The run is finished when you call
simpcat.finish() / run.finish(), or automatically when the Python process
exits.
This lets one run cover multi-stage workflows:
trainer.validate(model, datamodule=datamodule)trainer.fit(model, datamodule=datamodule)trainer.test(model, datamodule=datamodule)If you want deterministic cleanup before process exit, own the run explicitly and finish it after all Lightning stages and manual logging are complete:
run = simpcat.init(project="my-project", name="experiment-1")logger = SimpCatLogger(run=run)
trainer = L.Trainer(logger=logger)trainer.fit(model, datamodule)
run.finish("finished")Sharing a run with simpcat.init()
Section titled “Sharing a run with simpcat.init()”If you need access to the run object (e.g. to log media), create it first and pass it in:
import simpcatfrom simpcat import SimpCatLogger
run = simpcat.init(project="my-project")
# Log media directlysimpcat.log({"sample": simpcat.Audio(audio, sample_rate=22050)})
# Pass run to Lightninglogger = SimpCatLogger(run=run)trainer = L.Trainer(logger=logger)trainer.fit(model, datamodule)Auto-expiring runs
Section titled “Auto-expiring runs”logger = SimpCatLogger(project="my-project", auto_expire_seconds=3600)Additional parameters
Section titled “Additional parameters”SimpCatLogger also accepts:
save_dir— Optional directory for run data. When provided, reusing the samesave_dirwith default auto-resume reuses the run id insave_dir/simpcat/run.json. When omitted, SimpCat uses the default.simpcat/run-data directory.mode— Reporter mode ("online","offline", or"disabled"). When"disabled", creates aNoOpRunthat discards all data.
Distributed training
Section titled “Distributed training”SimpCatLogger automatically detects distributed training and only logs on rank 0 (using LOCAL_RANK or RANK env vars). Other ranks use a NoOpRun that discards all data. Setting mode="disabled" also creates a NoOpRun.