Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a new device in TensorFlow

Tags:

tensorflow

xpu

In TensorFlow, a Session places the graph ops onto Devices, such as CPUs or GPUs, and provides methods to execute them. Is it possible to add an additional class of devices to TensorFlow? Let's call it XPU in addition to CPU and GPU?

like image 946
GDG Avatar asked Feb 04 '16 22:02

GDG


People also ask

How do I select a device in TensorFlow?

If you would like TensorFlow to automatically choose an existing and supported device to run the operations in case the specified one doesn't exist, you can call tf. config. set_soft_device_placement(True) .


1 Answers

It is possible to add new device types to TensorFlow, although we don't have great documentation. Approximately, it would require adding a new implementation of tensorflow::Device, adding a corresponding implementation of tensorflow::DeviceFactory, and invoking the following registration macro:

REGISTER_LOCAL_DEVICE_FACTORY("XPU", MyXPUDeviceFactory);
like image 52
mrry Avatar answered Sep 20 '22 00:09

mrry