Repository navigation
[BugFix] Update replay priorities when the Trainer has an optimization stepper - #4716
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4716
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 3 New Failures, 1 Unrelated FailureAs of commit 95cd7e4 with merge base a711ef9 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Thanks for running CI, @theap06! The bot lists the three Python 3.10 jobs as new, but they fail at the torchrl build step (IndexError in cpp_extension.py), which also fails on main (e.g. a68419e). tests-gpu (3.12, 13.0, 2) failed on an NVIDIA package download before any test ran. Could you re-run that one when you have a moment? |
I think that this missed the tests-cpu matrix, which still has 3.10 and installs nightly torch. We are currently migrating to the set the lower dep for python for 3.11. As for this PR, everything LGTM! |
Description
Fixes #4715. With an
optimization_stepper,Trainer.optim_stepsskipped thepost_lossops, which is whereReplayBufferTrainerupdates replay priorities.CQLTraineralways uses a stepper, so a prioritized buffer kept its initial priorities.The stepper branch now runs the
post_lossops afteroptimization_stepper.step(...), unless the stepper setsupdates_replay_priority(asTD3OptimizationStepperdoes). This is the rule the Ray backend already uses. Among the built-in trainers onlyCQLTraineris affected: GRPO, TD3 and TD-MPC2 register nopost_lossops.Motivation and Context
Types of changes
Checklist
I used an AI assistant (Claude Code) to help find the bug and run the checks. I've read and tested every changed line.