3 ms·
Halide is much more flexible. OpenCV is a fixed high level toolbox, combining things requires lots of intermediate buffers. Halide allows compiling arbitrary ke
by trishume 9y ago
Halide is much more flexible. OpenCV is a fixed high level toolbox, combining things requires lots of intermediate buffers. Halide allows compiling arbitrary kernels in a fused way with extremely good performance. Sure you could implement OpenCV functions using Halide, but better to expose the lower level more flexible API. Source: I’ve rewritten parts of an OpenCV app in Halide for performance.
Also your argument that it’s not about perf makes no sense to me. Sure other phones have HDR, I bet its way slower and more energy intensive than the Pixel 2. Except maybe the iPhone, which may also have custom silicon. If they had custom HDR tech in software they wanted to keep they could just keep the source closed, or patent it.
- sandGorgon 9y agoThat bet is the problem. Tensorflow on mobile already targets GPU and is going to be even more so with XLA. This debate is going to be hearsay unless we have an apples to apples comparison of the base tensorflow code running on the halide ir targeted to the tpu vs a vanilla ARM GPU... Even using opencv. I find it telling that they compared cpu vs tpu... Not GPU vs tpu.
- joshuamorton 9y agoI'm really confused why you keep bringing up opencv. What does opencv have to do with the (presumably) TF ML model running on the IPU that you want to benchmark against the TF ML model running on a GPU?
- sandGorgon 9y agoBecause halide is positioned as a high performance improvement over opencv. While I believe it is just an architectural decision to enable a non-portable ML model.
- joshuamorton 9y agoWhere did I mention halide? My question is why do you care about opencv when benchmarking neural network performance on various hardware?
- trishume 9y agoBut Halide does have higher performance, is portable to many platforms as well as GPUs, CPUs (w/ parallel SIMD), and isn’t used for ML models...
- trishume 9y agoI think you’re confusing two separate things. There’s two separate approaches to a computer vision task: classical and deep learning. Halide and OpenCV are for classical approaches, TensorFlow is for deep learning. People don’t use both for the same problem, nobody is using “tensorflow code running on the halide ir”. Both approaches use a lot of basic operations applied to matrices, so the custom ASIC supports either, but separately. HDR sounds like a better fit for a classical approach, so their HDR filter is probably written in Halide, with no machine learning or TensorFlow anywhere.