Repository navigation
[Algorithm] Transitive RL training script on OGBench - #4598
Merged
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4598
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2fdccb0 with merge base 53b10df ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
6 of 7 tasks
6 of 7 tasks
6 of 8 tasks
theap06
added this pull request to stack #4599
October 20, 2026 23:44
sota-implementations/transitive_rl trains TransitiveQLoss on OGBench goal-conditioned datasets with SubgoalTriplet sampling, following the reference implementation's hyperparameters (512x3 MLPs, batch 1024, discount 0.99, expectile 0.7, oracle distillation, rpg actor). dataset.name=null runs a small Pendulum smoke mode used by the SOTA CI entry; compile.compile and compile.cudagraphs enable the compiled update. Logging can be disabled with logger.backend=null. Adds the sota-check job and the test_sota smoke command.
…on budget, per-dataset settings - compile and CUDA graphs are on by default, the setup the reported results and sota-check use. CUDA graphs (and the capturable Adam they need) apply only on a CUDA device, so device=cpu runs compiled without them; the CPU smoke test turns both off. - evaluation.num_tasks and evaluation.max_steps default to null and are read from the env (its OGBench evaluation tasks and time limit), as the reference evaluation runs each episode until the env ends it. The former 1000-step cap truncated tasks with longer limits, such as humanoidmaze-medium (2000); scene (750) and cube-single (200) are unaffected. - The module docstring lists the reference's per-dataset distance_weight, alpha and discount (aoberai/trl hyperparameters.sh): cube-single uses distance_weight 0.7, not the scene default of 1.0.
… env OGBench reports an evaluation episode's goal only in the reset info, and the policy reads it at every step, so the wrapper keeps it as an observation for the whole episode.
theap06
force-pushed
the
transitive-rl/recipe
branch
from
October 21, 2026 09:27
7374cea to
2fdccb0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part 3 of 3 of the Transitive RL stack, which replaces #4579. Based on part 2; review only the top commit.
Stack (merge in order):
Adds
sota-implementations/transitive_rl/, which trainsTransitiveQLoss(part 2) on OGBench goal-conditioned datasets withSubgoalTripletsampling (part 1). Transitive RL is from Park, Oberai, Atreya, Levine, "Transitive RL: Value Learning via Divide and Conquer", ICLR 2026, https://arxiv.org/abs/2510.22512.dataset.name=nullruns a small Pendulum smoke mode, used by the newtest_sota.pyentry.evaluation.num_tasksandevaluation.max_stepsdefault to the env's OGBench evaluation tasks and time limit, as the reference evaluation runs each episode until the env ends it.distance_weight,alphaanddiscount(from itshyperparameters.sh);config.yamlholds the scene-play values.logger.backend=nulldisables logging.sota-check/run_transitive_rl.sh, andogbenchto the sota-check setup.Validation against the reference implementation
Reference: the authors' JAX code (github.com/aoberai/trl @ adfec6f249), with the same hyperparameters: 512x3 MLPs, batch 1024, discount 0.99, expectile 0.7, oracle distillation, rpg actor with alpha 1, and distance weight 1.0 (scene) or 0.7 (cube-single).
Numerical parity. On a fixed batch with identical weights, in float64, the critic, oracle and actor losses match to 1e-16 relative error, and the gradient norms to 2e-7. The compiled + CUDA-graph update matches eager after 60 steps (2e-6 on the loss, 2e-7 on parameters).
Success rates. 1M gradient steps, 2 seeds. The score is the OGBench final score: per-seed mean of the 800k, 900k and 1M evaluations, each over 15 episodes x 5 tasks.
cube-single-play-oraclerep-v0scene-play-oraclerep-v0Both implementations land within seed spread of the paper, and of each other.
The success rates were measured on an earlier revision of this code (#4579 at 1f2ca7a). The later commits are review fixes. On the final code the losses still match the reference (2e-7) and a compiled OGBench run logs identical losses, but I did not retrain. The changes since do not affect these numbers: the recipe samples anchors uniformly (the priority-index fix only matters for prioritized buffers),
q_min/q_maxare logged metadata, scene and cube-single end episodes at 750 and 200 steps (below the former 1000-step evaluation cap), and the runs were already compiled with CUDA graphs.Throughput (A100-SXM4-40GB, scene-play shapes, batch 1024, it/s of sample + update):
compile+CudaGraphModulemax-autotune+CudaGraphModuleAt these model sizes, eager mode is bound by Python overhead and kernel launches.
Known differences and follow-ups
Motivation and Context
Transitive RL is a recent offline goal-conditioned method with strong OGBench results. This PR adds the runnable recipe and the reference comparison for the building blocks added in parts 1 and 2.
Types of changes
Checklist