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 an x-token teacher’s projection path is outside its aligner block. |
|
Fail when data still uses the flat pre-train/validation layout. |
|
Fail when checkpointing.metric_name still uses the bare-name format. |
|
Fail when a removed |
|
|
|
Fail when the Dynamo frontend’s removed router-reset-states key is present. |
|
Fail on the Dynamo router mode that Dynamo 1.7 removed. |
|
Fail on the removed |
|
Reject the old forest-training switch before schema validation. |
|
Fail when rollout_recovery still uses the *_granularity keys. |
|
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],
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],
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],
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],
Fail when a removed
policy.generation.mcore_generation_configkey 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],
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],
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],
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: dynamoand its dynamo_cfg keys.Dynamo now serves NeMo RL’s own vLLM workers:
backend: vllmplusdynamo: 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],
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],
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.