[BugFix] Decode DreamerV3 rewards and values end to end - #4066
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4066
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 54337d9 with merge base d5a62cb ( BROKEN TRUNK - The following jobs failed but were 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. |
|
Update after the stack-level ghstack rebase: The full eight-PR Dreamer stack was checked out from #4075, rebased onto current Reviewed published head Within the published patch, the separation of categorical logits from decoded reward/value keys is coherent: the loss reads the configurable logits keys, the legacy fallback has an explicit v0.16 deprecation, nested-key coverage is present, and imagination shares the trained prior/reward head instead of independent parameters. I did not find an additional code defect in this layer. The four new focused tests (decoded critic value, legacy warning, nested logits keys, and shared imagination parameters) pass, and Residual risk: this head is still based on the pre-rebase stack, so it has not been validated against current |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
|
Addressed the review pass and resubmitted this commit after rebasing the stack onto current main. No layer-specific code change was needed; the categorical logits remain separated from decoded reward/value scalars and the shared imagination heads are preserved. The full all-files lint suite passes at this PR boundary. |
Summary: - add configurable reward_logits and value_logits NestedKeys while reserving reward and value keys for decoded scalars - preserve legacy logits-under-scalar-key inputs with v0.16 deprecation warnings - expose categorical critic logits and decoded values to lambda returns - share the trained prior and categorical reward head with imagination - configure the maintained DreamerV3 example for 255-bin reward and value cross entropy Rationale: Training consumes categorical logits, whereas environment rewards, critic baselines, and TD-lambda returns require decoded scalars. Separating these representations prevents logits from leaking into return computation, and sharing the trained heads ensures imagination reflects the optimized world model. Test plan: - uv run pytest -q test/objectives/test_dreamer_v3.py - run the maintained DreamerV3 SOTA smoke with 11-bin CI overrides - flake8 --config=setup.cfg on the changed Python files - ufmt check on the changed Python files - git diff --check ghstack-source-id: 8408563 Pull-Request: #4066
Stack from ghstack (oldest at bottom):
Summary:
Rationale:
Training consumes categorical logits, whereas environment rewards, critic baselines, and TD-lambda returns require decoded scalars. Separating these representations prevents logits from leaking into return computation, and sharing the trained heads ensures imagination reflects the optimized world model.
Test plan: