{"id":181098,"date":"2016-10-02T13:00:29","date_gmt":"2016-10-02T11:00:29","guid":{"rendered":"http:\/\/mybroadband.co.za\/news\/?p=181098"},"modified":"2016-10-02T14:49:41","modified_gmt":"2016-10-02T12:49:41","slug":"new-programming-language-for-faster-parallel-computing","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/software\/181098-new-programming-language-for-faster-parallel-computing.html","title":{"rendered":"New programming language for faster parallel computing"},"content":{"rendered":"<p>In today\u2019s computer chips, memory management is based on what computer scientists call the principle of locality: If a program needs a chunk of data stored at some memory location, it probably needs the neighboring chunks as well.<\/p>\n<p>But that assumption breaks down in the age of big data, now that computer programs more frequently act on just a few data items scattered arbitrarily across huge data sets. Since fetching data from their main memory banks is the major performance bottleneck in today\u2019s chips, having to fetch it more frequently can dramatically slow program execution.<\/p>\n<p>This week, at the International Conference on Parallel Architectures and Compilation Techniques, researchers from MIT\u2019s Computer Science and Artificial Intelligence Laboratory (CSAIL) are presenting a new programming language, called Milk, that lets application developers manage memory more efficiently in programs that deal with scattered data points in large data sets.<\/p>\n<p>In tests on several common algorithms, programs written in the new language were four times as fast as those written in existing languages. But the researchers believe that further work will yield even larger gains.<\/p>\n<p>The reason that today\u2019s big data sets pose problems for existing memory management techniques, explains Saman Amarasinghe, a professor of electrical engineering and computer science, is not so much that they are large as that they are what computer scientists call \u201csparse.\u201d That is, with big data, the scale of the solution does not necessarily increase proportionally with the scale of the problem.<\/p>\n<p>\u201cIn social settings, we used to look at smaller problems,\u201d Amarasinghe says. \u201cIf you look at the people in this [CSAIL] building, we\u2019re all connected. But if you look at the planet scale, I don\u2019t scale my number of friends. The planet has billions of people, but I still have only hundreds of friends. Suddenly you have a very sparse problem.\u201d<\/p>\n<p>Similarly, Amarasinghe says, an online bookseller with, say, 1,000 customers might like to provide its visitors with a list of its 20 most popular books. It doesn\u2019t follow, however, that an online bookseller with a million customers would want to provide its visitors with a list of its 20,000 most popular books.<\/p>\n<h3 class=\"my-4\"><strong>Thinking locally<\/strong><\/h3>\n<p>Today\u2019s computer chips are not optimized for sparse data \u2014 in fact, the reverse is true. Because fetching data from the chip\u2019s main memory bank is slow, every core, or processor, in a modern chip has its own \u201ccache,\u201d a relatively small, local, high-speed memory bank. Rather than fetching a single data item at a time from main memory, a core will fetch an entire block of data. And that block is selected according to the principle of locality.<\/p>\n<p>It\u2019s easy to see how the principle of locality works with, say, image processing. If the purpose of a program is to apply a visual filter to an image, and it works on one block of the image at a time, then when a core requests a block, it should receive all the adjacent blocks its cache can hold, so that it can grind away on block after block without fetching any more data.<\/p>\n<p>But that approach doesn\u2019t work if the algorithm is interested in only 20 books out of the 2 million in an online retailer\u2019s database. If it requests the data associated with one book, it\u2019s likely that the data associated with the 100 adjacent books will be irrelevant.<\/p>\n<p>Going to main memory for a single data item at a time is woefully inefficient. \u201cIt\u2019s as if, every time you want a spoonful of cereal, you open the fridge, open the milk carton, pour a spoonful of milk, close the carton, and put it back in the fridge,\u201d says Vladimir Kiriansky, a PhD student in electrical engineering and computer science and first author on the new paper. He\u2019s joined by Amarasinghe and Yunming Zhang, also a PhD student in electrical engineering and computer science.<\/p>\n<h3 class=\"my-4\"><strong>Batch processing<\/strong><\/h3>\n<p>Milk simply adds a few commands to OpenMP, an extension of languages such as C and Fortran that makes it easier to write code for multicore processors. With Milk, a programmer inserts a couple additional lines of code around any instruction that iterates through a large data collection looking for a comparatively small number of items. Milk\u2019s compiler \u2014 the program that converts high-level code into low-level instructions \u2014 then figures out how to manage memory accordingly.<\/p>\n<p>With a Milk program, when a core discovers that it needs a piece of data, it doesn\u2019t request it \u2014 and a cacheful of adjacent data \u2014 from main memory. Instead, it adds the data item\u2019s address to a locally stored list of addresses. When the list is long enough, all the chip\u2019s cores pool their lists, group together those addresses that are near each other, and redistribute them to the cores. That way, each core requests only data items that it knows it needs and that can be retrieved efficiently.<\/p>\n<p>That\u2019s the high-level description, but the details get more complicated. In fact, most modern computer chips have several different levels of caches, each one larger but also slightly less efficient than the last. The Milk compiler has to keep track of not only a list of memory addresses but also the data stored at those addresses, and it regularly shuffles both around between cache levels. It also has to decide which addresses should be retained because they might be accessed again, and which to discard. Improving the algorithm that choreographs this intricate data ballet is where the researchers see hope for further performance gains.<\/p>\n<p>\u201cMany important applications today are data-intensive, but unfortunately, the growing gap in performance between memory and CPU means they do not fully utilize current hardware,\u201d says Matei Zaharia, an assistant professor of computer science at Stanford University. \u201cMilk helps to address this gap by optimizing memory access in common programming constructs. The work combines detailed knowledge about the design of memory controllers with knowledge about compilers to implement good optimizations for current hardware.\u201d<\/p>\n<p><em>Source: <a href=\"http:\/\/news.mit.edu\/2016\/faster-parallel-computing-big-data-0913\" target=\"_blank\">MIT<\/a><\/em><\/p>\n<h3 class=\"my-4\">More on programming<\/h3>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/software\/180724-the-most-popular-programming-languages-in-the-world.html\"><strong>The most popular programming languages in the world<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/software\/177497-this-programming-language-is-at-an-all-time-low.html\"><strong>This programming language is at an all-time low<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/mybroadband.co.za\/news\/software\/175665-simit-a-new-user-friendly-programming-language.html\"><strong>Simit \u2013 a new, user-friendly programming language<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>New programming language delivers fourfold speedups on problems common in the age of big data.<\/p>\n","protected":false},"author":340957,"featured_media":152047,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sma_x_autopost_status":"idle","_sma_x_autopost_error":"","_sma_x_post_id":"","_sma_facebook_post_id":"","_sma_instagram_post_id":"","_sma_threads_post_id":"","_sma_x_attempts":0,"footnotes":""},"categories":[16],"tags":[35,38174,7699,39120],"class_list":["post-181098","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-headline","tag-milk","tag-mit","tag-parallel-computing"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/181098"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/340957"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=181098"}],"version-history":[{"count":1,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/181098\/revisions"}],"predecessor-version":[{"id":181100,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/181098\/revisions\/181100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/152047"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=181098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=181098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=181098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}