[Test] Add off-policy data-parallel learning suite - #4026
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4026
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit f0888fd with merge base f2a2337 ( BROKEN TRUNK - The following job 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. |
|
I reviewed the current PR head f0888fd, including the latest DDPG exploration-policy publication changes. The two TestDDPGTrainer cases and test_ddpg_trainer_config pass locally, and both new SOTA scripts compile. I could not run Hydra composition or the Ray workload because Ray is unavailable in this environment. The required rebase is currently blocked: replaying f0888fd onto the freshly fetched origin/main produces a content conflict in torchrl/trainers/algorithms/configs/trainers.py, so no force-push was attempted and the PR remains conflicting. The DDPG additions themselves follow the existing TD3 execution-weight structure, but this cannot be considered ready until that config conflict is resolved and the distributed profiles are revalidated on the rebased tree. |
What
Adds
sota-implementations/offpolicy-dp/, a Hydra-configured distributed suite for DQN, SAC, DDPG, and TD3 using the merged data-parallel Trainer and flexible transport APIs.The suite includes:
[B, T]to[B * T]before replay insertionDDPG now accepts an optional
exploration_moduleinDDPGTrainerandDDPGTrainerConfig. Local and Ray execution publish weights with the sameactor + explorationstructure used by the collector, while the loss and evaluator continue to use the deterministic actor. The SOTA DDPG configuration applies fixed Gaussian action noise with standard deviation 0.2.Experiment design
Random-only collection is disabled in these profiles. SAC is stochastic, TD3 and DDPG use persistent Gaussian action noise, and DQN begins with epsilon equal to one. Learner startup is separated from action selection: scale runs collect ten million stochastic-policy transitions before the first optimization step instead of requesting a distributed random-action warmup against the shared replay counter.
The scale defaults are a starting point for the next allocation:
A full 1,000-step prefill trajectory from every environment would require 100 million transitions before learning begins. The shorter stochastic prefill targets early terminations while exploration continues throughout the run. Humanoid retains
frame_skip=1for batched solver stability and therefore is not directly comparable to the standard five-substep benchmark.Why
The distributed components need an end-to-end workload that exercises collection, replay transport, multi-rank learning, policy synchronization, numerical health, and shutdown together. DDPG collection must remain stochastic after replay prefill; publishing only its deterministic actor can optimize losses without improving behavior. Separating replay fill from random-only action selection also avoids per-collector warmup thresholds being compared with a shared replay write count.
Validation
python3 -m py_compile torchrl/trainers/algorithms/ddpg.py torchrl/trainers/algorithms/configs/trainers.py sota-implementations/offpolicy-dp/train.py sota-implementations/offpolicy-dp/run_suite.py test/test_trainer.py test/test_configs.pypre-commit run --files <changed files>python -m pytest test/test_trainer.py test/test_configs.py -k 'TestDDPGTrainer or test_ddpg_trainer_config' -q— 3 passedThe earlier runs below validate transport, replay accounting, flat sampled batches, policy publication, numerical finiteness, and shutdown. They predate the learning-scale redesign and should not be interpreted as successful learning curves. The redesigned 200-million-transition profiles have not been run because the original allocation has ended.
Related stacks: #4005 and #3958.