[Performance] Improve geometric window sampling - #4131
Open
theap06 wants to merge 4 commits into
Open
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4131
Note: Links to docs will display an error until the docs builds have been completed.
|
Collaborator
Author
|
@torchrlbot reviewer @vmoens |
Contributor
vmoens
force-pushed
the
codex/geometric-trajectory-sampler
branch
from
August 20, 2026 19:57
bcef2bc to
db7910c
Compare
vmoens
force-pushed
the
codex/geometric-window-performance
branch
from
August 20, 2026 20:03
773f215 to
42df30e
Compare
vmoens
force-pushed
the
codex/geometric-trajectory-sampler
branch
7 times, most recently
from
August 28, 2026 15:14
ecc02ea to
70f29d2
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.
Summary
Performance
The offset benchmark is flat at roughly 8.5 microseconds for
max_future=32andmax_future=4096on CPU. In a local comparison including the maximum-availability reduction over 100,000 slots, the previous weight-vector draw took 20.0 and 72.3 microseconds respectively; the inverse-CDF draw took 19.9 microseconds in both cases.Steady-state MPS profiling reports no
item,_local_scalar_dense, ornonzerooperations, and the sampled tensors remain on the storage device. Total sampling still includes an anchor-weight scan and fixed-size window construction, so this PR only makes the geometric offset draw constant-time.Validation
torch.compile(..., fullgraph=True)Stacked on #4130.