CUDA Spotlight: Todd Martínez

Todd Martínez

GPU-Accelerated Quantum Chemistry

This week's Spotlight is on Professor Todd Martínez of Stanford.

Professor Martínez' research lies in the area of theoretical chemistry, emphasizing the development and application of new methods which accurately and efficiently capture quantum mechanical effects.

Professor Martínez pioneered the use of GPU technology for computational chemistry, culminating in the TeraChem software package that uses GPUs for first principles molecular dynamics. He is a founder of the company PetaChem that distributes this software.

This interview is part of the CUDA Spotlight Series.

[Editor's Note: Learn more about GPU-based quantum chemistry at the GPU Technology Conference in March. Stanford graduate student Nathan Luehr will speak on Virtual Molecular Modeling Kits: Playing Games with Quantum Chemistry, on Thurs., March 27.]


Q & A with Todd Martínez

NVIDIA: Todd, tell us about TeraChem.
Todd: TeraChem simulates the dynamics and motion of molecules, solving the electronic Schrodinger equation to determine the forces between atoms. This is often called first principles molecular dynamics or ab initio molecular dynamics.

The primary advantage over empirical force fields (for example, often used for protein structure) is that chemical bond rearrangements and electron transfer can be described seamlessly.

NVIDIA: Who are the users of TeraChem?
Todd: The primary users are academic researchers (from fields such as chemistry, materials and biology), but we are seeing increased interest from industry.

Even though TeraChem was designed for ab initio molecular dynamics, it can also carry out simpler tasks such as optimization of the geometry of a molecular structure and calculation of reaction mechanisms.

Many people use TeraChem for these purposes, often referred to as quantum chemistry. Some of the most enthusiastic users have realized that TeraChem makes many simulations possible that were otherwise intractable. They have used TeraChem to optimize molecular structures for proteins, nanotubes, and minerals and to explore chemical reactions happening in these structures.

NVIDIA: What is an example of an industrial research application?
Todd: Pharmaceutical companies can use TeraChem to determine the likelihood of different conformers (shapes) of drug-like molecules. This allows one to assess whether the molecule will fit in a protein pocket. Often this needs to be done very quickly in order to screen many potential compounds. TeraChem can also be used to calculate the wavelength at which dye molecules will absorb light. This is important in order to find molecules that absorb well in the solar spectrum for photovoltaic materials.

The protein BPTI (Bovine Pancreatic Trypsin Inhibitor) in TeraChem

The protein BPTI (Bovine Pancreatic Trypsin Inhibitor) in TeraChem
Red/blue and green/brown isosurfaces are representations of the lowest unoccupied and highest occupied molecular orbitals (i.e., from an electronic structure calculation of the entire protein)

NVIDIA: How does TeraChem leverage GPU computing?
Todd: TeraChem was written for GPUs.  I believe it remains the only quantum chemistry and/or ab initio molecular dynamics code which was designed for the GPU. The payoff from this redesign was remarkable – TeraChem is up to two orders of magnitude faster than similar programs designed for CPUs. This is bringing us much closer to the holy grail of computer-aided molecular design.

NVIDIA: When did you first see the promise of GPU computing?
Todd: Our interest in stream processing began around 2000. Our first efforts were focused on the Emotion Engine and Graphics Synthesizer in the PlayStation 2. We wrote a few key routines in assembler and ported the GAMESS quantum chemistry code to run on the PS2.

Writing in assembler was very tedious and the idea of rewriting all the code in assembler was unattractive. Thus, we were keeping close tabs on developments in GPGPU computing, which might be a more sustainable approach. Indeed, we were evaluating Brook as a possible avenue to expand that work.

Fortunately, we found out about NVIDIA's plans to release CUDA from Professor Wen-mei Hwu at UIUC and were able to redirect these efforts into CUDA. Our first CUDA electronic structure code was written in late 2007, using a beta release of CUDA.

NVIDIA: What is unique about the TeraChem code?
Todd: We reformulated all the algorithms of quantum chemistry to map well onto GPU architectures. This implies a fair bit of precomputing to arrange the data so that the GPU can process it effectively. Because of this, TeraChem takes advantage of spatial locality more efficiently than other quantum chemistry packages. It also spends almost all of its execution time on the GPU – the CPU does very little work.

NVIDIA: In what ways is your team using CUDA?
Todd: All of our code development is now done with an eye towards stream processors and most of this is in CUDA. Unlike many who view the GPU as an accelerator for the CPU, we tend to see the CPU as a coprocessor for the GPU. Most of our computers are now loaded with eight GPUs in each node and we would be delighted to increase the GPU density even further. Reformulating algorithms to run on the GPU as much as possible has clearly been a winning strategy so far.

NVIDIA: Can you talk about how TeraChem is developing into a teaching tool?
Todd: Chemists often use physical model kits in order to visualize molecular structures. These are great learning tools, but the model kits only "know" a limited amount of chemistry. TeraChem gave us an opportunity to make a virtual model kit that knows about the electrons (and thus knows all of chemistry!).

We combined TeraChem with 3D visualization and force-feedback input devices so that students can "grab" atoms in a molecule and pull on them – the molecule will "pull back" via the haptic input device.

Students can learn chemistry by playing with molecules directly and they can feel the difference between strong and weak bonds. They also "feel" the difference between favorable and unfavorable reaction pathways. The key here was being able to match human and molecular time scales – this all works fluidly because TeraChem is able to do calculations fast enough so that one second of real time corresponds to several femtoseconds of molecular time.

NVIDIA: What are you looking forward to in the next 5-10 years?
Todd: Another one to two orders of magnitude improvement in the performance of electronic structure theory. We expect that a combination of hardware and algorithmic improvements will get us there. At that point, computer-aided molecular and materials design will be the new standard. This will have a tremendous impact on industry as well as academia. 

In terms of industrial applications, we expect to be able to design polymers with tailored responses to external stimuli – for example, strengthening by chemical crosslinking as they are stressed to prevent damage. An example would be developing new molecular systems for efficiently converting sunlight into electricity or fuels.

Bio for Todd Martínez

Professor Todd J. Martínez received his B. S. in Chemistry from Calvin College in 1989 and his Ph.D. in Chemistry from the University of California at Los Angeles in 1994.  From 1994 to 1996, he was a Fulbright Junior Postdoctoral Researcher at Hebrew University in Jerusalem and a University of California President's Postdoctoral Fellow at UCLA. In 1996, he joined the faculty in the Department of Chemistry at the University of Illinois. In 2009, he was recruited to join the faculty at Stanford University and the SLAC National Accelerator Laboratory, where he is currently David Mulvane Ehrsam and Edward Curtis Franklin Professor.

Professor Martínez has received numerous awards in recognition of his contributions to theoretical chemistry and our understanding of the chemical reactivity of electronic excited states. These include fellowships and awards from the Camille and Henry Dreyfus Foundation, the Alfred P. Sloan Foundation, the Arnold and Mabel Beckman Foundation, the David and Lucille Packard Foundation, and the John D. and Catherine T. MacArthur Foundation.

Relevant Links
Martinez Research Group @ Stanford University

Contact Info

# # #