Hooks registry#

Training lifecycle hooks. See Add a hook.

Build any of these from a config with hooks=[dict(type=...)], using the type string in the first column. Generated from the live registry - 26 classes (26 names including aliases), grouped by role.

Checkpointing#

Save and load checkpoints / resume state (delegate to CheckpointManager).

Name

Summary

CheckpointLoader

Load model weights and, when requested, resume optimizer/train state.

CheckpointSaver

Save epoch/metric-oriented checkpoints during and after training.

CheckpointSaverIteration

Save iteration-oriented checkpoints on a pure global-step cadence.

pimm.engines.hooks.checkpoint.CheckpointLoader

Load model weights and, when requested, resume optimizer/train state.

pimm.engines.hooks.checkpoint.CheckpointSaver

Save epoch/metric-oriented checkpoints during and after training.

pimm.engines.hooks.checkpoint.CheckpointSaverIteration

Save iteration-oriented checkpoints on a pure global-step cadence.

Logging#

Per-step / per-epoch scalar logging and run naming.

Name

Summary

InformationWriter

Assemble per-step console logs and write scalar train metrics.

IterationTimer

Measure data/batch latency and append timing and ETA to iteration logs.

WandbNamer

Auto-generate cfg.wandb_run_name from selected config values.

pimm.engines.hooks.logging.InformationWriter

Assemble per-step console logs and write scalar train metrics.

pimm.engines.hooks.logging.IterationTimer

Measure data/batch latency and append timing and ETA to iteration logs.

pimm.engines.hooks.logging.WandbNamer

Auto-generate cfg.wandb_run_name from selected config values.

Evaluation#

In-loop validators, final testers, and SSL probes; they set the checkpoint-selection metric.

Name

Summary

FinalEvaluator

Run the configured tester once after training, usually on model_best.

InstanceSegmentationEvaluator

Instance-level segmentation metrics including ARI and detection/class stats.

MAEEvaluator

Validation hook for masked-autoencoder (MAE) pretraining.

PretrainEvaluator

Evaluate frozen pretraining features with downstream linear probes.

SemSegEvaluator

Evaluate point-wise semantic segmentation on the validation loader.

pimm.engines.hooks.eval.final_tester.FinalEvaluator

Run the configured tester once after training, usually on model_best.

pimm.engines.hooks.eval.instance_segmentation.InstanceSegmentationEvaluator

Instance-level segmentation metrics including ARI and detection/class stats.

pimm.engines.hooks.eval.pretrain.mae.MAEEvaluator

Validation hook for masked-autoencoder (MAE) pretraining.

pimm.engines.hooks.eval.pretrain.semantic_segmentation_pretrain.PretrainEvaluator

Evaluate frozen pretraining features with downstream linear probes.

pimm.engines.hooks.eval.semantic_segmentation.SemSegEvaluator

Evaluate point-wise semantic segmentation on the validation loader.

Diagnostics#

Gradient/feature/prototype/parameter monitors and dtype/anneal controls.

Name

Summary

AttentionMaskAnnealingHook

Drive and log attention-mask annealing for the Panda detector decoder.

DtypeOverrider

Force matched layers to compute (and optionally store params) in a dtype.

FeatureStdMonitor

Monitor feature standard deviation to detect representation collapse.

GradientNormLogger

Log model gradient norms to the writer after each training step.

LogitEntropyLogger

Log the entropy of teacher logits using Sonata’s temperature schedule.

ParameterCounter

Log a parameter-count breakdown of the model at the start of training.

PrototypeUsageLogger

Monitor prototype utilization in Sonata-style clustering heads.

SimulateCrash

Hard-exit the process after a fixed number of steps to simulate a crash.

pimm.engines.hooks.diagnostics.AttentionMaskAnnealingHook

Drive and log attention-mask annealing for the Panda detector decoder.

pimm.engines.hooks.diagnostics.DtypeOverrider

Force matched layers to compute (and optionally store params) in a dtype.

pimm.engines.hooks.diagnostics.FeatureStdMonitor

Monitor feature standard deviation to detect representation collapse.

pimm.engines.hooks.diagnostics.GradientNormLogger

Log model gradient norms to the writer after each training step.

pimm.engines.hooks.diagnostics.LogitEntropyLogger

Log the entropy of teacher logits using Sonata's temperature schedule.

pimm.engines.hooks.diagnostics.ParameterCounter

Log a parameter-count breakdown of the model at the start of training.

pimm.engines.hooks.diagnostics.PrototypeUsageLogger

Monitor prototype utilization in Sonata-style clustering heads.

pimm.engines.hooks.diagnostics.SimulateCrash

Hard-exit the process after a fixed number of steps to simulate a crash.

Optimizer schedules#

Hooks that mutate optimizer parameter groups (weight-decay exclusion / scheduling).

Name

Summary

WeightDecayExclusion

Rewrite optimizer param groups to exclude selected params from weight decay.

WeightDecayScheduler

Apply a cosine schedule to optimizer parameter-group weight decay.

pimm.engines.hooks.optimizer.WeightDecayExclusion

Rewrite optimizer param groups to exclude selected params from weight decay.

pimm.engines.hooks.optimizer.WeightDecayScheduler

Apply a cosine schedule to optimizer parameter-group weight decay.

Hugging Face export#

Push checkpoints to the Hub during or after training.

Name

Summary

PushToHub

Push model checkpoints to the Hugging Face Hub during and/or after training.

pimm.engines.hooks.export.PushToHub

Push model checkpoints to the Hugging Face Hub during and/or after training.

Resources & profiling#

Memory/GC management, resource-utilization logging, and the runtime profiler.

Name

Summary

GarbageHandler

Control Python garbage collection (and CUDA cache) on a step cadence.

ResourceUtilizationLogger

Log GPU and CPU/RAM utilization to the writer over the course of training.

RuntimeProfiler

Run a short torch.profiler trace before normal training proceeds.

pimm.engines.hooks.resources.GarbageHandler

Control Python garbage collection (and CUDA cache) on a step cadence.

pimm.engines.hooks.resources.ResourceUtilizationLogger

Log GPU and CPU/RAM utilization to the writer over the course of training.

pimm.engines.hooks.profiling.RuntimeProfiler

Run a short torch.profiler trace before normal training proceeds.

Core#

Lifecycle plumbing shared by other hooks.

Name

Summary

ModelHook

Bridge that forwards lifecycle calls to a model implementing HookBase.

pimm.engines.hooks.default.ModelHook

Bridge that forwards lifecycle calls to a model implementing HookBase.