unilab.training.run

Run directory 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.

get_log_root(root_dir, cfg)

Resolve the algorithm log root, honoring optional training.log_root overrides.

log_playback_plan(plan, *[, prefix])

Print user-facing playback status for a resolved backend plan.

parse_checkpoint_path(cfg, *, root_dir[, ...])

Resolve a checkpoint path from Hydra config and repository root.

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

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

resolve_task_checkpoint_path(root_dir, *, ...)

Resolve checkpoint paths for auxiliary entrypoints through shared training semantics.

should_run_playback(*, play_only, no_play, ...)

Return whether train/eval should enter playback for the configured mode.

unilab.training.run.should_run_playback(*, play_only, no_play, play_render_mode)[source]

Return whether train/eval should enter playback for the configured mode.

Parameters:
Return type:

bool

unilab.training.run.log_playback_plan(plan, *, prefix='')[source]

Print user-facing playback status for a resolved backend plan.

Parameters:
Return type:

None

unilab.training.run.get_log_root(root_dir, cfg)[source]

Resolve the algorithm log root, honoring optional training.log_root overrides.

Parameters:
  • root_dir (str | Path)

  • cfg (DictConfig)

Return type:

Path

unilab.training.run.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:
  • root_dir (str | Path)

  • algo_log_name (str)

  • log_root (str | Path | None)

Return type:

Path

unilab.training.run.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.training.run.get_latest_checkpoint(run_dir, *, suffix='.pt')[source]

Return the latest model checkpoint inside a run directory.

Parameters:
  • run_dir (str | Path)

  • suffix (str)

Return type:

Path | None

unilab.training.run.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.training.run.parse_checkpoint_path(cfg, *, root_dir, load_run=None, task_name=None, checkpoint=None, suffix='.pt')[source]

Resolve a checkpoint path from Hydra config and repository root.

Parameters:
Return type:

tuple[Path | None, Path | None]

unilab.training.run.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]