Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Defaulting passing_devices to None #495

Merged
merged 29 commits into from
Sep 28, 2022
Merged

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Sep 28, 2022

Description

  • The default value of the parameter "passing_device" of the constructor of SyncDataCollect has been changed to None.
  • The code of the constructor of SyncDataCollect has been changed so that if the user does not provide default value of "passing_device", it will have the same device value as the "device" parameter or the device specified inside the "policy" parameter.
  • The default value of the parameter "passing_devices" of the constructor of _MultiDataCollector has been changed to None.
  • The code of the constructor of _MultiDataCollector has been changed so that if the user does not provide default value of "passing_devices", it will have the same device values as the "devices" parameter or the devices specified inside the "policy" parameter.

Motivation and Context

It fixes the open issue #433

Currently, if the user does not specify the "passing_device" or "passing_devices" parameter, the collector class assumes the output data will be stored in the CPU RAM by default. However, this may cause confusion because in the case that the user specifies the model to be run in the GPU via the "policy", "device" or "devices" parameter, he may not aware that the output data will actually be stored in the CPU RAM instead of the GPU RAM. I solve this possible confusion by changing the default RAM location of the output data to be same as the "policy", "device" or "devices" parameter's RAM location, if the user does NOT specify the "passing_device" or "passing_devices" parameter. However, the output RAM location will follow the "passing_device" or "passing_devices" parameter if the user DOES specify.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of examples)

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.

@facebook-github-bot facebook-github-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 Sep 28, 2022
@vmoens vmoens merged commit b08234c into pytorch:main Sep 28, 2022
@himjohntang himjohntang deleted the issue-433 branch September 28, 2022 13:35
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants