Adding backend plugin

216 views
Skip to first unread message

TML

unread,
Nov 30, 2018, 2:10:23 PM11/30/18
to XLA development
Hi All,

We are looking to make a backend for our accelerator using XLA. 

This question is more of a set up question rather then a theoretical question. To add a new plugin, so far I made a new folder in the compiler/plugin dir for my backend and copied all the files from the compiler/xla/service/cpu (as a starting point). I am no so familiar with bazel (I come from a hardware design background) so I was wondering if anyone has integrated a new backend to XLA and would give me some pointers on which BUILD files to touch so that I can integrate my plugin to XLA. 

Thanks,

Bjarke Roune

unread,
Dec 2, 2018, 10:01:19 PM12/2/18
to XLA development
This is a little hard to answer in general. You might start by taking one of the XLA CPU tests, note how it pulls in the CPU backend in Bazel and then put in your backend instead.

Kay Zhu

unread,
Dec 3, 2018, 2:35:15 PM12/3/18
to Bjarke Roune, xla...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "XLA development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xla-dev+u...@googlegroups.com.
To post to this group, send email to xla...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xla-dev/e55098f9-ca2c-4589-8f3f-367b6078b6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Kay Zhu | SWE | kay...@google.com | 650-919-3795

TML

unread,
Dec 5, 2018, 4:35:36 PM12/5/18
to XLA development
Thank you Kay! 

Really helpfull, was able to integrate and build. Plus learned a whole lot about Bazel. 

TML

unread,
Dec 5, 2018, 4:59:04 PM12/5/18
to XLA development
In case anyone wants to check it they have successfully added the device:

python -c 'import tensorflow as tf; from tensorflow.python.client import device_lib;  print(tf.__version__); print (device_lib.list_local_devices()); '
Reply all
Reply to author
Forward
0 new messages