Skip to content

[BugFix] Match DreamerV3 categorical and KL semantics - #4073

Draft
vmoens wants to merge 1 commit into
gh/vmoens/290/basefrom
gh/vmoens/290/head
Draft

[BugFix] Match DreamerV3 categorical and KL semantics#4073
vmoens wants to merge 1 commit into
gh/vmoens/290/basefrom
gh/vmoens/290/head

Conversation

@vmoens

@vmoens vmoens commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Summary:

  • add configurable categorical unimix to the DreamerV3 prior and posterior
  • add separate dynamics and representation KL terms with aggregated free nats
  • configure the maintained example for 1% unimix and 1.0/0.1 KL weighting

Rationale:
The reference objective mixes categorical probabilities with a uniform
component, sums KL across stochastic variables before applying free nats, and
optimizes stopped-gradient dynamics and representation terms separately. The
previous balanced aggregate used different gradient weights and free-bit
semantics, which prevented numerical and training-curve parity.

Test plan:

  • pytest test/objectives/test_dreamer_v3.py -q
  • pytest test/modules/test_dreamer_components.py -k DreamerV3Components -q
  • pytest --doctest-modules torchrl/objectives/dreamer_v3.py -q
  • run the maintained DreamerV3 SOTA smoke with the worktree virtual environment
  • verify frozen 1% unimix KL values, stopped-gradient routing, aggregated free
    nats, separate loss keys, and end-to-end optimization

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures, 3 Unrelated Failures

As of commit f2a8357 with merge base 2a77e48 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

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

Labels

BugFix 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 Integrations/torch_geometric Integrations Modules Objectives sota-implementations/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant