This separation also makes it much easier to separately maintain the algorithm and schedule. As programmers, we still need to define how the algorithm should be executed - but defining these strategies much easier to write, test and maintain.
Halide enables us to write simpler high performance code by separating the algorithm of an image processing pipeline from how to efficiently run it on a certain machine. So the need was to have a way to achieve high performance while retaining portability, simplicity and maintainability of the code. This will overall cost the teams much more engineering-hours than standard approaches.
Maintainability: If the team needs to update the algorithms, they need to pay the cost of several modifications and sometimes even down to - how the loops are structured to achieve best performance.Realistically, such domain knowledge is often rare. Simplicity: This requires the engineers in the team to have strong domain knowledge - to both build and maintain these algorithms across different implementations.One that leverages the set of intrinsic, supported for that CPU type.
To achieve best performance on a different CPU type (example 32 bit architecture), we need to write another implementation of similar nature.
If we have to run a simple brightening operation like Even at a smaller resolution like 13MP, an image has ~13,000,000 pixels. Certain Android devices are now shipping with as large as 108 Mega Pixels cameras. These days mobile devices have fairly large image sensors. Let’s take the example of computational photography algorithms. But, so has the scale of the problem statements we are dealing with. Modern hardware has become significantly powerful over time. Need: Why should I care about yet another programming language? Scale: Let’s look at the scale first Important Disclaimer: Any opinion called out in this article are my own and don’t reflect opinion or stance of the organizations I work with. Migrating to Halide from Open CV helped us significantly improve performance of some of these algorithms on the arm chipsets that power most of Android devices. I work on Camera from Google at Google and we use Halide language extensively for implementing our features like HDR or Night Mode. Captured with Camera from Google on a low end Android device. įigure: HDR image (left) & standard image (right). Beyond that, Halide pipelines are run at scale within Google Photos, Youtube and elsewhere. Halide is used very often in Google, for example in the famous HDR+ algorithm that powers the camera app on the flagship Pixel devices. You can then compile this representation to an object file, or JIT-compile it and run it in the same process. This means you write C++ code that builds an in-memory representation of a Halide pipeline using Halide’s C++ API. Rather than being a standalone programming language, Halide is embedded in C++. Diff compute APIs like CUDA, OpenCL, OpenGL, etc.Halide is an open-source programming language designed to make it easier to write and maintain high-performance image processing or array processing code on modern machines. Need: Why should I care about yet another programming language?.