Member-only story

Hacking Google Coral Edge TPU: motion blur and Lanczos resize

Vadim Markovtsev
Towards Data Science
11 min readNov 28, 2019

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…

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Vadim Markovtsev
Vadim Markovtsev

Written by Vadim Markovtsev

Machine learning and software engineer. Development teams manager. Public speaker. Google Developer Expert in Machine Learning (2018–2021).

No responses yet