unilab.training¶
Shared training helpers for entrypoint scripts.
- class unilab.training.BackendAdapter[source]¶
Bases:
objectBuild env/play overrides from the final composed config.
- Parameters:
- __init__(cfg, *, root_dir, algo_name=None, scene_materializer=<function materialize_scene_visual_override>)[source]¶
- class unilab.training.ExperimentTracker[source]¶
Bases:
objectTracks experiment metadata locally and optionally in Weights & Biases.
- Parameters:
- __init__(*, root_dir, log_dir, algo_name, task_name, sim_backend, training_cfg, full_cfg, device=None, collector_device=None, seed_info=None)[source]¶
- unilab.training.assert_offpolicy_task_choice_matches_algo(cfg, *, algo_name=None)[source]¶
Reject offpolicy configs whose task owner path does not match the selected algo.
- unilab.training.create_env(cfg, *, num_envs, env_cfg_override=None, sim_backend=None, task_name=None)[source]¶
Construct an environment via the registry using the current Hydra config.
- unilab.training.ensure_registries()[source]¶
Import env modules so registry-based entrypoints can instantiate tasks.
- Return type:
- unilab.training.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.
- unilab.training.get_hydra_runtime_choice(cfg, group)[source]¶
Return a selected Hydra config-group choice when runtime metadata is available.
- unilab.training.get_latest_checkpoint(run_dir, *, suffix='.pt')[source]¶
Return the latest model checkpoint inside a run directory.
- unilab.training.get_latest_run(log_dir)[source]¶
Return the lexicographically latest run directory under a task log root.
- unilab.training.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.log_playback_plan(plan, *, prefix='')[source]¶
Print user-facing playback status for a resolved backend plan.
- Parameters:
plan (
BackendPlayRenderPlan)prefix (
str)
- Return type:
- unilab.training.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.
- unilab.training.resolve_checkpoint_path(base_log_dir, load_run, *, suffix='.pt')[source]¶
Resolve a latest or explicit checkpoint path from a task log root.
- unilab.training.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.
- unilab.training.should_run_playback(*, play_only, no_play, play_render_mode)[source]¶
Return whether train/eval should enter playback for the configured mode.
- class unilab.training.TrainingSeedInfo[source]¶
Bases:
objectConfigured and effective seed metadata for a training run.
- Parameters:
- unilab.training.apply_configured_training_seed(cfg, *, torch_runtime=True, cuda=True, mlx_runtime=False)[source]¶
Resolve and apply the configured training seed before runtime construction.
- Parameters:
- Return type:
- unilab.training.apply_training_seed(seed, *, torch_runtime=True, cuda=True, mlx_runtime=False)[source]¶
Apply a seed to the runtimes used by training entrypoints.
- unilab.training.derive_worker_seed(base_seed, worker_index=0)[source]¶
Derive deterministic subprocess seeds from the effective run seed.
- unilab.training.resolve_training_seed(cfg)[source]¶
Resolve the configured seed, preferring the algorithm-level contract.
- Parameters:
cfg (
Any)- Return type:
- unilab.training.setup_logger(log_dir, algo_name, *, echo=True, filename='train.log')[source]¶
Create a simple file-backed logger for script-local progress messages.
Modules
Resolved config adaptation for training entrypoints. |
|
Shared helpers for training entrypoints. |
|
Shared experiment tracking utilities for local files and W&B. |
|
Hardware monitoring utilities for performance profiling. |
|
Utility functions for reward config handling. |
|
RSL-RL-specific training helpers. |
|
Run directory and checkpoint resolution helpers. |
|
Shared training seed contract helpers. |