Skip to content

adv_estimator (function param) vs advantage_estimator (config field) naming mismatch causes confusing startup crash #1792

Description

@KTanmay1

Problem

The function compute_advantages_and_returns in ppo_utils.py uses adv_estimator as its Python parameter name (line 1348), while the config field on AlgorithmConfig is named advantage_estimator (config.py line 366).

The trainer correctly reads self.cfg.trainer.algorithm.advantage_estimator and passes it as adv_estimator=... to the function — so the internal plumbing is correct. The problem is that the two different names create a footgun for anyone writing a new integration, entrypoint, or launch script.

Reproduction

If a developer writes trainer.algorithm.adv_estimator=gtpo on the CLI (copying the function parameter name as the natural config key), validate_dict_keys_against_dataclass raises at startup:

ValueError: Invalid fields {'adv_estimator'} for AlgorithmConfig.
            Valid fields are {'advantage_estimator', ...}

The run crashes immediately with no indication that advantage_estimator is the correct CLI key. The error message does list valid fields, but the root cause — that the function param and config field use different names — is non-obvious and easy to hit when writing new integrations.

Suggested fix

Rename the parameter in compute_advantages_and_returns from adv_estimator to advantage_estimator so both names are consistent. This is a one-line internal change with no behavior impact. All callers in trainer.py already pass the value via keyword argument, so they would need a matching rename.

Affected files

  • skyrl/backends/skyrl_train/utils/ppo_utils.py — function parameter name at line 1348
  • skyrl/train/config/config.py — config field advantage_estimator at line 366
  • skyrl/train/trainer.py — callers at lines 988, 1004, 1026 (keyword arg adv_estimator=)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions