SC17: Legion Seeks to Elevate HPC Programming

By Tiffany Trader

November 9, 2017

As modern HPC architectures become ever more complex, so too does the task of programming these machines. In the quest for the trifecta of better performance, portability and programmability, new HPC programming systems are being developed. The Legion programming system, a data-centric parallel programming system for writing portable high performance programs, is one such effort that is being developed at Stanford University in collaboration with Nvidia and several U.S. Department of Energy labs.

In this Q&A, Stanford University Computer Science Chair Alex Aiken and Nvidia Chief Scientist Bill Dally provide an overview of Legion, its goals and its relevance for exascale computing. Aiken will hold a tutorial on the Legion programming model this Sunday at SC17 in Denver from 1:30-5pm MT.

HPCwire: Let’s start with a basic, but important question: why does HPC need new programming models?

Alex Aiken, professor and the chair of computer science at Stanford

Alex Aiken and Bill Dally: New programming models are needed to raise the level of programming to enhance portability across types and generations of high-performance computers. Today programmers specify low-level details, like how much parallelism to exploit, and how to stage data through levels of memory. These low-level details tie an application to the performance of a specific machine, and the effort required to modify the code to target future machines is becoming a major obstacle to actually doing high performance computing. By elevating the level of programming, these target-dependent decisions can be made by the programming system, making it easier to write performant codes, and making the codes themselves performance portable.

HPCwire: What is the Legion programming system? What are the main goals of the project?

Aiken and Dally: Legion is a new programming model for modern supercomputing systems that aims to provide excellent performance, portability, and scalability of application codes across a wide range of hardware. A Legion application is composed of tasks written in language of the programmer’s choice, such as C++, CUDA, Fortran, or OpenACC. Legion tasks specify which “regions” of data they will access as well as what kinds of accesses will be performed. Knowledge of the data used by each task allows Legion to confer many benefits to application developers:

Bill Dally, Nvidia chief scientist & Stanford professor

First, a Legion programming system can analyze the tasks and their data usage to automatically and safely infer parallelism and perform the scheduling transformations necessary to fill an exascale machine, even if the code was written in an apparently-sequential style.

Second, the programming system’s knowledge of which data will be accessed by each task allows Legion to automatically insert the necessary data movement for a complex memory hierarchy, greatly simplifying application code and reducing (or often eliminating) idle cyclems on processors waiting for necessary data to arrive.

Finally, Legion’s machine-agnostic description of an application in terms of tasks and regions decouples the process of specifying an application from the determination of how it is mapped to a target machine. This allows the porting and tuning of an application to be done independently from its development and facilitates tuning by machine experts or even a machine learning algorithm. This makes Legion programs inherently performance portable.

HPCwire: The DOE is investing in Legion development as part as part its exascale program. How is Legion positioned to address the challenges of exascale?

Aiken and Dally: Legion is designed for exascale computation. Legion guarantees that parallel execution has the same result as sequential execution, which is a huge advantage for debugging at scale. Legion also provides rich capabilities for describing how a Legion program uses its data. Since managing and moving data is the limiter in many current petascale and future exascale applications, these features give Legion the information it needs to do a much better job of managing data placement and movement than current programming systems. Legion is also highly asynchronous, avoiding the global synchronization constructs which only become more expensive on larger machines. Finally, under the hood, the Legion implementation exploits the extra information it has about a program’s data and its asynchronous capabilities to the hilt, performing much more sophisticated static and dynamic analysis of programs than is possible in current systems to support Legion’s higher level of abstraction while providing scalable and portable performance.

HPCwire: Why is Nvidia involved in Legion? How does Legion fit into Nvidia’s vision for computing?

Dally: Nvidia wants to make it easy for people to develop production application codes that can scale to exascale machines and easily be ported between supercomputers with different GPU generations, numbers of GPUs, and different sized memory hierarchies. By letting programmers specify target-independent codes at a high level, leaving the mapping decisions to the programming system, Legion accomplishes these goals.

Nvidia is also very excited to collaborate with leading researchers from Stanford University and Los Alamos National Lab to move this technology forward.

HPCwire: One of the stated goals/features of Legion is performance portability; at a high-level, how does it achieve this?

Aiken and Dally: Performance portability is achieved in Legion through a strict separation of concerns: we aim to completely decouple the description of the computation from how it is mapped to the target machine. This approach manifests itself explicitly in the programming model: all Legion programs consist of two parts: a machine-independent specification that describes the computation abstractly without any machine details, and one or more application- and/or machine-specific mappers that make policy decisions about how the application should be executed on the target machine. Machine-independent applications can therefore be written once and easily migrated to new machines only by changing the mapping decisions. Importantly, mapping decisions can only impact the performance of the code and never the correctness as the programming system uses program analysis to determine if any data movement and synchronization is necessary to satisfy the mapping decisions.

HPCwire: Alex, what will you be covering in your SC17 tutorial on Sunday and who should attend?

Aiken: The tutorial will cover the major features of the Legion programming system and will be hands-on; participants will be writing programs almost from the start and every concept will be illustrated with a small programming exercise. Anyone who is interested in learning something about the benefits and state of the art of task-based programming models, and of Legion specifically, should find the tutorial useful.

HPCwire: What is the most challenging part of developing a new HPC programming model?

Aiken and Dally: The most challenging part is managing expectations. Is it easy to forget that it took MPI more than 15 years from the time that the initial prototypes were proposed to when really solid implementations were available for use. Many users are expecting new HPC programming models such as Legion to mature much faster than this. We’ve been lucky to collaborate with groups like Jackie Chen’s combustion group at Sandia National Lab, the FleCSi team at Los Alamos National Lab, and the LCLS-II software team at SLAC that are willing to work with us on real applications that push us through our growing pains and ensure the end result will be one that is broadly useful in the HPC programming ecosystem.

HPCwire: How hard is it for an HPC programmer with a legacy application to migrate that application to Legion?

Aiken and Dally: Legion is designed to facilitate the incremental migration of an MPI-based application. Legion interoperates with MPI, allowing a porting effort to focus on moving the performance-critical sections (e.g., the main time-stepping loop or a key solver) to Legion tasks while leaving other parts of the application such as initialization or file I/O in their original MPI-based form. And since Legion operates at the granularity of tasks, the compute heavy “inner loops” from the original optimized application code can often be used directly as the body of newly-created Legion tasks.

As an example, the combustion simulation application S3D, developed at Sandia National Labs, consists of over 200,000 lines of Fortran+MPI code, but only two engineer-months of effort were required to port the main integration loop to Legion. The integration loop comprises only 15 percent of the overall code base, but consumes 97 percent of the cycles during execution. Although still contained in the original Fortran shell, the use of the Legion version of the integration loop allows S3D to run more than 4x faster than the original Fortran version, and over 2x faster than other GPU-accelerated versions of the code.

The above figure shows the architecture of the Legion programming system. Applications targeting Legion have the option of either being written in the Regent programming language or written directly to the Legion C++ runtime interface. Applications written in Regent are compiled to LLVM (and call a C wrapper for the C++ runtime API). Additional info.
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!

SRC Spends $200M on University Research Centers

January 16, 2018

The Semiconductor Research Corporation, as part of its JUMP initiative, has awarded $200 million to fund six research centers whose areas of focus span cognitive computing, memory-centric computing, high-speed communicat Read more…

By John Russell

US Seeks to Automate Video Analysis

January 16, 2018

U.S. military and intelligence agencies continue to look for new ways to use artificial intelligence to sift through huge amounts of video imagery in hopes of freeing analysts to identify threats and otherwise put their Read more…

By George Leopold

URISC@SC17 and the #LongestLastMile

January 11, 2018

A multinational delegation recently attended the Understanding Risk in Shared CyberEcosystems workshop, or URISC@SC17, in Denver, Colorado. URISC participants and presenters from 11 countries, including eight African nations, 12 U.S. states, Canada, India and Nepal, also attended SC17, the annual international conference for high performance computing, networking, storage and analysis that drew nearly 13,000 attendees. Read more…

By Elizabeth Leake, STEM-Trek Nonprofit

HPE Extreme Performance Solutions

HPE and NREL Take Steps to Create a Sustainable, Energy-Efficient Data Center with an H2 Fuel Cell

As enterprises attempt to manage rising volumes of data, unplanned data center outages are becoming more common and more expensive. As the cost of downtime rises, enterprises lose out on productivity and valuable competitive advantage without access to their critical data. Read more…

When the Chips Are Down

January 11, 2018

In the last article, "The High Stakes Semiconductor Game that Drives HPC Diversity," I alluded to the challenges facing the semiconductor industry and how that may impact the evolution of HPC systems over the next few years. I thought I’d lift the covers a little and look at some of the commercial challenges that impact the component technology we use in HPC. Read more…

By Dairsie Latimer

SRC Spends $200M on University Research Centers

January 16, 2018

The Semiconductor Research Corporation, as part of its JUMP initiative, has awarded $200 million to fund six research centers whose areas of focus span cognitiv Read more…

By John Russell

When the Chips Are Down

January 11, 2018

In the last article, "The High Stakes Semiconductor Game that Drives HPC Diversity," I alluded to the challenges facing the semiconductor industry and how that may impact the evolution of HPC systems over the next few years. I thought I’d lift the covers a little and look at some of the commercial challenges that impact the component technology we use in HPC. Read more…

By Dairsie Latimer

How Meltdown and Spectre Patches Will Affect HPC Workloads

January 10, 2018

There have been claims that the fixes for the Meltdown and Spectre security vulnerabilities, named the KPTI (aka KAISER) patches, are going to affect applicatio Read more…

By Rosemary Francis

Momentum Builds for US Exascale

January 9, 2018

2018 looks to be a great year for the U.S. exascale program. The last several months of 2017 revealed a number of important developments that help put the U.S. Read more…

By Alex R. Larzelere

ANL’s Rick Stevens on CANDLE, ARM, Quantum, and More

January 8, 2018

Late last year HPCwire caught up with Rick Stevens, associate laboratory director for computing, environment and life Sciences at Argonne National Laboratory, f Read more…

By John Russell

Chip Flaws ‘Meltdown’ and ‘Spectre’ Loom Large

January 4, 2018

The HPC and wider tech community have been abuzz this week over the discovery of critical design flaws that impact virtually all contemporary microprocessors. T Read more…

By Tiffany Trader

The @hpcnotes Predictions for HPC in 2018

January 4, 2018

I’m not averse to making predictions about the world of High Performance Computing (and Supercomputing, Cloud, etc.) in person at conferences, meetings, causa Read more…

By Andrew Jones

Fast Forward: Five HPC Predictions for 2018

December 21, 2017

What’s on your list of high (and low) lights for 2017? Volta 100’s arrival on the heels of the P100? Appearance, albeit late in the year, of IBM’s Power9? Read more…

By John Russell

US Coalesces Plans for First Exascale Supercomputer: Aurora in 2021

September 27, 2017

At the Advanced Scientific Computing Advisory Committee (ASCAC) meeting, in Arlington, Va., yesterday (Sept. 26), it was revealed that the "Aurora" supercompute Read more…

By Tiffany Trader

Japan Unveils Quantum Neural Network

November 22, 2017

The U.S. and China are leading the race toward productive quantum computing, but it's early enough that ultimate leadership is still something of an open questi Read more…

By Tiffany Trader

AMD Showcases Growing Portfolio of EPYC and Radeon-based Systems at SC17

November 13, 2017

AMD’s charge back into HPC and the datacenter is on full display at SC17. Having launched the EPYC processor line in June along with its MI25 GPU the focus he 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

IBM Begins Power9 Rollout with Backing from DOE, Google

December 6, 2017

After over a year of buildup, IBM is unveiling its first Power9 system based on the same architecture as the Department of Energy CORAL supercomputers, Summit a Read more…

By Tiffany Trader

Fast Forward: Five HPC Predictions for 2018

December 21, 2017

What’s on your list of high (and low) lights for 2017? Volta 100’s arrival on the heels of the P100? Appearance, albeit late in the year, of IBM’s Power9? Read more…

By John Russell

GlobalFoundries Puts Wind in AMD’s Sails with 12nm FinFET

September 24, 2017

From its annual tech conference last week (Sept. 20), where GlobalFoundries welcomed more than 600 semiconductor professionals (reaching the Santa Clara venue Read more…

By Tiffany Trader

Chip Flaws ‘Meltdown’ and ‘Spectre’ Loom Large

January 4, 2018

The HPC and wider tech community have been abuzz this week over the discovery of critical design flaws that impact virtually all contemporary microprocessors. T Read more…

By Tiffany Trader

Leading Solution Providers

Perspective: What Really Happened at SC17?

November 22, 2017

SC is over. Now comes the myriad of follow-ups. Inboxes are filled with templated emails from vendors and other exhibitors hoping to win a place in the post-SC thinking of booth visitors. Attendees of tutorials, workshops and other technical sessions will be inundated with requests for feedback. Read more…

By Andrew Jones

Tensors Come of Age: Why the AI Revolution Will Help HPC

November 13, 2017

Thirty years ago, parallel computing was coming of age. A bitter battle began between stalwart vector computing supporters and advocates of various approaches to parallel computing. IBM skeptic Alan Karp, reacting to announcements of nCUBE’s 1024-microprocessor system and Thinking Machines’ 65,536-element array, made a public $100 wager that no one could get a parallel speedup of over 200 on real HPC workloads. Read more…

By John Gustafson & Lenore Mullin

Delays, Smoke, Records & Markets – A Candid Conversation with Cray CEO Peter Ungaro

October 5, 2017

Earlier this month, Tom Tabor, publisher of HPCwire and I had a very personal conversation with Cray CEO Peter Ungaro. Cray has been on something of a Cinderell Read more…

By Tiffany Trader & Tom Tabor

Flipping the Flops and Reading the Top500 Tea Leaves

November 13, 2017

The 50th edition of the Top500 list, the biannual publication of the world’s fastest supercomputers based on public Linpack benchmarking results, was released Read more…

By Tiffany Trader

GlobalFoundries, Ayar Labs Team Up to Commercialize Optical I/O

December 4, 2017

GlobalFoundries (GF) and Ayar Labs, a startup focused on using light, instead of electricity, to transfer data between chips, today announced they've entered in Read more…

By Tiffany Trader

HPC Chips – A Veritable Smorgasbord?

October 10, 2017

For the first time since AMD's ill-fated launch of Bulldozer the answer to the question, 'Which CPU will be in my next HPC system?' doesn't have to be 'Whichever variety of Intel Xeon E5 they are selling when we procure'. Read more…

By Dairsie Latimer

Nvidia, Partners Announce Several V100 Servers

September 27, 2017

Here come the Volta 100-based servers. Nvidia today announced an impressive line-up of servers from major partners – Dell EMC, Hewlett Packard Enterprise, IBM Read more…

By John Russell

Intel Delivers 17-Qubit Quantum Chip to European Research Partner

October 10, 2017

On Tuesday, Intel delivered a 17-qubit superconducting test chip to research partner QuTech, the quantum research institute of Delft University of Technology (TU Delft) in the Netherlands. The announcement marks a major milestone in the 10-year, $50-million collaborative relationship with TU Delft and TNO, the Dutch Organization for Applied Research, to accelerate advancements in quantum computing. Read more…

By Tiffany Trader

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