Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4335
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8e72d16 with merge base 44c871d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
vmoens
added this pull request to stack #4334
September 11, 2026 19:12
vmoens
force-pushed
the
codex/gtrxl-ppo
branch
from
September 12, 2026 05:52
983c7f7 to
0cabdc9
Compare
vmoens
force-pushed
the
codex/gtrxl-ppo
branch
from
September 12, 2026 05:55
0cabdc9 to
8e72d16
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.
GTrXL PPO needs its pre-window memory to remain aligned with sampled observations without allocating a transformer-memory snapshot for every replayed transition. This adds a runnable hidden-velocity CartPole implementation and transformer tutorial on top of the recurrent-state stack and the merged #4193 API.
Changes
GTrXL, preserving the configurable state container and existing per-step-state path. Add parallel relative attention for compact windows with the same rolling causal horizon, GRU-style gates, episode masks and detached initial memory.TransformerModulepath to accept[B]records containing observations[B,T,F]and one[B]initial state. It returns[B,T,D]features and one final carry. Existing module-owned cache behavior remains unchanged.initial_state.memoryis[B,L,M,D], while the transitions child has batch[B,T]. Existing tensor/memmap storages andSamplerWithoutReplacementselect whole records. Compute advantages before packing; mask padded positions in PPO.Scope and dependencies
Stacked on #4326, which depends on #4325 and #4324. The stack includes the exact merged #4193 commit
a2acf99c7. TensorDict #1766 has merged; #1789 remains a prerequisite. All draft CI installers pin its compiled typed-state compatibility fix at2d252bfae380f150a6136930d7d7a5833d68ecf1. The stack has been rebased onto TorchRL main44c871df8.The container decision remains open:
state_clsis configurable and the example offerstd,tcandttd. No existing GRU/LSTM default changes. The example's TypedTensorDict schema does not finalize a library-wide state class.Compact replay requires whole-window sampling. Arbitrary new offsets require per-step carries, which remain supported by the existing path. Packing currently happens after standard collection, so this saves replay allocation and compact learner state, not the collector's peak memory. Supplied carry survives parameter updates and can be stale, as with recurrent replay.
Validation and measurements
2.15.0.dev20260911, including the previously failing TypedTensorDict compact-window compilation. Compact windows passed eager and fullgraphaot_eagercompilation, float64, bfloat16 and CPU autocast.pre-commit run --all-filesand diff checks passed, including flake8 plugins and Sphinx heading checks.benchmarks/results/gtrxl-learning.mdfor absolute timings and limitations.CUDA execution of the new compact kernel has not been tested locally.