data icon indicating copy to clipboard operation
data copied to clipboard

[WIP] pin_memory DataPipe and adapter

Open VitalyFedyunin opened this issue 2 years ago • 5 comments

Stack from ghstack (oldest at bottom):

  • -> #485
  • #484

Differential Revision: D36866290

VitalyFedyunin avatar May 31 '22 21:05 VitalyFedyunin

@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

VitalyFedyunin avatar Jun 02 '22 16:06 VitalyFedyunin

@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

VitalyFedyunin avatar Jun 02 '22 20:06 VitalyFedyunin

Looks like pin_memory should be a parameter of ReadingService, otherwise 'pin' gets lost when tensors are moved from child processes to the main training loop.

CC @ejguan

VitalyFedyunin avatar Jul 08 '22 15:07 VitalyFedyunin

Looks like pin_memory should be a parameter of ReadingService, otherwise 'pin' gets lost when tensors are moved from child processes to the main training loop.

CC @ejguan

Do we want to have special DataPipes that can only be iterated on main process (cannot moved to child process)? If so, we might still keep it as an Adapter and use a special DataPipe. FWIW, we might need such feature for DataPipe operations when Tensor is pinned or sent to cuda.

This might depends on the prototype MultiprocessingRS

ejguan avatar Jul 08 '22 16:07 ejguan

Makes total sense to me, I will update MPReadingService to respect such DataPipes as part of this PR.

VitalyFedyunin avatar Jul 08 '22 17:07 VitalyFedyunin

Hi @VitalyFedyunin!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Dec 02 '22 16:12 facebook-github-bot