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

Should we add device field in our framwork.proto #6035

Closed
QiJune opened this issue Nov 29, 2017 · 3 comments
Closed

Should we add device field in our framwork.proto #6035

QiJune opened this issue Nov 29, 2017 · 3 comments

Comments

@QiJune
Copy link
Member

QiJune commented Nov 29, 2017

Our neural network topology will be serialized to ProgramDesc. And we hope that this ProgramDesc can be transpose to different hardware environments, such as single CPU/GPU, multi-GPUs, or multi-nodes.

However, we should also expose device configuration to users. Following is an example:

with paddle.device("CPU"):
   a = layers.data()
   b = layers.data()
   c = layers.sum(a, b)

with paddle.device("GPU"):
   d = layer.tanh(c)

with paddle.device("FPGA"):
   e = layers.softmax(d)

I think that this feature is important, we should provides such interface for users to set device for specific layers.

Then, there comes a question, where to store these device information. At now, there is no device field in framework.proto.

In tensorflow, there is a device field in node_def.proto. In Mxnet, there is a device attribute of graph to store users's device configuration.

If we want to support such feature(user can set device for specific operator), we have to handle these device configuration.
Maybe we should add a device field in framework.proto, or we create another struct to store the device configuration.

@helinwang
Copy link
Contributor

I agree, it's a very useful feature. Maybe we can work out a first version that the user can not do manual placement, but later add this feature?

@tonyyang-svail
Copy link

tonyyang-svail commented Dec 1, 2017

@QiJune Quick question: since all operators know where to run, do we still need the place in Executor's construction?

@QiJune
Copy link
Member Author

QiJune commented Dec 2, 2017

I think that we will have a pool of DeviceContext. What Executor do is to take a DeviceContext from the pool to run the operator under the guide of device in operator.

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

No branches or pull requests

4 participants