Live data from Hacker News

Halide, a language for image processing and computational photography

halide-lang.org

21–30 of 37 posts

Re: Halide, a language for image processing and computational photography

#21
post #6

As a computer vision researcher, this looks very interesting, although somehow I have yet to understand how they want to generalize highly complicated optimization patterns (access order, locality, pipelines, platform limitations ...), especially since some algorithms (other than the shown blur filter) require quite complicated access patterns on the image data and can only be hand optimized most of the time (that do…

Since this is a language and a compiler, my guess would be the answer to your question is: the compiler will optimize for the underlying platform. The whole point of Halide is stated in their abstract: "... make it easier to write high-performance image processing code" which is the exact opposite of "hand optimization". Halide allows developers to express what to do in a powerful, domain specific language - the comp…

The paper was specifically about hand doing your schedules, not the compiler doing them automagically, which is a huge pipe dream at any rate. For the programs in the class, you are looking at a few orders of magnitude in perf differences for different schedules, which is why the programmer needs control so they can be guaranteed the performance they are expecting. Compilers only reliably optimize at the few percentage point nice to have level.

Re: Halide, a language for image processing and computational photography

#22
post #4
post #3

Really cool name. In rare case someone does not get it: http://en.wikipedia.org/wiki/Silver_halide

By coincidence, "Halide" also happens to be a Turkish female name.

I thought the creators were turkish for a few seconds.

Here's the most famous Halide in Turkey: http://en.wikipedia.org/wiki/Halide_Edip_Ad%C4%B1var

Re: Halide, a language for image processing and computational photography

#23
As usual, the Unix Room at Bell Labs already had a go at this. It was called Pico and is from 10th Ed. Unix. 1984

I have the print version of book in my collection. It is interesting.

http://spinroot.com/pico/

http://spinroot.com/pico/tutorial.pdf

http://spinroot.com/pico/atttj.pdf

Re: Halide, a language for image processing and computational photography

#25

As usual, the Unix Room at Bell Labs already had a go at this. It was called Pico and is from 10th Ed. Unix. 1984 I have the print version of book in my collection. It is interesting. http://spinroot.com/pico/ http://spinroot.com/pico/tutorial.pdf http://spinroot.com/pico/atttj.pdf

It looks like they indeed also had a DSL for image processing. Despite what the Halide presentation may be emphasizing, its novelty is not so much in the DSL than the superoptimizer that comes with it, though.

Now, superoptimization is not a particularly new topic either (see e.g. [1]), but Halide demonstrated that improvements can be significant in this domain. Far more impressive than, e.g., superoptimization applied to generic assembly code (hasn't really worked so far), query optimization, etc.

[1] http://blog.regehr.org/archives/923

Re: Halide, a language for image processing and computational photography

#26
post #8

Earlier quoted context omitted.

Slightly different pronunciation though I think.

Actually, I think the pronunciation is quite different.

Indeed. The Turkish name is pronounced similarly to "holly duh" and the chemical is pronounced "hay lied".

Re: Halide, a language for image processing and computational photography

#28
post #9

I might be a stickler here, but this strikes me as a good example of a "domain-specific language" rather than of a general programming language. Now, it's certainly possible to nail general-purpose programming features onto a DSL (e.g. matlab or R), but the approach (also used by Halide) to embed the DSL into a general-purpose language that allows you to do so (here:C++) is, in my eyes, vastly better suited for scali…

They don't advertise it as a general programming language. The end of the video they specifically state it only works with optimizing algorithms that deal with images. General stuff like trees, they have no application towards.

Re: Halide, a language for image processing and computational photography

#29

We evaluated this some time ago in the company I used to work but it doesn't have intel compiler nor ms compiler support so it was an instant no go. Anyway it is an interesting idea.

You should reevaluate; I'm using it with MSVC right now.

Re: Halide, a language for image processing and computational photography

#30

We evaluated this some time ago in the company I used to work but it doesn't have intel compiler nor ms compiler support so it was an instant no go. Anyway it is an interesting idea.

You should be able to link generated Halide code(1) with either compiler. (Using Halide generated code does not impose much at all in the way of requirements other than C-level ABI compatibility and basic library support.)

A fair bit of work has recently been done on making Halide work well on the Windows platform. We are erring toward requiring newer versions of Visual Studio however. (E.g. there are advantages on being able to rely on C++11 support for generating Halide code.)

I do not see any issues filed on things not working with Intel's compiler. Feel free to file one. Halide is an open source project and both bug reports and patches help a great deal.

(1) Halide can operate as either a Just In Time (JIT) compiler or an Ahead Of Time (AOT) compiler. Generally AOT is much more convenient for deploying in production. The end result of of compiling a single filter in Halide is an object file and a header file a single C-linkage function with all of its parameters passed in on the call. The minimal runtime is included in the object file and dependencies on libraries are also quite minimal, things like libc and pthreads. Functionality provided by the runtime can easily be overridden by providing one's own definitions for various functions, as weak linkage is used.

There is also a set of Python bindings, which can be used to write Halide code which is then AOT compiled. The AOT compiled object file can be linked into pretty much anything that can handle C functions either via direct linkage or a foreign function interface.

Post reply on HN