Published in collaboration with NCMS
Digital Manufacturing Report

News & information about the fast-moving world
of digital manufacturing, modeling & simulation

Language Flags

Writing Graphics Software Gets Much Easier


CAMBRIDGE, Mass., August 2 — Image-processing software is a hot commodity: Just look at Instagram, a company built around image processing that Facebook is trying to buy for a billion dollars. Image processing is also going mobile, as more and more people are sending cellphone photos directly to the Web, without transferring them to a computer first.

At the same time, digital-photo files are getting so big that, without a lot of clever software engineering, processing them would take a painfully long time on a desktop computer, let alone a cellphone. Unfortunately, the tricks that engineers use to speed up their image-processing algorithms make their code almost unreadable, and rarely reusable. Adding a new function to an image-processing program, or modifying it to run on a different device, often requires rethinking and revising it from top to bottom.

Researchers at MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) aim to change that, with a new programming language called Halide. Not only are Halide programs easier to read, write and revise than image-processing programs written in a conventional language, but because Halide automates code-optimization procedures that would ordinarily take hours to perform by hand, they’re also significantly faster.

In tests, the MIT researchers used Halide to rewrite several common image-processing algorithms whose performance had already been optimized by seasoned programmers. The Halide versions were typically about one-third as long but offered significant performance gains — two-, three-, or even six-fold speedups. In one instance, the Halide program was actually longer than the original — but the speedup was 70-fold.

Jonathan Ragan-Kelley, a graduate student in the Department of Electrical Engineering and Computer Science, and Andrew Adams, a CSAIL postdoc, led the development of Halide, and they’ve released the code online. At this month’s Siggraph, the premier graphics conference, they’ll present a paper on Halide, which they co-wrote with MIT computer science professors Saman Amarasinghe and Fredo Durand and with colleagues at Adobe and Stanford University.

Parallel pipelines

One reason that image processing is so computationally intensive is that it generally requires a succession of discrete operations. After light strikes the sensor in a cellphone camera, the phone combs through the image data for values that indicate malfunctioning sensor pixels and corrects them. Then it correlates the readings from pixels sensitive to different colors to deduce the actual colors of image regions. Then it does some color correction, and then some contrast adjustment, to make the image colors better correspond to what the human eye sees. At this point, the phone has done so much processing that it takes another pass through the data to clean it up.

And that’s just to display the image on the phone screen. Software that does anything more complicated, like removing red eye, or softening shadows, or boosting color saturation — or making the image look like an old Polaroid photo — introduces still more layers of processing. Moreover, high-level modifications often require the software to go back and recompute prior stages in the pipeline.

In today’s multicore chips, distributing different segments of the image to cores working in parallel can make image processing more efficient. But the way parallel processing is usually done, after each step in the image-processing pipeline, the cores would send the results of their computations back to main memory. Because data transfer is much slower than computation, this can eat up all the performance gains offered by parallelization.

So software engineers try to keep the individual cores busy for as long as possible before they have to ship their results to memory. That means that the cores have to execute several steps in the processing pipeline on their separate chunks of data without aggregating their results. Keeping track of all the dependencies between pixels being processed on separate cores is what makes the code for efficient image processors so complicated. Moreover, the trade-offs between the number of cores, the processing power of the cores, the amount of local memory available to each core, and the time it takes to move data off-core varies from machine to machine, so a program optimized for one device may offer no speed advantages on a different one.

Divide and conquer

Halide doesn’t spare the programmer from thinking about how to parallelize efficiently on particular machines, but it splits that problem off from the description of the image-processing algorithms. A Halide program has two sections: one for the algorithms, and one for the processing “schedule.” The schedule can specify the size and shape of the image chunks that each core needs to process at each step in the pipeline, and it can specify data dependencies — for instance, that steps being executed on particular cores will need access to the results of previous steps on different cores. Once the schedule is drawn up, however, Halide handles all the accounting automatically.

A programmer who wants to export a program to a different machine just changes the schedule, not the algorithm description. A programmer who wants to add a new processing step to the pipeline just plugs in a description of the new procedure, without having to modify the existing ones. (A new step in the pipeline will require a corresponding specification in the schedule, however.)

“When you have the idea that you might want to parallelize something a certain way or use stages a certain way, when writing that manually, it’s really hard to express that idea correctly,” Ragan-Kelley says. “If you have a new optimization idea that you want to apply, chances are you’re going to spend three days debugging it because you’ve broken it in the process. With this, you change one line that expresses that idea, and it synthesizes the correct thing.”

Although Halide programs are simpler to write and to read than ordinary image-processing programs, because the scheduling is handled automatically, they still frequently offer performance gains over even the most carefully hand-engineered code. Moreover, Halide code is so easy to modify that programmers could simply experiment with half-baked ideas to see if they improve performance.

“You can just flail around and try different things at random, and you’ll often find something really good,” Adams says. “Only much later, when you’ve thought about it very hard, will you figure out why it’s good.”

“There’s a lot of excitement about using a domain-specific language like the one they chose to do, but there really haven’t been a lot of success stories,” says John Owens, an associate professor of electrical and computer engineering at the University of California at Davis. “And I think this is going to turn out to be a terrific success story. It really has all the pieces you want from a completed system, and it’s in a really important application domain.”

“I can also see it inspiring a lot of future work,” Owens adds. “I think this is going to be a really high-impact project.”

-----

Source: MIT

RSS Feeds

Subscribe to All Content

Most Recent Blogs


Feature Articles

GE Turns to Makers to Bring 3D Printing to Aerospace

At 30,000 feet, equipment failure is simply not an option, which is part of why additive manufacturing has been a bit slow to catch on in the aerospace industry. But according to Michael Idelchik, vice president of GE’s advanced technologies research, GE Aviation is still looking for more ways that additive manufacturing can help to create a better airplane...
Read more...

Is Automation to Blame for Our Economic Woes?

Despite reassurances of automation professionals throughout the industry, some experts simply aren't convinced that technological advancements in robotics and automation aren't negatively impacting U.S. employment rates, which is what Erik Brynjolfsson and Andrew McAfee of the MIT Sloan School of Management have been arguing over the past year and a half.
Read more...

Simulations Sail into the Shipyard

As far as modeling and simulation are concerned, nautical transportation isn’t one of the first things to come to mind. Still, it presents a unique use case for computer-integrated manufacturing, as the focus of the modeling and simulation is on the construction process itself. By coordinating the insertion of massive hull blocks, it not only streamlines construction, but it improves safety as well.
Read more...

Short Takes

Robots Take the Keys at Ford’s New Test Track

Jun 18, 2013 | When it comes to testing a new line of trucks, it shouldn’t come as a surprise that automakers such as Ford aren’t afraid to be tough on their latest models. But separating the pounding the trucks can take from the test driver can get a bit tricky, which is why Ford has recently handed the keys over to robots instead of flesh-and-blood drivers.
Read more...

3D Printer Section Appears on Amazon

Jun 14, 2013 | Last month’s news of 3D printers entering brick-and-mortar Staples stores may have represented a major step in mainstream commercialization of additive manufacturing tools, but in what is perhaps an even bigger step, online retail giant Amazon recently added a dedicated section of its site to 3D printers and supplies.
Read more...

Experts Chime in on the Future of Global Manufacturing

Jun 12, 2013 | In the wake of the economic downturn, reshoring efforts and increased emphasis on STEM, there’s plenty of uncertainty about where global manufacturing is headed in the next several years. Helping to give us a better sense of this trajectory is a group of thought leaders who have come together to try and answer the most pertinent questions about the future.
Read more...

Are Bachelor's Degrees All They're Cracked Up to Be?

Jun 11, 2013 | As the U.S. manufacturing sector fights to stay competitive on a global scale, the issue of improving STEM education has been key. But in a recent study measuring how workers in STEM fields are putting their educations to use it was found that half didn't need a bachelor's degree.
Read more...

Chevy Looks to Rapid Prototyping for the 2014 Malibu

Jun 10, 2013 | Chevrolet has added digital manufacturing technology to its arsenal. Abandoning clay for their latest Malibu, the automaker has turned to two types of additive manufacturing to meet their rapid prototyping needs.
Read more...

Sponsored Whitepapers

Big Data and Big Analytics for Product and Process Quality

03/20/2013 | SAS | This white paper examines how an enterprise-wide quality platform can turn existing data into substantial and sustainable revenue growth and cost savings for global manufacturers. The paper is based on the findings of the IW/SAS Enterprise Quality Survey completed by more than 400 manufacturing executives. The objectives of the survey were to determine concerns about quality among manufacturers; investigate the tools used to measure quality; and examine how using enterprise-wide analysis on quality data improves performance.

TATA Steel Automotive Engineering Depends on Univa

07/19/2011 | Univa | TATA Steel Automotive Engineering’s concern grew when open source Grid Engine support and development was discontinued by Oracle. Grid Engine is a business critical application in their environment. They recognized the likelihood that product enhancements and innovations would cease. Read how TATA Steel Automotive Engineering moved from a self-support solution to Univa Grid Engine. You can get more out of your environment and your budget with Univa Grid Engine.

Conferences and Events

Featured Events






  • November 17, 2013 - November 22, 2013
    SC'13
    Denver, CO
    United States

Copyright © 2011-2013 Tabor Communications, Inc. All Rights Reserved.
Digital Manufacturing Report is a registered trademark of Tabor Communications, Inc. Use of this site is governed by our Terms of Use and Privacy Policy.
Reproduction in whole or in part in any form or medium without express written permission of Tabor Communications Inc. is prohibited.
Powered by Xtenit.