nvalchemi.training.FineTuningStrategy.load_checkpoint#

classmethod FineTuningStrategy.load_checkpoint(root_folder, checkpoint_index=-1, map_location=None, *, hooks=None, training_fn=None, validators=None)#

Load a restartable strategy checkpoint.

This is the strategy-focused convenience wrapper around nvalchemi.training.load_checkpoint(). Use the module-level function when callers need the full manifest, component dictionaries, partial component loads, or foreign checkpoint adapters.

Parameters:
  • root_folder (Path | str) – Root directory containing checkpoint files.

  • checkpoint_index (int, optional) – Checkpoint index to load. -1 loads the latest manifest index.

  • map_location (str | torch.device | None, optional) – Device override passed through to torch.load() and the restored strategy metadata.

  • hooks (Sequence[Hook | TrainingUpdateHook | TrainingUpdateOrchestrator] | None, optional) – Runtime hooks to attach to the restored strategy.

  • training_fn (Callable[..., Mapping[str, torch.Tensor]] | str | None, optional) – Runtime training function override. This is required when the saved strategy used a local or otherwise non-importable training function.

  • validators (Sequence[CheckpointValidator] | None, optional) – Optional loaded-checkpoint validators forwarded to the lower-level loader.

Returns:

Restored strategy with model, optimizer, scheduler, and runtime counters loaded.

Return type:

TrainingStrategy

Raises:
  • ValueError – If the checkpoint does not contain restartable strategy metadata.

  • TypeError – If the restored strategy is not an instance of cls.