nemo_rl.utils.outdated_config_checks#

Rejects config the code no longer accepts, pointing at the migration to apply.

Module Contents#

Functions#

_train_backend_configs

Yields (dotted path, config) for every block that selects a training backend.

reject_outdated_automodel_block

Fail when a config still uses the old name or the removed _v2 key for the Automodel block.

reject_outdated_teacher_projection_matrix_path

Fail when an x-token teacher’s projection path is outside its aligner block.

reject_outdated_dataset_config

Fail when data still uses the flat pre-train/validation layout.

reject_outdated_metric_name_format

Fail when checkpointing.metric_name still uses the bare-name format.

reject_outdated_mcore_generation_keys

Fail when a removed policy.generation.mcore_generation_config key is present.

_dynamo_frontend_args

policy.generation.dynamo_cfg.frontend_args, or {} when absent.

reject_outdated_dynamo_router_reset_states

Fail when the Dynamo frontend’s removed router-reset-states key is present.

reject_outdated_dynamo_router_mode

Fail on the Dynamo router mode that Dynamo 1.7 removed.

reject_outdated_dynamo_backend

Fail on the removed backend: dynamo and its dynamo_cfg keys.

reject_outdated_context_compaction

Reject the old forest-training switch before schema validation.

reject_outdated_rollout_recovery_granularity

Fail when rollout_recovery still uses the *_granularity keys.

check_outdated_config

Fail fast on config the code no longer accepts, naming the migration to apply.

Data#

API#

nemo_rl.utils.outdated_config_checks._train_backend_configs(
config: dict[str, Any],
) → Iterator[tuple[str, dict[str, Any]]][source]#

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_teacher_projection_matrix_path(
config: dict[str, Any],
) → None[source]#

Fail when an x-token teacher’s projection path is outside its aligner block.

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],
) → None[source]#

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.reject_outdated_mcore_generation_keys(
config: dict[str, Any],
) → None[source]#

Fail when a removed policy.generation.mcore_generation_config key is present.

A config copied from an old exemplar usually carries several of these at once; they are reported in the order below, one per run.

Parameters:

config – The config as the user wrote it, resolved to plain dicts.

nemo_rl.utils.outdated_config_checks._dynamo_frontend_args(
config: dict[str, Any],
) → dict[str, Any][source]#

policy.generation.dynamo_cfg.frontend_args, or {} when absent.

nemo_rl.utils.outdated_config_checks.reject_outdated_dynamo_router_reset_states(
config: dict[str, Any],
) → None[source]#

Fail when the Dynamo frontend’s removed router-reset-states key is present.

Parameters:

config – The config as the user wrote it, resolved to plain dicts.

nemo_rl.utils.outdated_config_checks.reject_outdated_dynamo_router_mode(
config: dict[str, Any],
) → None[source]#

Fail on the Dynamo router mode that Dynamo 1.7 removed.

Parameters:

config – The config as the user wrote it, resolved to plain dicts.

nemo_rl.utils.outdated_config_checks._REMOVED_DYNAMO_CFG_KEYS#

None

nemo_rl.utils.outdated_config_checks._REMOVED_DYNAMO_FRONTEND_KEYS#

(‘tokenizer’, ‘tokenizer_cache’, ‘tokenizer_cache_bytes’)

nemo_rl.utils.outdated_config_checks.reject_outdated_dynamo_backend(config: dict[str, Any]) → None[source]#

Fail on the removed backend: dynamo and its dynamo_cfg keys.

Dynamo now serves NeMo RL’s own vLLM workers: backend: vllm plus dynamo: true. One migration, so the backend is reported first and the dynamo_cfg keys that no longer exist with it.

Parameters:

config – The config as the user wrote it, resolved to plain dicts.

nemo_rl.utils.outdated_config_checks.reject_outdated_context_compaction(
config: dict[str, Any],
) → None[source]#

Reject the old forest-training switch before schema validation.

nemo_rl.utils.outdated_config_checks._RENAMED_ROLLOUT_RECOVERY_KEYS#

None

nemo_rl.utils.outdated_config_checks.reject_outdated_rollout_recovery_granularity(
config: dict[str, Any],
) → None[source]#

Fail when rollout_recovery still uses the *_granularity keys.

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 when a previously supported key is removed or its accepted shape changes. Spellings or shapes introduced and replaced within the same unmerged PR need no check.

Parameters:

config – The config as the user wrote it, resolved by OmegaConf.to_container.