Skip to content

Conversation

@Xmaster6y
Copy link
Contributor

Description

Added a storing_device argument to env.rollout to save to a different device, like in collectors.

Motivation and Context

Fix #3177

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

  • New feature (non-breaking change which adds core functionality)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 16, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3199

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 658b219 with merge base 80bfa6e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 16, 2025
Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!
Let's just make sure we don't incur any overhead for other use cases

@Xmaster6y
Copy link
Contributor Author

What overhead? .to(None) does nothing, same for same device tono?

@vmoens
Copy link
Collaborator

vmoens commented Oct 16, 2025

What overhead? .to(None) does nothing, same for same device tono?

A function call is a function call, I'd prefer if we were avoiding any call to to if not necessary (for clarity)

@Xmaster6y
Copy link
Contributor Author

Gotcha!

@vmoens vmoens added the enhancement New feature or request label Oct 16, 2025
Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small nit otherwise lgtm!

@vmoens vmoens merged commit 6c7bf9d into pytorch:main Oct 16, 2025
1 check passed
@Xmaster6y Xmaster6y deleted the storing branch October 16, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] thrl_envs.EnvBase.rollout save to different device

2 participants