Skip to content

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

Merged
vmoens merged 2 commits into
pytorch:mainfrom
theap06:compat/hydra-14-version-base
Aug 8, 2026
Merged

[Versioning] Migrate Hydra entry points to version_base 1.3 for Hydra 1.4 readiness#4056
vmoens merged 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.

@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.

⚠️ 15 Awaiting Approval

As of commit b77dac5 with merge base 71f103e (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

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.

@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.

@vmoens vmoens added the ci/olddeps Run the tests-olddeps suite (oldest supported torch) on this PR label Aug 4, 2026
@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Aug 4, 2026
@vmoens
vmoens force-pushed the compat/hydra-14-version-base branch from 2060184 to 15564e8 Compare August 5, 2026 15:12
@vmoens
vmoens marked this pull request as ready for review August 6, 2026 07:00
@github-actions github-actions Bot added the CI Has to do with CI setup (e.g. wheels & builds, tests...) label Aug 7, 2026
@vmoens
vmoens force-pushed the compat/hydra-14-version-base branch from 3eb7179 to 6373ab5 Compare August 7, 2026 14:20

@vmoens vmoens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM let's wait till the CI has finished running
Can you look at the PR once more, I made some edits, just want to check they make sense

vmoens and others added 2 commits August 8, 2026 08:55
The expert-iteration and GRPO entry points moved from `version_base=None` to
`"1.3"`. `version_base=None` selects Hydra's 1.1 compatibility defaults, which
include `hydra.job.chdir=True`, so those four recipes silently stopped chdir'ing
into their run directory -- the regression this PR avoids everywhere else by
adding an explicit `hydra.job.chdir: true`.

Their configs already declare a `hydra:` block (`run.dir` / `sweep.dir`), so
`job.chdir` goes inside it rather than being appended as a second top-level
`hydra:` key.

Also aligns docs/requirements.txt with the `hydra-core>=1.3,<1.4` bound already
applied to the `dev` and `utils` extras in pyproject.toml.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vmoens
vmoens force-pushed the compat/hydra-14-version-base branch from 6373ab5 to b77dac5 Compare August 8, 2026 07:55
@vmoens
vmoens merged commit d7659c7 into pytorch:main Aug 8, 2026
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/olddeps Run the tests-olddeps suite (oldest supported torch) on this PR CI Has to do with CI setup (e.g. wheels & builds, tests...) CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Documentation Improvements or additions to documentation Examples sota-implementations/ versioning Versioning change (version number etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants