Astrophysicists find a new use for the video cards that give computer games that movie quality: crunching scientific data.
Spurred less by “Eureka!” than by “There’s got to be an easier way,” a group of young physicists at SLAC and Stanford have demonstrated a way to crunch certain data-heavy astrophysics calculations more than a hundred times faster than the usual methods—turning what could have been days spent waiting for the results into a few hours’ worth of computer time.
Their secret? Hand over the numbers to souped-up video cards.
Video cards, also known as graphics processing units or GPUs, are the specialized components in everyday consumer electronics such as desktop and laptop computers, game consoles and even smart phones. They render the images that appear on your display, ensuring that Mario is appropriately super, that the birds look convincingly angry, and that the alien vistas in so many dystopic role-playing games look properly grim and gray.
Using video cards as the computational powerhouses for scientific computing is a growing trend, especially since the development of “general purpose” GPUs—video cards not locked into graphics calculations. GPU computing has made significant inroads into many fields, including medical imaging, bioinformatics, computational chemistry, fluid dynamics and more.
Cosmologist Debbie Bard of the Kavli Institute for Particle Astrophysics and Cosmology first heard the term “GPU computing” when she attended the International Conference on High Energy Physics in 2010. Bard said it caught her attention immediately. “I thought, ‘That is cool.’”
Bard thought GPU computing might eventually be useful to help scientists handle the coming avalanche of data from the Large Synoptic Survey, likely to add up to about 20 terabytes per night.
Two other young Stanford physicists, Matt Bellis (now an assistant professor at Siena College in New York) and Mark Allen (currently a data scientist at Junyo, a company that helps schools use technology effectively), thought the same thing. The three formed an unofficial study group to learn more about GPU computing and how it could help soak up the data deluge.
“To start with, we just wanted to understand what the GPUs could do and how to interface with them,” Bellis says. “Really, really, really basic stuff.”
What video cards can do is render breathtakingly realistic graphics in real time (as a situation in a game changes, for example) because they’re optimized to handle the necessary mathematical calculations in parallel. Commonly used central processing units, or CPUs, might have the same ability as video cards to handle calculations, but they’re also in charge of input, output, writing to and retrieving from the computer’s memory and handling resource allocation. These are all tasks that cannot be done in parallel and recombined to yield a final result. In contrast, hundreds of processing chips on a video card can perform related calculations at the same time and merge the results seamlessly.
To the members of the informal study group, this sounded very promising. They pushed forward with their exploration of GPU computing, teaching themselves CUDA, the computer language used to talk to video cards, and selecting two different problems to try.
One looked at a collection of galaxies and determined how far apart they were from one another in the sky. Finding where more galaxies are relatively close together than might be expected from a random distribution can help scientists trace the underlying dark-matter structure of the universe.
“A data set of a million galaxies means a million-squared calculations,” Bard says. “Because these calculations take so much time on CPUs, we usually split our data into smaller sets, and take averages over those smaller sets. You lose some of the detail when you take an average. But with GPUs we can do the full calculation faster and with much less uncertainty.”
The second calculation they handed over to video cards analyzed the shapes of galaxies to determine how much they’ve been affected by gravitational lensing—whether by other visible large-mass objects like galaxy clusters, or by unseen dark matter.
“You can’t approximate this one,” Bard says. “You have to do it brute force. It’s really time-consuming” using CPUs. GPUs made the calculations at least 100 times faster.
The team wrote up the results in a paper that appeared in the premier issue of Astronomy and Computing. Their conclusion: GPUs are a useful tool for cosmological calculations, allowing calculations to be made one or two orders of magnitude faster.
“It’s like having supercomputer power without having to use a supercomputer,” Bard says. And considering they only used the four video cards at SLAC and the one installed in Bellis’ desktop computer at Siena College for their tests, Bard thinks video card computing holds even more potential for speeding up data processing—and thus the pace of scientific discovery.