unilab.utils.checkpoint

Pure-filesystem log root and checkpoint resolution helpers.

Functions

get_entrypoint_log_root(root_dir, *, ...[, ...])

Resolve the log root for non-Hydra entrypoints using training helper semantics.

get_latest_checkpoint(run_dir, *[, suffix])

Return the latest model checkpoint inside a run directory.

get_latest_run(log_dir)

Return the lexicographically latest run directory under a task log root.

resolve_appo_checkpoint_path(base_log_dir, ...)

Resolve an APPO checkpoint under a task log root, returning string paths.

resolve_checkpoint_path(base_log_dir, ...[, ...])

Resolve a latest or explicit checkpoint path from a task log root.

resolve_offpolicy_checkpoint_path(root_dir, ...)

Resolve an off-policy checkpoint from the repo-rooted log tree.

resolve_task_checkpoint_path(root_dir, *, ...)

Resolve checkpoint paths for auxiliary entrypoints through shared training semantics.

unilab.utils.checkpoint.get_entrypoint_log_root(root_dir, *, algo_log_name, log_root=None)[source]

Resolve the log root for non-Hydra entrypoints using training helper semantics.

Parameters:
Return type:

Path

unilab.utils.checkpoint.get_latest_run(log_dir)[source]

Return the lexicographically latest run directory under a task log root.

Parameters:

log_dir (str | Path)

Return type:

Path | None

unilab.utils.checkpoint.get_latest_checkpoint(run_dir, *, suffix='.pt')[source]

Return the latest model checkpoint inside a run directory.

Parameters:
Return type:

Path | None

unilab.utils.checkpoint.resolve_checkpoint_path(base_log_dir, load_run, *, suffix='.pt')[source]

Resolve a latest or explicit checkpoint path from a task log root.

Parameters:
Return type:

tuple[Path | None, Path | None]

unilab.utils.checkpoint.resolve_task_checkpoint_path(root_dir, *, task_name, load_run, algo_log_name, checkpoint=None, suffix='.pt', log_root=None)[source]

Resolve checkpoint paths for auxiliary entrypoints through shared training semantics.

Parameters:
Return type:

tuple[Path | None, Path | None]

unilab.utils.checkpoint.resolve_appo_checkpoint_path(base_log_dir, load_run)[source]

Resolve an APPO checkpoint under a task log root, returning string paths.

Parameters:
Return type:

tuple[str | None, str | None]

unilab.utils.checkpoint.resolve_offpolicy_checkpoint_path(root_dir, algo_log_name, task, load_run)[source]

Resolve an off-policy checkpoint from the repo-rooted log tree.

Parameters:
Return type:

tuple[str | None, str | None]