Content deleted Content added
m Dating maintenance tags: {{Unreviewed}} |
Citation bot (talk | contribs) Alter: title, template type. Add: chapter-url-access, chapter-url, chapter, authors 1-1. Removed or converted URL. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Headbomb | #UCB_toolbar |
||
(49 intermediate revisions by 33 users not shown) | |||
Line 1:
{{Short description|Computer programming language designed for digital image processing}}
'''Halide (programming language)'''▼
{{Infobox programming language
| name
| logo
| logo caption
| paradigms = [[Functional programming|functional]], [[Parallel programming model|parallel]]
| developer = [[Massachusetts Institute of
| released = {{Start date and age|2012}}
▲| designer = Jonathan Ragan-Kelley and Andrew Adams
| latest release version =
▲| developer = [[MIT]], (with help from [[Stanford]] and [[Adobe]])
| latest release date =
| latest test version =
| latest test date =
| typing = [[Static typing|static]]
▲| implementations =
| programming language = [[C++]]
▲| dialects =
| operating system = [[macOS]], mainstream [[Linux]] distributions, [[Windows]]
| file ext =
| influenced = ▼
| license = [[MIT License]]
▲| website = http://halide-lang.org/
| influenced =
▲| wikibooks =
}}
{{Portal|Free and open-source software}}
'''Halide''' is a computer [[programming language]] designed for writing [[digital image processing]] code that takes advantage of [[memory locality]], [[Array programming|vectorized computation]] and multi-core [[central processing unit]]s (CPU) and [[graphics processing unit]]s (GPU). Halide is implemented as an internal [[___domain-specific language]] (DSL) in [[C++]]. Halide was announced by MIT in 2012<ref>{{Cite web |last=Hardesty |first=Larry |date=2012-08-02 |title=Writing graphics software gets much easier |url=https://news.mit.edu/2012/better-programming-language-for-image-processing-0802 |access-date=2025-06-30 |website=MIT News {{!}} Massachusetts Institute of Technology |language=en}}</ref> and released in 2013.<ref>{{Cite book |last1=Ragan-Kelley |first1=Jonathan |last2=Barnes |first2=Connelly |last3=Adams |first3=Andrew |last4=Paris |first4=Sylvain |last5=Durand |first5=Frédo |last6=Amarasinghe |first6=Saman |chapter=Halide: A language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines |date=2013-06-16 |title=Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation |chapter-url=https://dl.acm.org/doi/10.1145/2491956.2462176 |series=PLDI '13 |___location=New York, NY, USA |publisher=Association for Computing Machinery |pages=519–530 |doi=10.1145/2491956.2462176 |isbn=978-1-4503-2014-6|chapter-url-access=subscription }}</ref>
==Purpose==
The main innovation Halide brings is the separation of the [[algorithm]] being implemented from its [[scheduling (computing)|execution schedule]], i.e. code specifying the [[loop (computing)|loop]] [[nesting (computing)|nesting]], [[parallelization]], [[loop unrolling]] and [[vector processor|vector instruction]].<ref>{{Cite journal |last1=Ragan-Kelley |first1=Jonathan |last2=Adams |first2=Andrew |last3=Sharlet |first3=Dillon |last4=Barnes |first4=Connelly |last5=Paris |first5=Sylvain |last6=Levoy |first6=Marc |last7=Amarasinghe |first7=Saman |last8=Durand |first8=Frédo |date=2017-12-27 |title=Halide: decoupling algorithms from schedules for high-performance image processing |url=https://dl.acm.org/doi/10.1145/3150211 |journal=Commun. ACM |volume=61 |issue=1 |pages=106–115 |doi=10.1145/3150211 |issn=0001-0782}}</ref> These two are usually interleaved together and experimenting with changing the schedule requires the programmer to rewrite large portions of the algorithm with every change.<ref>{{Cite web |last=Hinkel |first=Lauren |date=2024-05-03 |title=Creating bespoke programming languages for efficient visual AI systems |url=https://news.mit.edu/2024/creating-bespoke-programming-languages-efficient-visual-ai-systems-0503 |access-date=2025-06-30 |website=MIT News {{!}} Massachusetts Institute of Technology |language=en |quote=Ragan-Kelley notes that programmers can opt for “very painstaking, very unproductive, and very unsafe low-level code,” which could introduce bugs, or “more safe, more productive, higher-level programming interfaces,” that lack the ability to make fine adjustments in a compiler about how the program is run, and usually deliver lower performance. So, his team is trying to find a middle ground. “We're trying to figure out how to provide control for the key issues that human performance engineers want to be able to control,” says Ragan-Kelley, “so, we're trying to build a new class of languages that we call user-schedulable languages that give safer and higher-level handles to control what the compiler does or control how the program is optimized.”}}</ref> With Halide, changing the schedule does not require any changes to the algorithm, allowing the programmer to experiment with scheduling.<ref name=":0">{{Cite journal |last1=Adams |first1=Andrew |last2=Ma |first2=Karima |last3=Anderson |first3=Luke |last4=Baghdadi |first4=Riyadh |last5=Li |first5=Tzu-Mao |last6=Gharbi |first6=Michaël |last7=Steiner |first7=Benoit |last8=Johnson |first8=Steven |last9=Fatahalian |first9=Kayvon |last10=Durand |first10=Frédo |last11=Ragan-Kelley |first11=Jonathan |date=2019-07-12 |title=Learning to optimize halide with tree search and random programs |url=https://dl.acm.org/doi/10.1145/3306346.3322967 |journal=ACM Trans. Graph. |volume=38 |issue=4 |pages=121:1–121:12 |doi=10.1145/3306346.3322967 |issn=0730-0301|url-access=subscription }}</ref><ref>{{Cite web |last=Gottschlich |first=Justin |date=22 November 2019 |title=Machine Programming: What Lies Ahead? |url=https://knowledge.wharton.upenn.edu/article/ai-machine-learning/ |access-date=2025-06-30 |website=Knowledge at Wharton |language=en-US}}</ref>
== Scheduled blur function ==
==References==▼
The following function defines and sets the schedule for a 3×3 [[box blur|box filter]] defined as a series of two 3×1 passes, allowing the blur algorithm to remain independent of the execution schedule.<ref name=":1">{{Cite book |last1=Hennessy |first1=John L. |title=Computer architecture: a quantitative approach |last2=Patterson |first2=David A. |date=2019 |publisher=Morgan Kaufmann Publishers |isbn=978-0-12-811905-1 |edition=6th |___location=Cambridge, MA |pages=582}}</ref>
{{Reflist|30em|refs=▼
<syntaxhighlight lang="cpp">
Func blur_3x3(Func input) {
Func blur_x, blur_y;
Var x, y, xi, yi;
// The algorithm - no storage or order
==External links==▼
blur_x(x, y) = (input(x-1, y) + input(x, y) + input(x+1, y))/3;
blur_y(x, y) = (blur_x(x, y-1) + blur_x(x, y) + blur_x(x, y+1))/3;
// The schedule - defines order, locality; implies storage
blur_y.tile(x, y, xi, yi, 256, 32)
.vectorize(xi, 8).parallel(y);
blur_x.compute_at(blur_y, x).vectorize(x, 8);
return blur_y;
}
</syntaxhighlight>
==Uses and development==
Halide was developed primarily at MIT's CSAIL lab. Both Google and Adobe have been involved in Halide research.<ref name=":0" /> Google uses Halide in Pixel 2's [[Pixel Visual Core]].<ref>{{cite web |last=Quach |first=Katyanna |date=22 October 2017 |title=Google and Intel cook AI chips, neural network exchanges – and more |url=https://www.theregister.co.uk/2017/10/22/ai_roundup/ |website=[[The Register]] |publisher=Situation Publishing}}</ref><ref name=":1" /> Adobe Photoshop also uses Halide.<ref>{{Cite web |title=Inside Halide, the open source language engineers use to make imaging tools faster |url=https://research.adobe.com/news/inside-halide-the-open-source-language |access-date=2025-06-30 |website=Adobe Research |language=en-US}}</ref>
== See also ==
* [[Algorithmic skeleton]]
* [[Parallel programming model]]
▲== References ==
▲== External links ==
* {{Official website|halide-lang.org}}
* {{GitHub|halide/Halide}}
[[Category:Image processing]]
[[Category:Functional languages]]
[[Category:Parallel computing]]
|