Halide (programming language): Difference between revisions

Content deleted Content added
Halide supports current and recent versions of Mac OS, not any particular fixed versions.
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
 
(13 intermediate revisions by 7 users not shown)
Line 1:
{{Short description|Computer programming language designed for digital image processing}}
{{more citations needed|date=March 2018}}
{{Infobox programming language
| name = Halide
| logo =
| logo caption =
| paradigm paradigms = [[Functional programming|functional]], [[Parallel programming model|parallel]]
| file_ext =
| designer = Jonathan Ragan-Kelley and <br/>Andrew Adams
| paradigm = [[Functional programming|functional]], [[Parallel programming model|parallel]]
| developer = [[Massachusetts Institute of Technology|MIT]], (with help from [[Stanford University|Stanford]], [[Google]], and [[Adobe Systems|Adobe]])
| year = 2012
| released = {{Start date and age|2012}}
| designer = Jonathan Ragan-Kelley and Andrew Adams
| latest release version =
| developer = [[Massachusetts Institute of Technology|MIT]], (with help from [[Stanford University|Stanford]], [[Google]], and [[Adobe Systems|Adobe]])
| latest release date =
| latest_release_version =
| latest test version =
| latest_release_date =
| latest test date =
| latest_test_version =
| typing = [[Static typing|static]]
| latest_test_date =
| implementations =
| typing = [[Static typing|static]]
| dialects =
| implementations =
| programming language = [[C++]]
| dialects =
| operating_system operating system = Mac OS[[macOS]], mainstream [[Linux]] distributions, [[Windows]]
| influenced_by =
| file ext =
| influenced =
| programming_language license = [[C++MIT License]]
| website = http://{{URL|halide-lang.org/}}
| operating_system = Mac OS, mainstream Linux distributions, Windows
| wikibooks =
| license =
| influenced by =
| 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 [[CPU]]s and [[GPU]]s.<ref name="refsite1">{{cite web |url=http://www.i-programmer.info/news/192-photography-a-imaging/4588-halide-new-language-for-image-processing.html | title=Halide - New Language For Image Processing |year=2012 |accessdate=20 September 2013}}</ref> Halide is implemented as an internal [[___domain-specific language]] (DSL) in [[C++]].
'''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>
 
==LanguagePurpose==
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>
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]]. 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. With Halide, changing the schedule does not require any changes to the algorithm and this allows the programmer to experiment with scheduling and finding the most efficient one.
 
== SampleScheduled sourceblur codefunction ==
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>
<syntaxhighlight lang="cpp">
Func blur_3x3(Func input) {
Line 49 ⟶ 50:
</syntaxhighlight>
 
==Uses and development==
==Use==
Halide was developed primarily at MIT's CSAIL lab. Both Google usedand Adobe have been involved in Halide andresearch.<ref [[TensorFlow]]name=":0" for/> itsGoogle uses Halide in Pixel 2's [[Pixel Visual Core]].<ref>{{cite web |urllast=https://www.theregister.co.uk/Quach |first=Katyanna |date=22 October 2017/10/22/ai_roundup/ |title=Google and Intel cook AI chips, neural network exchanges – and more |publisherurl=Situationhttps://www.theregister.co.uk/2017/10/22/ai_roundup/ Publishing|website=[[The Register]] |publisher=Situation Publishing}}</ref><ref name=":1" /> Adobe Photoshop also uses Halide.<ref>{{citeCite web |url=https://community.adobe.com/t5/photoshop/photoshop-freezing-at-startup-on-halide-bottlenecks/td-p/11085284?page=1 | title=Photoshop freezing at startup onInside Halide, Bottlenecksthe |year=2020open |accessdate=27source Aprillanguage 2020}}</ref>engineers Bothuse Googleto andmake Adobeimaging havetools been involved in Halide research.<ref>{{cite webfaster |url=https://halide-langresearch.orgadobe.com/papersnews/halide_autoscheduler_2019.pdfinside-halide-the-open-source-language | titleaccess-date=Learning to Optimize Halide with Tree Search and Random Programs2025-06-30 |yearwebsite=2019Adobe Research |accessdatelanguage=1 July 2019en-US}}</ref>
 
== See also ==
Line 61 ⟶ 62:
 
== External links ==
* [http://halide-lang.org/{{Official http://website|halide-lang.org/]}}
* {{GitHub|halide/Halide}}
* [http://people.csail.mit.edu/jrk/halide12 Decoupling Algorithms from Schedules for Easy Optimization of Image Processing Pipelines]
* {{cite web|url= http://people.csail.mit.edu/jrk/halide-pldi13.pdf |title=Halide: A Language and Compiler for Optimizing Parallelism, Locality, and Recomputation in Image Processing Pipelines }}&nbsp;{{small|(8,259&nbsp;KB)}}
 
[[Category:Image processing]]