Member-only story
Hacking Google Coral Edge TPU: motion blur and Lanczos resize
Google’s Coral project has recently gone out of beta. According to the benchmarks, Coral devices provide excellent neural network inference acceleration for DIY makers. Those devices ground on the specialized Tensor Processing Unit ASIC (Edge TPU), which proved to be somewhat tricky to work with, but the enforced limitations and quirks are rewarding. I was eager to explore the deep internals of the interoperation between TensorFlow and Edge TPU, and to hack both to do cool, nonstandard, crazy things.
The following expects that you are familiar with TensorFlow and Edge TPU basics. The official documentation is good, so looking through TensorFlow models on the Edge TPU and Edge TPU Compiler should be enough to proceed. Repeating my experiments requires Ubuntu Linux and an external Coral USB Accelerator.
First of all, the Edge TPU software is not fully open source. The most “tasty” bits,edgetpu_compiler
executable andlibedgetpu.so
shared library are proprietary. This fact increases the potential hacking complexity but also makes it more fun! For example, the only way to see which APIs are exposed by libedgetpu.so
is to dump the exported symbols with objdump
:
$ objdump -TCj .text /usr/lib/x86_64-linux-gnu/libedgetpu.so.1/usr/lib/x86_64-linux-gnu/libedgetpu.so.1…