nemo_rl.utils.outdated_config_checks#
Rejects config the code no longer accepts, pointing at the migration to apply.
Module Contents#
Functions#
Yields (dotted path, config) for every block that selects a training backend. |
|
Fail when a config still uses the old name or the removed _v2 key for the Automodel block. |
|
Fail when data still uses the flat pre-train/validation layout. |
|
Fail when checkpointing.metric_name still uses the bare-name format. |
|
Fail fast on config the code no longer accepts, naming the migration to apply. |
API#
- nemo_rl.utils.outdated_config_checks._train_backend_configs(
- config: dict[str, Any],
Yields (dotted path, config) for every block that selects a training backend.
The policy, the value model, the teachers and the reward-model environment. A check for any backend key can iterate these rather than re-deriving the locations.
Distillation keeps its single teacher under “teacher”, while the multi-teacher algorithms use a “teachers” list, so both spellings are visited.
- nemo_rl.utils.outdated_config_checks.reject_outdated_automodel_block(config: dict[str, Any]) None[source]#
Fail when a config still uses the old name or the removed _v2 key for the Automodel block.
Blocks that select Megatron are skipped: the run reads neither. If such a config relied on the old key to disable Automodel, Policy/Value.init reports the rename when both backends end up enabled.
- Parameters:
config – The config as the user wrote it, resolved to plain dicts.
- nemo_rl.utils.outdated_config_checks.reject_outdated_dataset_config(config: dict[str, Any]) None[source]#
Fail when data still uses the flat pre-train/validation layout.
- Parameters:
config – The config as the user wrote it, resolved to plain dicts.
- nemo_rl.utils.outdated_config_checks.reject_outdated_metric_name_format(
- config: dict[str, Any],
Fail when checkpointing.metric_name still uses the bare-name format.
- Parameters:
config – The config as the user wrote it, resolved to plain dicts.
- nemo_rl.utils.outdated_config_checks.check_outdated_config(config: dict[str, Any]) None[source]#
Fail fast on config the code no longer accepts, naming the migration to apply.
Call this from every entrypoint on the resolved config, before the MasterConfig is built. Validation rejects a missing required key on its own terms, so a check that runs after it can never explain a removal that changed such a key’s shape. Add a check here whenever a key is removed or the shape it accepts changes.
- Parameters:
config – The config as the user wrote it, resolved by OmegaConf.to_container.