Skip to content

[Versioning] Migrate Hydra entry points to version_base 1.3 for Hydra 1.4 readiness - #4056

Draft
theap06 wants to merge 2 commits into
pytorch:mainfrom
theap06:compat/hydra-14-version-base
Draft

[Versioning] Migrate Hydra entry points to version_base 1.3 for Hydra 1.4 readiness#4056
theap06 wants to merge 2 commits into
pytorch:mainfrom
theap06:compat/hydra-14-version-base

Conversation

@theap06

@theap06 theap06 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Prepares Hydra entry points for Hydra 1.4 (#4055)

  • All hydra.main entry points and compose-API test calls now pass version_base="1.3" (previously "1.1", None, or unset).
  • Configs of scripts that ran under 1.1 compat gain hydra.job.chdir: true, keeping run-dir behavior unchanged.
  • hydra-core floor raised to >=1.3 in pyproject.toml.

Draft until Hydra 1.4 is released.

… 1.4 readiness

Hydra 1.4 will stop accepting version_base values below 1.3 (see
pytorch#4055 and facebookresearch/hydra#3237). Migrate all entry
points ahead of the release:

- Replace version_base=1.1 with 1.3 in 57 hydra.main entry points and
  the compose-API calls in test_helpers.py and test_configs.py.
- Replace version_base=None with 1.3 in the four LLM scripts (grpo and
  expert-iteration). Removing the argument, as suggested upstream, would
  emit a warning and flip back to 1.1-compat behavior on hydra 1.3.x,
  which remains the supported floor.
- Add version_base=1.3 to five decorators that omitted it (gail, iql,
  td3_bc); these previously warned on every run.
- Set hydra.job.chdir: true in the 53 primary configs of scripts that
  ran under 1.1 compat, preserving their run-directory behavior exactly.
- Raise the hydra-core floor to >=1.3 in pyproject.toml.

Verified with a synthetic hydra app under warnings-as-errors on both
hydra-core 1.3.2-line stable and 1.4.0.dev6 with omegaconf 2.4.0.dev14:
config composition, chdir into the run dir, and hydra-node stripping all
behave identically.
@pytorch-bot

pytorch-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4056

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 1, 2026
@github-actions github-actions Bot added Examples sota-implementations/ versioning Versioning change (version number etc) labels Aug 1, 2026

@theap06 theap06 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omry left a PR addressing all the migrating all entry points.

@omry

omry commented Aug 2, 2026

Copy link
Copy Markdown

Thanks for putting this together. The migration is broadly consistent: all 57 @hydra.main entry points now pin version_base="1.3", the former 1.1-style applications receive hydra.job.chdir: true, and the updated Python and YAML files parse successfully.

One item to address is propagating the hydra-core>=1.3 floor to every first-party dependency manifest. The PR updates pyproject.toml, but several direct installation paths still use an unconstrained hydra-core or hydra-core>=1.1, including:

  • examples/rlhf/requirements.txt
  • sota-implementations/ppo-async/requirements.txt
  • sota-implementations/grpo/requirements_gsm8k.txt
  • sota-implementations/grpo/requirements_ifeval.txt
  • docs/requirements.txt
  • the SOTA CI dependency installation

In an existing environment, an unconstrained requirement can leave Hydra 1.1 installed. The new version_base="1.3" decorators would then fail during application startup.

One broader, non-blocking observation: needing to repeat hydra.job.chdir: true across 53 configurations suggests these entry points lack a shared base configuration for common Hydra behavior. The explicit additions are fine for this migration, but consolidating shared settings into a base config included through the defaults list could reduce duplication and prevent drift during future migrations. That could be handled separately.

There is also a broader compatibility choice to make. The new requirement is hydra-core>=1.3, so it will allow Hydra 1.4, while version_base="1.3" only preserves the behaviors controlled by that setting. It does not protect TorchRL from other Hydra 1.4 or OmegaConf changes. Examples include native tuples becoming TupleConfig rather than ListConfig, changes to hydra.utils.instantiate() resolution and container semantics, and different handling of call-site dataclass or attrs instances.

I suggest choosing one of these approaches:

  • Add a CI job against the current Hydra 1.4 development release to detect broader incompatibilities; or
  • Temporarily constrain the dependency to hydra-core>=1.3,<1.4, then remove the ceiling once Hydra 1.4 is sufficiently finalized and TorchRL’s compatibility has been validated.

The current state—allowing Hydra 1.4 without testing it—leaves users exposed to incompatibilities outside the scope of version_base.

Hydra 1.4 is not yet finalized and TorchRL's compatibility with it has
not been validated. Constrain hydra-core to >=1.3,<1.4 so that the
version_base=1.3 migration in this PR is exercised against a known-good
Hydra, rather than against a moving pre-release target.

The ceiling is temporary: remove it once Hydra 1.4 is sufficiently
finalized and TorchRL has been validated against it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@theap06

theap06 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@omry I just temporarily constrained the dep for now. once the 1.4 is finalized and the trl compability has been validated, I will draft a follow up pr for the updated dep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Examples sota-implementations/ versioning Versioning change (version number etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants