Getting Serious About Transactional Memory

By Michael Feldman

January 12, 2007

The parallelization of computing, via multi-threading cores, multi-core processors and multi-processor systems is encouraging ever greater levels of application concurrency to take advantage of the proliferating CPUs. Multi-core processors, in particular, are fueling this phenomenon.

Beyond the dual- or quad-core domain, manufacturers are starting to build many-core chips. Examples include the Niagara T1 UltraSPARC from Sun Microsystems, which has 8 cores and can support 32 threads (the next-generation Rock processor will double this to 16 cores and 64 threads); Cavium Networks 16-core OCTEON MIPS64 processor for embedded applications; and Intel's Polaris prototype processor, which sports 80 cores and boasts a peak teraflop.

The Polaris prototype, which is part of Intel's terascale computing initiative, is motivating researchers there to take a hard look at a relatively new technology — transactional memory or TM, for short. Within the next ten years, the prospect of multi-core teraflop processors like Polaris and new application domains to use those processors will require vastly more parallel processing than ever before. Even incorporating relatively low levels of concurrency in today's applications is already challenging some of our best developers.

One of the nastiest concurrency problems has to do with keeping data thread-safe, that is maintaining global data integrity in the presence of parallel executing threads. Failure to keep data thread-safe leads to deadlocks, race conditions (data corruption) and priority inversion. Worse, because these types of problems are time-sensitive, they are often very hard to find during normal testing and in some cases go undetected until after the application is deployed.

The typical way to keep data thread-safe is to use global locks around objects that are being accessed by more than one thread. Locks provide a synchronization mechanism that blocks concurrent access of an object, preventing the data race condition. Seems simple enough. But there are a number of problems with this approach. Sometimes locks become dependent on each other, such that each thread is holding a lock the other thread needs. Or if a thread dies holding a lock it can block other dependent threads.

Even for correctly implemented locks, there's the issue of granularity. Coarse granularity protects larger data objects and uses fewer locks. But as the number of threads scales up, performance suffers. Finer granularity allows the programmer to protect smaller data items and gives better performance as long (as lock overhead is not overwhelming). It makes it possible, for example, to lock individual record components rather than the entire record structure. But finer granularity requires more complex algorithms and more locks, so it is often much more difficult to implement correctly.

Transactional memory to the rescue

Terascale computing, which relies on many-core parallelism, will be very difficult to develop. The current languages only provide low-level concurrency features. For Intel, terascale computing has become the prime motivator to improve software concurrency technology. The company's 80-core Polaris prototype will require much greater levels of application concurrency than today. And the scaling up of multi-core processors across time and product families will necessitate a solution that doesn't require reprogramming based on core count.

“How can the programmer write parallel code more effectively, that is, write robust code that doesn't have bugs, but still scales and benefits from the additional cores that each successive generation provides,” asks Ali-Reza Adl-Tabatabai, Intel Principal Engineer? “That's the big challenge that we're going after.”

To that end, Intel researchers are looking to transactional memory as one of the key technologies that will enable developers to write the terascale killer apps of the next decade. The attraction of TM is that is appears to solve the most annoying problems of global locks: application robustness and scalability. These attributes are especially important for the type of large-scale concurrency required by terascale applications.

Like locks, transactional memory is a construct for concurrency control that enables access to data shared by multiple threads. But unlike locks it is an optimistic model. It assumes that in most cases only a single thread will be contending for a given data item. A transaction is a high-level construct that executes reads and writes to data as an indivisible operation. From the application's point of view intermediate states are not visible to other successful transactions. So when a logical transaction is complete, the system verifies that other logical transactions haven't made changes to the same memory that would conflict with the first transaction. If they have, then the transaction is re-executed until it succeeds.

Intel's view is that TM should be encapsulated in language construct, and initially implemented in software. At some point, it may be useful to provide a hardware assist to provide better performance or functionality. But this is not necessarily the case.

Adl-Tabatabai says that dynamic memory garbage collection, a technology introduced about 50 years ago, may be a good analogy of how transactional memory will evolve. Initially, there were a number of techniques for implementing garbage collection in software. People thought that they really would like hardware support for this. But the software algorithms evolved and eventually made it into mainstream languages like Java. It turned out that hardware assistance wasn't really needed. In any case, once the language semantics of TM are defined, the software/hardware implementation should be transparent to the application developer.

Intel researchers have prototyped extensions to Java and C that incorporate transactional memory constructs. They've also investigated using various compiler optimizations for transactional memory implementations. Below are two trivial code examples that make data object 'x' thread-safe. The first uses explicit locking, the second uses the atomic block construct for transactional memory.

   lock(L); x++; unlock(L);

   atomic {x++;}

The atomic construct guarantees the enclosed operations will be safe from thread concurrency. The data transactions within the construct will either execute completely or have no effect until it is safe to do so. When the atomic block executes this happens as if in a single step in relation to the other threads. In other words, from the programmer's point of view, the transactions run in isolation.

The DARPA HPCS research languages (Fortress, X10, Chapel) for high productivity computing all provide atomic block construct in lieu of explicit lock synchronization. A few other investigators have incorporated TM into other research languages, but the final language to emerge from the DARPA HPCS program may be the first one to formally introduce it as a standard feature.

“The fact that the HPCS languages decided to provide atomic constructs rather than locking constructs shows that there's general consensus in the language design community that this is the way to go for concurrency control in future languages,” notes Adl-Tabatabai.

According to Adl-Tabatabai, The HPCS language effort represents a real step forward, since it will incorporate TM from the beginning. Retrofitting transactions into older languages that previously used locks can be problematic, since mixing explicit locking and implicit locking via a low-level implementation of TM may introduce conflicts when dealing with legacy code.

Scaling to advantage

On many applications, coarse-grained locking — putting locks around whole data structures — doesn't scale well. Threads that are concurrently accessing the same data structure must wait unnecessarily when they are reading or writing disjoint data within the structure. To increase performance, the developer must re-program the algorithm using fine-grained locking — putting global locks around individual data items in the data structures. Fine-grained locking allows different threads to concurrently access disjoint data in the same data structures. Transactional memory implicitly provides fine-grained locking, automatically providing the associated performance benefits.

Adl-Tabatabai describes an example using traditional fine-grained locking for a hash table. Using the Java 5 class libraries, a professor of computer science (who wrote a book on Java concurrency) was able to make the appropriate modifications to the hash table algorithms to incorporate fine-grained locking. The changes were subtle, yet quite complex. After two years of reviews by the Java standards committees, it was approved for inclusion into the Java class libraries.

“In general, doing this kind of coding is very difficult,” says Adl-Tabatabai. “You're not going to be able to get your average Joe Programmer to write code like this, and write it in a way that's error-free and doesn't introduce data races or deadlocks.”

Besides fine-grained locking, TM has the additional advantage of allowing for concurrent reads of the same data, which traditional locks cannot do. A special type of lock, called a reader-writer lock can be used to overcome this deficiency but this requires application code modifications. Transactional memory, on the other hand provides a systematic way for programmers to take advantage of these features.

With no existing base of software, how will TM get mainstreamed into applications? Jerry Bautista, Director, Microprocessor Technology Management at Intel says the evolution to multi-core architectures will create a need in the marketplace for technologies like transactional memory as the complexity of programming creates a new set of challenges.

“As we introduce more high performance hardware, there will be a demand generated in the programming community for ways to get around these common problems,” says Bautista. “People are already noting these challenges today. We're just trying to run ahead here.”

Subscribe to HPCwire's Weekly Update!

Be the most informed person in the room! Stay ahead of the tech trends with industy updates delivered to you every week!

Hyperion: AI-driven HPC Industry Continues to Push Growth Projections

November 21, 2019

Three major forces – AI, cloud and exascale – are combining to raise the HPC industry to heights exceeding expectations. According to market study results released this week by Hyperion Research at SC19 in Denver, Read more…

By Doug Black

At SC19: Bespoke Supercomputing for Climate and Weather

November 20, 2019

Weather and climate applications are some of the most important uses of HPC – a good model can save lives, as well as billions of dollars. But many weather and climate models struggle to run efficiently in their HPC en Read more…

By Oliver Peckham

Microsoft, Nvidia Launch Cloud HPC Service

November 20, 2019

Nvidia and Microsoft have joined forces to offer a cloud HPC capability based on the GPU vendor’s V100 Tensor Core chips linked via an InfiniBand network scaling up to 800 graphics processors. The partners announced Read more…

By George Leopold

Hazra Retiring from Intel Data Center Group, Successor Not Known

November 20, 2019

Rajeeb Hazra, corporate VP of Intel’s Data Center Group and GM for the Enterprise and Government Group, is retiring after more than 24 years at the company. At this writing, his successor is unknown. An earlier story on... Read more…

By Doug Black

Jensen Huang’s SC19 – Fast Cars, a Strong Arm, and Aiming for the Cloud(s)

November 20, 2019

We’ve come to expect Nvidia CEO Jensen Huang’s annual SC keynote to contain stunning graphics and lively bravado (with plenty of examples) in support of GPU-accelerated computing. In recent years, AI has joined the s Read more…

By John Russell

AWS Solution Channel

Making High Performance Computing Affordable and Accessible for Small and Medium Businesses with HPC on AWS

High performance computing (HPC) brings a powerful set of tools to a broad range of industries, helping to drive innovation and boost revenue in finance, genomics, oil and gas extraction, and other fields. Read more…

IBM Accelerated Insights

Data Management – The Key to a Successful AI Project

 

Five characteristics of an awesome AI data infrastructure

[Attend the IBM LSF & HPC User Group Meeting at SC19 in Denver on November 19!]

AI is powered by data

While neural networks seem to get all the glory, data is the unsung hero of AI projects – data lies at the heart of everything from model training to tuning to selection to validation. Read more…

SC19 Student Cluster Competition: Know Your Teams

November 19, 2019

I’m typing this live from Denver, the location of the 2019 Student Cluster Competition… and, oh yeah, the annual SC conference too. The attendance this year should be north of 13,000 people, with the majority attende Read more…

By Dan Olds

Hyperion: AI-driven HPC Industry Continues to Push Growth Projections

November 21, 2019

Three major forces – AI, cloud and exascale – are combining to raise the HPC industry to heights exceeding expectations. According to market study results r Read more…

By Doug Black

At SC19: Bespoke Supercomputing for Climate and Weather

November 20, 2019

Weather and climate applications are some of the most important uses of HPC – a good model can save lives, as well as billions of dollars. But many weather an Read more…

By Oliver Peckham

Hazra Retiring from Intel Data Center Group, Successor Not Known

November 20, 2019

Rajeeb Hazra, corporate VP of Intel’s Data Center Group and GM for the Enterprise and Government Group, is retiring after more than 24 years at the company. At this writing, his successor is unknown. An earlier story on... Read more…

By Doug Black

Jensen Huang’s SC19 – Fast Cars, a Strong Arm, and Aiming for the Cloud(s)

November 20, 2019

We’ve come to expect Nvidia CEO Jensen Huang’s annual SC keynote to contain stunning graphics and lively bravado (with plenty of examples) in support of GPU Read more…

By John Russell

Top500: US Maintains Performance Lead; Arm Tops Green500

November 18, 2019

The 54th Top500, revealed today at SC19, is a familiar list: the U.S. Summit (ORNL) and Sierra (LLNL) machines, offering 148.6 and 94.6 petaflops respectively, Read more…

By Tiffany Trader

ScaleMatrix and Nvidia Launch ‘Deploy Anywhere’ DGX HPC and AI in a Controlled Enclosure

November 18, 2019

HPC and AI in a phone booth: ScaleMatrix and Nvidia announced today at the SC19 conference in Denver a joint offering that puts up to 13 petaflops of Nvidia DGX Read more…

By Doug Black

Intel Debuts New GPU – Ponte Vecchio – and Outlines Aspirations for oneAPI

November 17, 2019

Intel today revealed a few more details about its forthcoming Xe line of GPUs – the top SKU is named Ponte Vecchio and will be used in Aurora, the first plann Read more…

By John Russell

SC19: Welcome to Denver

November 17, 2019

A significant swath of the HPC community has come to Denver for SC19, which began today (Sunday) with a rich technical program. As is customary, the ribbon cutt Read more…

By Tiffany Trader

Supercomputer-Powered AI Tackles a Key Fusion Energy Challenge

August 7, 2019

Fusion energy is the Holy Grail of the energy world: low-radioactivity, low-waste, zero-carbon, high-output nuclear power that can run on hydrogen or lithium. T Read more…

By Oliver Peckham

Using AI to Solve One of the Most Prevailing Problems in CFD

October 17, 2019

How can artificial intelligence (AI) and high-performance computing (HPC) solve mesh generation, one of the most commonly referenced problems in computational engineering? A new study has set out to answer this question and create an industry-first AI-mesh application... Read more…

By James Sharpe

Cray Wins NNSA-Livermore ‘El Capitan’ Exascale Contract

August 13, 2019

Cray has won the bid to build the first exascale supercomputer for the National Nuclear Security Administration (NNSA) and Lawrence Livermore National Laborator Read more…

By Tiffany Trader

DARPA Looks to Propel Parallelism

September 4, 2019

As Moore’s law runs out of steam, new programming approaches are being pursued with the goal of greater hardware performance with less coding. The Defense Advanced Projects Research Agency is launching a new programming effort aimed at leveraging the benefits of massive distributed parallelism with less sweat. Read more…

By George Leopold

AMD Launches Epyc Rome, First 7nm CPU

August 8, 2019

From a gala event at the Palace of Fine Arts in San Francisco yesterday (Aug. 7), AMD launched its second-generation Epyc Rome x86 chips, based on its 7nm proce Read more…

By Tiffany Trader

D-Wave’s Path to 5000 Qubits; Google’s Quantum Supremacy Claim

September 24, 2019

On the heels of IBM’s quantum news last week come two more quantum items. D-Wave Systems today announced the name of its forthcoming 5000-qubit system, Advantage (yes the name choice isn’t serendipity), at its user conference being held this week in Newport, RI. Read more…

By John Russell

Ayar Labs to Demo Photonics Chiplet in FPGA Package at Hot Chips

August 19, 2019

Silicon startup Ayar Labs continues to gain momentum with its DARPA-backed optical chiplet technology that puts advanced electronics and optics on the same chip Read more…

By Tiffany Trader

Crystal Ball Gazing: IBM’s Vision for the Future of Computing

October 14, 2019

Dario Gil, IBM’s relatively new director of research, painted a intriguing portrait of the future of computing along with a rough idea of how IBM thinks we’ Read more…

By John Russell

Leading Solution Providers

ISC 2019 Virtual Booth Video Tour

CRAY
CRAY
DDN
DDN
DELL EMC
DELL EMC
GOOGLE
GOOGLE
ONE STOP SYSTEMS
ONE STOP SYSTEMS
PANASAS
PANASAS
VERNE GLOBAL
VERNE GLOBAL

Cray, Fujitsu Both Bringing Fujitsu A64FX-based Supercomputers to Market in 2020

November 12, 2019

The number of top-tier HPC systems makers has shrunk due to a steady march of M&A activity, but there is increased diversity and choice of processing compon Read more…

By Tiffany Trader

Intel Confirms Retreat on Omni-Path

August 1, 2019

Intel Corp.’s plans to make a big splash in the network fabric market for linking HPC and other workloads has apparently belly-flopped. The chipmaker confirmed to us the outlines of an earlier report by the website CRN that it has jettisoned plans for a second-generation version of its Omni-Path interconnect... Read more…

By Staff report

Kubernetes, Containers and HPC

September 19, 2019

Software containers and Kubernetes are important tools for building, deploying, running and managing modern enterprise applications at scale and delivering enterprise software faster and more reliably to the end user — while using resources more efficiently and reducing costs. Read more…

By Daniel Gruber, Burak Yenier and Wolfgang Gentzsch, UberCloud

Dell Ramps Up HPC Testing of AMD Rome Processors

October 21, 2019

Dell Technologies is wading deeper into the AMD-based systems market with a growing evaluation program for the latest Epyc (Rome) microprocessors from AMD. In a Read more…

By John Russell

Rise of NIH’s Biowulf Mirrors the Rise of Computational Biology

July 29, 2019

The story of NIH’s supercomputer Biowulf is fascinating, important, and in many ways representative of the transformation of life sciences and biomedical res Read more…

By John Russell

Xilinx vs. Intel: FPGA Market Leaders Launch Server Accelerator Cards

August 6, 2019

The two FPGA market leaders, Intel and Xilinx, both announced new accelerator cards this week designed to handle specialized, compute-intensive workloads and un Read more…

By Doug Black

Intel Debuts New GPU – Ponte Vecchio – and Outlines Aspirations for oneAPI

November 17, 2019

Intel today revealed a few more details about its forthcoming Xe line of GPUs – the top SKU is named Ponte Vecchio and will be used in Aurora, the first plann Read more…

By John Russell

When Dense Matrix Representations Beat Sparse

September 9, 2019

In our world filled with unintended consequences, it turns out that saving memory space to help deal with GPU limitations, knowing it introduces performance pen Read more…

By James Reinders

  • arrow
  • Click Here for More Headlines
  • arrow
Do NOT follow this link or you will be banned from the site!
Share This