Compilers and More: Expose, Express, Exploit

By Michael Wolfe

March 28, 2011

Part 2: Programming at Exascale

In my previous column, I introduced six levels of parallelism that we’ll have in exascale systems:

  • Node level
  • Socket level
  • Core level
  • Vector level
  • Instruction level
  • Pipeline level

As we move towards exascale, we want to take advantage of all of these. We need to expose parallelism at all the levels, either explicitly in the program, or implicitly within the compiler. We need to express this parallelism, in a language and in the generated code. And we need to exploit the parallelism, efficiently and effectively, at runtime on the target machine. Performance is important; in fact, performance is key. The only reason we are looking at parallelism is for higher performance. This is a point I have made in the past, and I’ll say it again: the only reason to program in parallel is for higher performance. (Someone at SC10 responded that another reason to use parallelism is for redundancy, for error detection. I should have replied that redundancy is good, but you do the redundant computations in parallel to get the benefits of redundant computation without performance degradation.)

Exposing Parallelism

Someone has to find or create the parallelism in the program. At tera and petascale, we’ve mostly focused on data parallelism: large datasets, where the program can operate on separate data in parallel. At exascale, we’re likely to want even more parallelism, such as running coupled models in parallel. We’ll do the structural mechanics model concurrently with the heat transfer and deformation physics models. Since these models are coupled, it’s much easier to separate the problems and iterate through them one at a time; it will be a challenge to structure the code so they can run in parallel with each other. Parallelism at this high a level has to be exposed in the application design.

Within each algorithm, there is additional parallelism. This is where we get most of the parallel execution today, from individual algorithms. Parallelism at this level has finer granularity, and often is naturally dynamic. Some parallelism we get for free, meaning the compiler can find vector and instruction-level parallelism without changing the program. To be honest, this is a misrepresentation. The compiler can only find parallelism that already exists in the program. There are always ways to write the program to defeat the compiler; this isn’t a failing of the compiler, it’s compiler abuse.

Exposing parallelism, at any level, is a creative process. You choose how to organize your data such that it can be processed in parallel, or not. You choose the algorithms, solvers, conditioners, etc., that can use more parallelism, or that use less. You make these decisions in your application design. You might make different decisions, use different algorithms, depending on the target machine (laptop vs. cluster vs. exascale); this makes your job more challenging. However, since these decisions affect not only the parallelism and performance, but the accuracy and quality of the results, they have to be made by an expert, by a human.

Expressing Parallelism

Most of the discussion about parallel programming falls into this heading: how do I write my parallel program? Will I use MPI? Do I use some programming framework which is itself built on top of MPI? Do I use OpenMP directives? Do I use Cilk language extensions, or Unified Parallel C? Should I write in a consistent sequential language and use a compiler or other tool to find the parallelism? Should I use a truly higher order language, like SISAL or Haskell? Can I design a domain-specific language to make the programming more natural? Maybe I can build a C++ class library that will support my data structures directly?

There is a big step between designing an algorithm and expressing that algorithm in some language. Writing a parallel message-passing solver for large systems (such as the High Performance Linpack benchmark) is much more work that simply calling the LAPACK DGESV routine. You have to worry about data distribution, communication, and load balancing. Your answers to these will affect what algorithms you use locally and globally, and may be affected by your tolerance for numerical accuracy.

Since performance is key, we should focus on those aspects of the program that lead to high performance, or that might degrade performance. Given a parallel program, the performance keys are high locality and little synchronization. This has different meanings at different levels of parallelism. At the lowest levels of parallelism, locality is implemented in registers; the compiler manages register allocation to minimize memory accesses. We expect synchronization at the lower levels to be handled in hardware, almost for free, but we want the compiler to find enough instruction-level parallelism to exploit the functional units efficiently.

Between cores or sockets, locality is implemented in cache memory. We want the application to be organized to take advantage of the improved performance of caches for spatially and temporally local memory references. Modern cache memory hierarchies are large (12MB is not uncommon), but large parallel datasets can be huge (6GB is often considered small). Cache memory locality is typically optimized by loop tiling, usually manually in the program, but sometimes by the compiler. Cache memory locality for parallel cores can be hard to manage since some levels of the cache are shared between cores. This implies that we want those cores to share the data at that level in the cache, to avoid the cores interfering with each other. Cores on processors in separate sockets don’t share cache, so we’d like those cores to not share data, at least not very often, so the caches don’t thrash. Synchronization between cores that share memory is typically done through the memory, using locks or semaphores. It can be challenging to get these primitives correct and inserted in a way that gives high performance. Transactional memory has been proposed as a mechanism to simplify parallel programming. It treats shared data structure updates as atomic transactions, the same way a database implementation treats database updates. An implementation allows updates to separate areas of the shared data structure to proceed speculatively in parallel without explicit locks, although under the hood, as with databases, the transaction commit does use locks and incurs additional cost to verify that the transaction will behave as if it were truly atomic.

Any Single Program-Multiple Data (SPMD) program, whether MPI, Unified Parallel C, using coarrays in Fortran, or other method, requires the user to manage data locality explicitly in the program. In an MPI program, the programmer specifies what data to allocate on each node (MPI rank), and when to send or receive data from other nodes. In UPC or coarrays in Fortran, the programmer uses an additional index (or indices), the UPC shared array dimension or coarray image codimensions, to determine on which thread or image (i.e., node) the data resides. Using MPI, the program uses explicit messages; messages can have additional costs, such as implicit data copies and buffers on the sender or receiver side. However, messages also carry synchronization information, “the data is ready, and here’s the data,” along with the data. With an implicit or global address space model, the program must include separate synchronization primitives, as with a shared memory model. Neither is perfect, and both can be prone to errors.

If accelerators become common, then programs have to explicitly or implicitly be partitioned into CPU and accelerator parts. Current accelerators, such as GPUs, use a separate address space and physical memory. I hear predictions that on-chip accelerators, such as promised by the AMD Fusion devices, will solve this problem. I doubt this. Accelerators are designed for high-bandwidth memory access to support large data structures, whereas CPUs are designed for low latency operations. The CPU is supported by a deep cache hierarchy, which won’t help the accelerator, and current accelerators use a different memory implementation than a CPU. Today’s AMD Llano and Intel’s Sandy Bridge combine a relatively low-performance GPU on the CPU chip, designed to replace the integrated graphics chip that appears on many motherboards. These GPUs share the physical memory with the CPU, as those integrated graphics chips do, though not the same virtual address space. Such a solution incurs a performance penalty for not having dedicated graphics memory. Another approach would be to integrate the virtual address space of CPU and accelerator, while still maintaining the separate latency-oriented memory structure for data accessed from the CPU and bandwidth-oriented memory for accelerator data. Such an approach is used on Convey hybrid computers, with hardware to manage coherence between the CPU and accelerator, though again with performance penalties when CPU or accelerator accesses the other memory. The ultimate goal of full performance, coherent memory access across CPU and accelerator will be difficult to achieve.

The job of expressing parallelism is much more difficult today than it should be. This is largely because we have to include locality (data distribution) and synchronization (messages or explicit synchronization), and we have to express different levels of parallelism explicitly. If we want to target a multi-node, multi-core, accelerator based system, we might need to express message passing between the nodes, shared memory parallelism across cores within a node concurrently with accelerator parallelism on that node, and still leave enough vector parallelism to get the peak performance on each core. While some of this task is creative, much of it is mechanical. Choosing whether to distribute data by rows, columns, or panels can be a creative task, much as choosing a sparse matrix layout is creative. Inserting message primitives or optimizing synchronization placement is largely mechanical, and our programming mechanism should be able to handle this.

Exploiting Parallelism

The final step is to take the parallelism we’ve exposed and expressed and to map it to the target machine. With current MPI programs, this is a simple mechanical task, since all the work was done by the programmer. We should demand more from our implementation. We should want more flexibility across many dimensions, including scalability, dynamic parallelism, composability, load balancing, as well as productivity. Let’s take each in turn.

Scalability: The usual discussion of scalability is to be able to write programs that scale up to massive amounts of parallelism. In the exascale world, we need to have the right algorithms with enough parallelism to give us that level of performance; making those choices is a creative task, and we can’t expect to automate that. However, we should demand that the same program can be scaled down to run efficiently on our (smaller) terascale systems, our clusters, our workstations, and even our laptops. Automatically scaling down should be easier than automatically scaling up; in fact, it should be mostly mechanical, choosing which levels of parallelism to scale back or scalarize entirely. If the parallelism is expressed opaquely in the program (as with an MPI library), such decisions must be made by the programmer; we should design better programming strategies.

Dynamic parallelism: Most of the current large-scale parallel programming models are static: MPI mostly requires the processes to be created at program startup, though MPI-2 does add some weak support for dynamic process creation. Coarray Fortran and UPC similarly start a static number of images or threads. High Performance Fortran suffered from the same weakness. Shared memory models are often more dynamic; OpenMP can dynamically create nested parallel regions, and dynamically create tasks within each region, though the number of actual threads for each region is fixed. Cilk allows spawning of parallel strands, though the parallelism is exploited at runtime by some number of threads or processors managed by the runtime. The more recent High Productivity Programming Languages X10, Chapel and Fortress have more support for dynamic parallelism, and some traction among small groups of users, so perhaps there’s hope.

Composability: However I express my basic operations, the implementation must be able to efficiently compose these for the target processor. For instance, if I should write in Fortran:

    r = sum( x(:) * y(:) )

the definition is that the array product x(:)*y(:) be computed and stored in a temporary array, possibly dynamically allocated, then the elements of the temporary array are summed. However, the implementation shouldn’t have to create the temporary array; if this is being executed in scalar mode, the implementation should be just as efficient as the corresponding loop:

    r = 0     do i = . . .      r = r + x(i)*y(i)     enddo

If this is executed in parallel, each thread or process should be able to accumulate its partial sum efficiently in scalar mode, then the partial sums combined appropriately, with only one temporary scalar per thread. Some approaches to HPC are weak with respect to composability, as I’ll point out in the next column.

Load Balancing: Researchers in the past have developed implementations of parallel systems that monitor the performance across the cores and nodes, and redistribute the work and even the data to balance the load and improve the performance. With low-level parallel programming, work and data distribution is opaque to the runtime system, but there’s no reason we can’t change that. This requires certain characteristics of the program to be exposed to the implementation, such as the data and work distribution, so it can be measured and managed.

There’s a great deal of work in runtime optimization, ranging from systems that vary runtime parameters such as tile sizes to tune for cache locality, all the way to managed languages that compile the hot routines to native code and even specializing the code for runtime values. At least some of these are ripe for industrialization in the HPC space.

Productivity: In the past, productivity in HPC focused on how close the application could get to the peak performance of the computer. This is still important; no one would argue that we should use these 100-million-dollar mega-computers inefficiently. However, even at that price, the cost of the 1,000+ scientists and engineers that will use the machine approaches or exceeds the cost of the hardware. So, however measured, we want to make productive use of the machine, and make productive use of our time.

Many argue that we want our scientists (astronomers, chemists, physicists, biologists) to be able to directly program these machines with the same productivity as when they use Matlab or Mathematica. I’m going out on a limb here; I don’t see these astronomers polishing their own mirrors for large, multi-million dollar telescopes. I don’t see physicists winding wires around superconducting magnets for the colliders, or biologists constructing scanning, tunneling electron microscopes. Of course, early astronomers really did grind lenses and polish mirrors, but now they specify the design and hire an expert to do that for them. Why should we not expect the same protocol for high end computing? Why should scientists not hire an HPC expert to build and tune the program? Yes, software is fundamentally different than a piece of hardware, but the goals are not just the specification and implementation of an algorithm, but the expression of that algorithm that provides enough performance to change the nature of science that we can perform. If that’s not enough motivation to invest in expert programmers, what is?

So what are the characteristics of a programming method for the coming exascale systems? How different will it be from what we have today? That is the topic of my third, and hopefully final, column on exascale programming.

About the Author

Michael Wolfe has developed compilers for over 30 years in both academia and industry, and is now a senior compiler engineer at The Portland Group, Inc. (www.pgroup.com), a wholly-owned subsidiary of STMicroelectronics, Inc. The opinions stated here are those of the author, and do not represent opinions of The Portland Group, Inc. or STMicroelectronics, Inc.

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!

Musk’s Latest Startup Eyes Brain-Computer Links

April 21, 2017

Elon Musk, the auto and space entrepreneur and severe critic of artificial intelligence, is forming a new venture that reportedly will seek to develop an interface between the human brain and computers. Read more…

By George Leopold

MIT Mathematician Spins Up 220,000-Core Google Compute Cluster

April 21, 2017

On Thursday, Google announced that MIT math professor and computational number theorist Andrew V. Sutherland had set a record for the largest Google Compute Engine (GCE) job. Sutherland ran the massive mathematics workload on 220,000 GCE cores using preemptible virtual machine instances. Read more…

By Tiffany Trader

Nvidia P100 Shows 1.3-2.3x Speedup Over K80 GPU on Financial Apps

April 20, 2017

When it comes to the true performance of the latest silicon, every end user knows that the best processor is the one that works best for their application. Read more…

By Tiffany Trader

Quantum Adds Global Smarts to StorNext File System

April 20, 2017

Companies that use Quantum’s StorNext platform to store massive amounts of data this week got a glimpse of new storage capabilities that should make it easier to access their data horde from anywhere in the world. Read more…

By Alex Woodie

HPE Extreme Performance Solutions

HPC-Driven Weather Simulations Improving Forecasting Capabilities

In September of 1938, a massive hurricane traversed the Atlantic Ocean and made landfall in New England. Due to inadequate and incorrect forecasting, the storm struck farther north and with greater intensity than had been predicted, leaving residents and authorities with virtually no warning or time to properly prepare. Read more…

Scaling an HPC Career in Nepal Can Be a Steep Climb

April 20, 2017

Umesh Upadhyaya works as an IT Associate at the International Centre for Integrated Mountain Development (ICIMOD) in Nepal, which supports the country’s one and only HPC facility. He is directly involved in an initiative that focuses on climate change and atmosphere modeling Read more…

By Nages Sieslack

Hyperion (IDC) Paints a Bullish Picture of HPC Future

April 20, 2017

Hyperion Research – formerly IDC’s HPC group – yesterday painted a fascinating and complicated portrait of the HPC community’s health and prospects at the HPC User Forum held in Albuquerque, NM. HPC sales are up and growing ($22 billion, all HPC segments, 2016). Read more…

By John Russell

Intel Open Sources All Lustre Work, Brent Gorda Exits

April 19, 2017

In a letter to the Lustre community posted on the Intel website, Vice President of Intel's Data Center Group Trish Damkroger writes that effective immediately the company will be contributing all Lustre development to the open source community. Damkroger also announced that Brent Gorda, General Manager, High Performance Data Division at Intel is leaving the company. Read more…

By Tiffany Trader

Facebook Open Sources Caffe2; Nvidia, Intel Rush to Optimize

April 18, 2017

From its F8 developer conference in San Jose, Calif., today, Facebook announced Caffe2, a new open-source, cross-platform framework for deep learning. Caffe2 is the successor to Caffe, the deep learning framework developed by Berkeley AI Research and community contributors. Read more…

By Tiffany Trader

Hyperion (IDC) Paints a Bullish Picture of HPC Future

April 20, 2017

Hyperion Research – formerly IDC’s HPC group – yesterday painted a fascinating and complicated portrait of the HPC community’s health and prospects at the HPC User Forum held in Albuquerque, NM. HPC sales are up and growing ($22 billion, all HPC segments, 2016). Read more…

By John Russell

Knights Landing Processor with Omni-Path Makes Cloud Debut

April 18, 2017

HPC cloud specialist Rescale is partnering with Intel and HPC resource provider R Systems to offer first-ever cloud access to Xeon Phi "Knights Landing" processors. The infrastructure is based on the 68-core Intel Knights Landing processor with integrated Omni-Path fabric (the 7250F Xeon Phi). Read more…

By Tiffany Trader

CERN openlab Explores New CPU/FPGA Processing Solutions

April 14, 2017

Through a CERN openlab project known as the ‘High-Throughput Computing Collaboration,’ researchers are investigating the use of various Intel technologies in data filtering and data acquisition systems. Read more…

By Linda Barney

DOE Supercomputer Achieves Record 45-Qubit Quantum Simulation

April 13, 2017

In order to simulate larger and larger quantum systems and usher in an age of “quantum supremacy,” researchers are stretching the limits of today’s most advanced supercomputers. Read more…

By Tiffany Trader

Penguin Takes a Run at the Big Cloud Providers

April 12, 2017

HPC specialist Penguin Computing recently re-ran benchmarks from a study of its larger brethren and says the results show its ‘public cloud’ – Penguin on Demand (POD) – is among the leaders in cost and performance. Read more…

By John Russell

Nvidia Responds to Google TPU Benchmarking

April 10, 2017

Nvidia highlights strengths of its newest GPU silicon in response to Google's report on the performance and energy advantages of its custom tensor processor. Read more…

By Tiffany Trader

HPC and the Colocation Datacenter – a Bridge Too Far?

April 7, 2017

A more standardised HPC platform approach is making the running of HPC projects within increasing financial reach. Read more…

By Clive Longbottom, Quocirca

Google Pulls Back the Covers on Its First Machine Learning Chip

April 6, 2017

This week Google released a report detailing the design and performance characteristics of the Tensor Processing Unit (TPU), its custom ASIC for the inference phase of neural networks (NN). Read more…

By Tiffany Trader

Google Pulls Back the Covers on Its First Machine Learning Chip

April 6, 2017

This week Google released a report detailing the design and performance characteristics of the Tensor Processing Unit (TPU), its custom ASIC for the inference phase of neural networks (NN). Read more…

By Tiffany Trader

Quantum Bits: D-Wave and VW; Google Quantum Lab; IBM Expands Access

March 21, 2017

For a technology that’s usually characterized as far off and in a distant galaxy, quantum computing has been steadily picking up steam. Read more…

By John Russell

Trump Budget Targets NIH, DOE, and EPA; No Mention of NSF

March 16, 2017

President Trump’s proposed U.S. fiscal 2018 budget issued today sharply cuts science spending while bolstering military spending as he promised during the campaign. Read more…

By John Russell

HPC Compiler Company PathScale Seeks Life Raft

March 23, 2017

HPCwire has learned that HPC compiler company PathScale has fallen on difficult times and is asking the community for help or actively seeking a buyer for its assets. Read more…

By Tiffany Trader

Nvidia Responds to Google TPU Benchmarking

April 10, 2017

Nvidia highlights strengths of its newest GPU silicon in response to Google's report on the performance and energy advantages of its custom tensor processor. Read more…

By Tiffany Trader

For IBM/OpenPOWER: Success in 2017 = (Volume) Sales

January 11, 2017

To a large degree IBM and the OpenPOWER Foundation have done what they said they would – assembling a substantial and growing ecosystem and bringing Power-based products to market, all in about three years. Read more…

By John Russell

CPU-based Visualization Positions for Exascale Supercomputing

March 16, 2017

In this contributed perspective piece, Intel’s Jim Jeffers makes the case that CPU-based visualization is now widely adopted and as such is no longer a contrarian view, but is rather an exascale requirement. Read more…

By Jim Jeffers, Principal Engineer and Engineering Leader, Intel

TSUBAME3.0 Points to Future HPE Pascal-NVLink-OPA Server

February 17, 2017

Since our initial coverage of the TSUBAME3.0 supercomputer yesterday, more details have come to light on this innovative project. Of particular interest is a new board design for NVLink-equipped Pascal P100 GPUs that will create another entrant to the space currently occupied by Nvidia's DGX-1 system, IBM's "Minsky" platform and the Supermicro SuperServer (1028GQ-TXR). Read more…

By Tiffany Trader

Leading Solution Providers

Tokyo Tech’s TSUBAME3.0 Will Be First HPE-SGI Super

February 16, 2017

In a press event Friday afternoon local time in Japan, Tokyo Institute of Technology (Tokyo Tech) announced its plans for the TSUBAME3.0 supercomputer, which will be Japan’s “fastest AI supercomputer,” Read more…

By Tiffany Trader

IBM Wants to be “Red Hat” of Deep Learning

January 26, 2017

IBM today announced the addition of TensorFlow and Chainer deep learning frameworks to its PowerAI suite of deep learning tools, which already includes popular offerings such as Caffe, Theano, and Torch. Read more…

By John Russell

Is Liquid Cooling Ready to Go Mainstream?

February 13, 2017

Lost in the frenzy of SC16 was a substantial rise in the number of vendors showing server oriented liquid cooling technologies. Three decades ago liquid cooling was pretty much the exclusive realm of the Cray-2 and IBM mainframe class products. That’s changing. We are now seeing an emergence of x86 class server products with exotic plumbing technology ranging from Direct-to-Chip to servers and storage completely immersed in a dielectric fluid. Read more…

By Steve Campbell

BioTeam’s Berman Charts 2017 HPC Trends in Life Sciences

January 4, 2017

Twenty years ago high performance computing was nearly absent from life sciences. Today it’s used throughout life sciences and biomedical research. Genomics and the data deluge from modern lab instruments are the main drivers, but so is the longer-term desire to perform predictive simulation in support of Precision Medicine (PM). There’s even a specialized life sciences supercomputer, ‘Anton’ from D.E. Shaw Research, and the Pittsburgh Supercomputing Center is standing up its second Anton 2 and actively soliciting project proposals. There’s a lot going on. Read more…

By John Russell

HPC Startup Advances Auto-Parallelization’s Promise

January 23, 2017

The shift from single core to multicore hardware has made finding parallelism in codes more important than ever, but that hasn’t made the task of parallel programming any easier. Read more…

By Tiffany Trader

HPC Technique Propels Deep Learning at Scale

February 21, 2017

Researchers from Baidu’s Silicon Valley AI Lab (SVAIL) have adapted a well-known HPC communication technique to boost the speed and scale of their neural network training and now they are sharing their implementation with the larger deep learning community. Read more…

By Tiffany Trader

US Supercomputing Leaders Tackle the China Question

March 15, 2017

Joint DOE-NSA report responds to the increased global pressures impacting the competitiveness of U.S. supercomputing. Read more…

By Tiffany Trader

IDG to Be Bought by Chinese Investors; IDC to Spin Out HPC Group

January 19, 2017

US-based publishing and investment firm International Data Group, Inc. (IDG) will be acquired by a pair of Chinese investors, China Oceanwide Holdings Group Co., Ltd. Read more…

By Tiffany Trader

  • arrow
  • Click Here for More Headlines
  • arrow
Share This