unilab.algos.torch.hora.distill_config

HORA distillation config and teacher-owner resolution helpers.

Functions

apply_teacher_defaults(cfg, *[, root_dir])

Merge teacher-owner defaults under the user distillation config.

get_teacher_owner_spec(cfg)

Resolve the teacher algo family and task owner from distillation config.

load_teacher_owner_config(algo_family, task, *)

Load a HORA teacher owner config and its direct owner defaults.

resolve_teacher_checkpoint_path(cfg, *[, ...])

Resolve the selected HORA teacher checkpoint through owner metadata.

resolved_distill_runtime_cfg(cfg)

Return checkpoint runtime fields needed to rebuild the student model.

teacher_default_cfg(cfg, *[, root_dir])

Build HORA student defaults from the selected teacher owner YAML.

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

Build explicit teacher provenance metadata for distillation outputs.

unilab.algos.torch.hora.distill_config.load_teacher_owner_config(algo_family, task, *, root_dir=None)[source]

Load a HORA teacher owner config and its direct owner defaults.

Parameters:
Return type:

DictConfig

unilab.algos.torch.hora.distill_config.get_teacher_owner_spec(cfg)[source]

Resolve the teacher algo family and task owner from distillation config.

Parameters:

cfg (DictConfig)

Return type:

tuple[str | None, str | None]

unilab.algos.torch.hora.distill_config.teacher_default_cfg(cfg, *, root_dir=None)[source]

Build HORA student defaults from the selected teacher owner YAML.

Parameters:
  • cfg (DictConfig)

  • root_dir (str | Path | None)

Return type:

DictConfig

unilab.algos.torch.hora.distill_config.apply_teacher_defaults(cfg, *, root_dir=None)[source]

Merge teacher-owner defaults under the user distillation config.

Parameters:
  • cfg (DictConfig)

  • root_dir (str | Path | None)

Return type:

DictConfig

unilab.algos.torch.hora.distill_config.resolved_distill_runtime_cfg(cfg)[source]

Return checkpoint runtime fields needed to rebuild the student model.

Stage-2 checkpoints intentionally do not persist owner runtime settings such as env, reward, or domain randomization. Replay should use the currently composed owner config for those fields.

Parameters:

cfg (DictConfig)

Return type:

DictConfig

unilab.algos.torch.hora.distill_config.teacher_run_metadata(cfg, *, teacher_algo_family, teacher_checkpoint, root_dir=None)[source]

Build explicit teacher provenance metadata for distillation outputs.

Parameters:
  • cfg (DictConfig)

  • teacher_algo_family (str)

  • teacher_checkpoint (Path)

  • root_dir (str | Path | None)

Return type:

dict[str, Any]

unilab.algos.torch.hora.distill_config.resolve_teacher_checkpoint_path(cfg, *, root_dir=None)[source]

Resolve the selected HORA teacher checkpoint through owner metadata.

Parameters:
  • cfg (DictConfig)

  • root_dir (str | Path | None)

Return type:

tuple[Path | None, Path | None]