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

auto data sync between different devices #6549

Closed
jacquesqiao opened this issue Dec 13, 2017 · 4 comments · Fixed by #6720
Closed

auto data sync between different devices #6549

jacquesqiao opened this issue Dec 13, 2017 · 4 comments · Fixed by #6720

Comments

@jacquesqiao
Copy link
Member

jacquesqiao commented Dec 13, 2017

project: #6403
In a sequence of operators, when some of them run on GPU, some can only run on CPU, we need to auto add some operators to copy host memory and device memory, so the whole graph can run in a multi devices environment.

some problem

  1. now we use name to get var in scope, and data on different devices should have different names, if we add some operator to sync data between different devices, we should change the input name of corresponding operators.
@jacquesqiao
Copy link
Member Author

jacquesqiao commented Dec 13, 2017

after discussion, there are several ways to implement this:

  1. auto copy data in OperatorWithKernel::Run() according to device.
  2. auto copy data in Tensor::data(const Device& device);
  3. add some op to copy data(not a good way).
  4. use CUDA Unified Memory.(https://devblogs.nvidia.com/parallelforall/unified-memory-in-cuda-6/)

so I will do a survey on CUDA Unified Memory first.(#6549)

@tensor-tang
Copy link
Contributor

tensor-tang commented Dec 13, 2017

I think it's important and it should not only be copy itself.

This sync mechanism should contain many kinds of conversions through devices, like CPUPlace, GPUPlace, and maybe MKLDNN, FPGA later.

I hope it can reserve a interface to let developers implement this sync between different Place.

@jacquesqiao
Copy link
Member Author

@tensor-tang cool, that is a good suggestion!

@luotao1
Copy link
Contributor

luotao1 commented Dec 13, 2017

The memory of MKLDNN is different from Paddle, and you can refer to /~https://github.com/PaddlePaddle/Paddle/tree/develop/doc/design/mkldnn#layers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants