HPC Coding: The Power of L(o)osing Control

By Tobias Weinzierl

August 16, 2018

Presented is a summary of the ISC18 workshop “The power of l(o)osing control,” which asked the question: “when does a re-implementation of mature simulation fragments with novel HPC paradigms pay off?”

Exascale roadmaps, exascale projects and exascale lobbyists ask, on-again-off-again, for a fundamental rewrite of major code building blocks. Otherwise, so they claim, codes will not scale up. Naturally, some exascale projects bombard computational scientists with new domain-specific or domain-tailored languages, compiler extensions, frameworks, libraries and programming paradigms. The projects receive, in return, rewrites of simulation codes that are significantly faster. After a while. Or they get nothing at all, as users of the all the splendid new ideas find out that the proposed is not a fit to their requirements, the wheel of exascale innovations has already turned once more, or the rewrites have been that little bit more complex and more time-consuming than anticipated so that a complete rewrite finally became unfeasible. For our methodological evangelist, developing frameworks, languages, libraries, whatever would be such a joy, if only there were no or at least competent users . . .

The ISC18 workshop “The power of l(o)osing control”, organised by Tobias Weinzierl, did ask “when does a re-implementation of mature simulation fragments with novel HPC paradigms pay off?” More precisely, the organiser did ask “where is the pain barrier where consortia are willing to rewrite major code parts?”, “to which degree are mature simulation codes willing to give up control of SIMDsation, task scheduling, data placement, and so forth?” and “what information (arithmetic intensity, affinity, dependencies) should new paradigms expect their user codes to provide explicitly to frameworks?” Some answers to these questions from the workshop are summarised below. Even more questions did arise however.

I’m so sick of rewriting my code every time a new exascale project comes around the corner.   The workshop kicked off with historical remarks by Tobias. When his software base underlying the H2020 FETHPC project ExaHyPE [1] was first developed as a heroic green-field approach, caches and careful memory usage used to be the non plus ultra. So the code was made to support extremely dynamic and adaptive meshes. Soon after, vectorisation and multicores became headliners on the center stage. This made the developers rewrite significant code parts into regular data structures fitting to parallel fors—just to learn afterwards that task-based parallelism is the new kid on the block everybody loves most. Today, the code tasks. But the developers didn’t win that much in terms of productivity, as they now have to think about proper task sizes, task priorities, mapping of tasks to MPI calls, and so forth. They feel being caught in a never-ending rewrite of core code parts as hardware and programming paradigms evolve. The code at no point had been future-proof.

We took away their scheduling ownership, now we have to get their data structures.   The actual workshop followed this introduction. It featured six talks. Nathan Ellingwood from Sandia pointed out that their Kokkos project [2] started from a few heroic research code endeavours, too. It had been after that that they started to roll their ideas out as general-purpose ecosystem for legacy codes. One of Kokkos’ key techniques to obtain scaling code goes one step beyond the rewrites Tobias did complain about: They do not only provide parallel programming constructs. They also encourage the user to model their codes explicitly in terms of abstract data structures.

Nathan’s talk pointed out that working, i.e., scaling HPC DSLs and frameworks rely on data structures plus execution patterns. Teaming them up allows middleware or runtimes to deliver performance by choosing the right data structure realisation plus concurrency for the right platform. If we only focus on parallel programming constructs, it is, to some degree, not surprising if rewrites fail to deliver.

Thomas Fahringer discussed the rationale and lessons learned through the AllScale project [3]. He opened his presentation with the statement “I don’t believe in MPI+X+Y”. And notably, he doesn’t believe in task-based programming as the silver bullet for scalability either. Going one step beyond Nathan’s talk, he proposed to re-specify all codes in terms of their data structures plus concurrency, too, but to ask a compiler to derive the tasks and parallel constructs from hereon. The abstraction of data access plus data structure is not realised within a library or runtime, but made part of the actual translator. It can then rely on many complex code optimisation techniques such as the fusion of various parallel code regions. As such, “giving up control” is not a flaw, problem or challenge. Thomas: “It is a design principle.”

Richard Bower from Durham’s Institute of Computational Cosmology (ICC) seemed to be impressed by this idea. A team around him has written a major astrophysical SPH code from scratch. The new code SWIFT [4] expresses all of its data as small work items and formalises all work on these guys as tasks with dependencies. This green-field development allows their runtime to scale up. In a way, they seem also to rely on parallelism through parallel modelling of computations plus a formalisation of the used data structures. They just did it manually.

A controversial discussion broke off. How many data structures does a programming paradigm have to offer to allow scientists to write meaningful non-toy code? State-of-the-art physics combines all types of hierarchical meshes with FFTs, particle representations, and unstructured data sets. Or do sophisticated solutions always have to give the users the choice either to work with data structure specs plus tasks or solely parallel processing constructs? In this case, we would lose some of the academic purity of “giving up control”. Or do we need approaches where the user basically constructs her data structures? We did not find an answer, but it seems that thinking in tasks plus the data they work on is the right way to go: thinking only in terms of parallel fors or tasks doesn’t go far enough.

Garbage in, garbage out.   Michael Bader presented his Chameleon project [5] and added an interesting observation to this: In his work, compute nodes may steal tasks plus their data from other ranks upon demand. Michael was able to present impressive scalability. They show that stealing leverages MPI work imbalances. Coming back to the compiler vs. runtime, it seems that a conclusion whether work decomposition should be done statically or dynamically is nowhere near. There are so many great opportunities, if systems suddenly can freely distribute their tasks in a lightweight manner also beyond shared memory borders.

Richard’s endeavour computes proper work decompositions in regular intervals which can be issued by the user, while Thomas’ and Nathan’s tools take ownership of work distribution through abstract specifications of data structures. All approaches rely on the fact that the right level of concurrency is provided, and that proper heuristics—when does decomposition pay off, e.g.—do exist. As Daniel Weingaertner from the Universidade Federal do Paran`a in the audience pointed out: The art is exactly this, to hide technical details (load distribution but also tiny little parameters such as grain sizes or pinning) from the developer. And that’s where runtimes and compilers really can help. Otherwise, developers might provide garbage input data. Michael’s approach provided a useful additional dimension: His approach hinges on online performance measurements. If the conclusion holds that many compile-time, static tunings due to heuristics are doomed to fail with the complex machines we face today, his approach still will succeed. Exaggerated: There’s no such thing as garbage in (in terms of work decomposition), but there is garbage work distribution.

We use C/C++ to improve accessibility and then suffer from the language’s restrictions and syntactic overhead.   Any new programming model is worth developing if and only if there are users. And users have to be technically able to handle these models. Nathan’s, Richard’s, Thomas’ and Tobias’ approaches therefore all rely on C/C++. It seems that this language has finally become the ultimate to-be-used language. Bye, bye Fortran.

Harald Köstler kicked off his talk with “I have to say I’m surprised all people seem to use C++”. His refreshing talk was a tour de force through various studies on DSLs in HPC. They mainly orbit around stencil and multigrid codes. The ExaStencils/ExaSlang [6] project was one of them. Now, you might disagree with Harald that languages such as Scala or Lisp should be real candidates to program your next-generation-DSL—actually the majority of the audience first considered this to be a joke—but he made valid points: C++ templates are neither easy to maintain nor to use. Yet, most DSL extensions use generic meta programming. C++ itself is not a trivial, compact language. After all, it is way too generic to meet this goal. We consider it to be straightforward as we all are used to it, but how many young students bring along the right mastery of C++ already? Finally, just start to dream about opportunities that arise once you accept that you can use Just-In-Time compilation for example or stricter type checking. Indeed, Thomas had dropped an argument along these lines before: Compilers can contextualise code and tailor it to a situation. And if they fail due to a lack of information, they can at least let the user know that they’d prefer some more annotations, e.g. He admitted that compiling and understanding C++ was a painful exercise in AllScale. So maybe C++ is not the ultimate thing after all?

These computational scientists should be forced to rewrite everything from scratch from time to time anyway—this makes them tidy up their codes.  Richard and Tobias both gave talks on bigger pieces of software. While Tobias follows an incremental approach where core routines are replaced when new technologies emerge, Richard’s endeavour is a complete rewrite of well-established physics and algorithms with a task paradigm. With Tobias being unhappy about the zombie of rewrites—they never go away—it was natural to ask Richard: was it worth it?

This is a delicate question, as obviously it took his team quite a while to deliver the new code base. This is time “lost” for “actual” science. However, he came to the conclusion that it has been worth it nevertheless. It is easy to say this once your code is up and scaling, but Richard pointed out that there are two further success implications: His team has learned a lot about software. And his team has cleaned up the code.

Whenever one starts a complete rewrite, it is very human and convenient to sit down, and try to strip a code design off its historic ballast. Complete rewrites (triggering re-thinks) improve the code quality. It is however, as Richard pointed out, almost sad to recognise that interfaces then grow and become more complex again. You start with a neat, clean design and you end up again with a complex piece of code.

The Swiss army knife is just yet another framework.  The audience just started to digest Harald’s preferences for esoteric languages, when he confessed another thing: As far as he observes, most successful DSLs rely on fast and successful libraries under the hood. So the DSL’s job is not to come up with the performance. In most projects, it is its jobs to make the performance available to the user. Nathan had clarified before that Kokkos relies on BLAS et al., while Thomas’ talk did support this impression, too: His compiler also relies on libraries for performance-critical tasks. These observations relax the burden of scalability for DSLs.

In this context, Martin Kronbichler collected some ideas and lessons learned how to make a general-purpose library underlying many different codes perform. His work around deal.II [7] focuses on particular mesh types with “only” particular mesh entities and tensor-product styles, while deal.II provides manufactured data iterators and operators for popular operations. deal.II might not be a classic DSL, as it is very versatile. However, his work on purpose exploits particular characteristics and specialisations to get the whole thing fast.

Richard’s observation that their task system is tailored towards their particular application started some arguments around the question “what is a framework”? Many frameworks or libraries are probably not worth calling them that way, as they are effectively written for one particular purpose. Their programmers might claim that they are generic—they are computer scientists after all—but, at the end of the day, what they call frameworks simply realise plain functional decomposition. Different components in one piece of software do different things.

It was not clear among the workshop participants to which degree frameworks and DSLs had to be generic. Even the other way round, one might come to the conclusion that frameworks have to grow and evolve with their applications and deliver exactly the level of flexibility an actual project needs. Richard and Harald for example pointed out that they both look into structured vs. unstructured data structures or the decision when to store data as AoS or SoA. Some evergreens never disappear.

A few more implications from this project-framework co-design approach were discussed next: Richard clarified that starting from scratch is the easy part. The difficult part is to stop. Once a team has written component i itself—this will be the ultimate fit to the project— there is this temptation to write component i+1 as well. We did it for the mesh, why not also write our own load balancing? And the load balancing worked out really well (indeed it is an exact fit to our project though we are not really competitive with state-of-the-art libraries), wouldn’t it be clever to come up with our own few linear equation system solvers? And so forth . . . Perhaps the framework hasn’t been there in the first place. It grew and noone told it to stop. If this were the case, the term framework would describe a flaw rather than a cool computer science thing.

Come on, love me for the money.  Let’s forget about such heretic ideas and close the discussion with two observations. The first one was made by Richard and explicitly stated by Nathan: Their ecosystems started to flourish once they provided the right tools. Task graph plotters for task-based systems are an example. The best concept might be hard to digest if you don’t give developers the right tools that allow them to develop economically. The Kokkos and the deal.II team added the second mandatory ingredient for success: a reasonable user base and active engagement with that very base.

Both items highlight that continuous, long-term funding is essential for a successful introduction of (exascale) programming paradigms, runtimes, DSLs, compilers and frameworks. Consortia need the time and resources to build up a development ecosystem around any new programming concept and to equip them with the right tools. Establishing this does not materialise in immediate scientific output, and, at the same time, it has to start way before actual computational science can be made through a new paradigm. Well, finally there had been broad agreement among all workshop participants: The establishment of a community and ecosystem is something that requires resources, but it neither fits to standard projects of short and medium duration, nor to our project notion, which has to start from the computational challenge. In an ideal world, the ecosystem has to be there before to allow application specialists to assess it and to move into a mature environment to solve “their” problem. There should thus be more funding for the ecosystem not tied to particular application research questions.

About the Author

Tobias Weinzierl is Associate Professor at the Department of Computer Science at Durham University. His work orbits around novel algorithms and clever implementations for applications from scientific computing which employ state-of-the-art physics and mathematics. At the moment, his research focuses mainly on data flow/movement (minimisation), data structure (organisation) and programming paradigm challenges. He is particularly interested in dynamically adaptive multiscale methods based upon spacetrees that interact with multigrid solvers for elliptic and parabolic partial differential equations, that host particle systems with particles of varying cut-off radii or size, or carry Finite Volume-alike discretisations. He is involved in multiple scientific open source projects such as ExaHyPE [1] and Peano [8].

References
[1] ExaHyPE—an Exascale Hyperbolic PDE Engine. http://exahype.eu
[2] Kokkos—The C++ Performance Portability Programming Model. https://github.com/kokkos/kokkos/wiki
[3] AllScale—An Exascale Programming, Multi-objective Optimisation and Resilience Management Environment Based on Nested Recursive Parallelism. http://www.allscale.eu
[4] SWIFT—SPH With Inter-dependent Fine-grain Tasking. http://icc.dur.ac.uk/swift
[5] Chameleon—Eine Taskbasierte Programmierumgebung zur Entwicklung reaktiver HPC Anwendungen. http://www.chameleon-hpc.org
[6] Exastencils—Advanced Stencil-Code Engineering. http://www.exastencils.org
[7] deal.II—an open source finite element library. https://www.dealii.org
[8] Peano—a framework for dynamically adaptive Cartesian meshes. http://www.peanoframework.org

Subscribe to HPCwire's Weekly Update!

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

MLPerf Inference 4.0 Results Showcase GenAI; Nvidia Still Dominates

March 28, 2024

There were no startling surprises in the latest MLPerf Inference benchmark (4.0) results released yesterday. Two new workloads — Llama 2 and Stable Diffusion XL — were added to the benchmark suite as MLPerf continues Read more…

Q&A with Nvidia’s Chief of DGX Systems on the DGX-GB200 Rack-scale System

March 27, 2024

Pictures of Nvidia's new flagship mega-server, the DGX GB200, on the GTC show floor got favorable reactions on social media for the sheer amount of computing power it brings to artificial intelligence.  Nvidia's DGX Read more…

Call for Participation in Workshop on Potential NSF CISE Quantum Initiative

March 26, 2024

Editor’s Note: Next month there will be a workshop to discuss what a quantum initiative led by NSF’s Computer, Information Science and Engineering (CISE) directorate could entail. The details are posted below in a Ca Read more…

Waseda U. Researchers Reports New Quantum Algorithm for Speeding Optimization

March 25, 2024

Optimization problems cover a wide range of applications and are often cited as good candidates for quantum computing. However, the execution time for constrained combinatorial optimization applications on quantum device Read more…

NVLink: Faster Interconnects and Switches to Help Relieve Data Bottlenecks

March 25, 2024

Nvidia’s new Blackwell architecture may have stolen the show this week at the GPU Technology Conference in San Jose, California. But an emerging bottleneck at the network layer threatens to make bigger and brawnier pro Read more…

Who is David Blackwell?

March 22, 2024

During GTC24, co-founder and president of NVIDIA Jensen Huang unveiled the Blackwell GPU. This GPU itself is heavily optimized for AI work, boasting 192GB of HBM3E memory as well as the the ability to train 1 trillion pa Read more…

MLPerf Inference 4.0 Results Showcase GenAI; Nvidia Still Dominates

March 28, 2024

There were no startling surprises in the latest MLPerf Inference benchmark (4.0) results released yesterday. Two new workloads — Llama 2 and Stable Diffusion Read more…

Q&A with Nvidia’s Chief of DGX Systems on the DGX-GB200 Rack-scale System

March 27, 2024

Pictures of Nvidia's new flagship mega-server, the DGX GB200, on the GTC show floor got favorable reactions on social media for the sheer amount of computing po Read more…

NVLink: Faster Interconnects and Switches to Help Relieve Data Bottlenecks

March 25, 2024

Nvidia’s new Blackwell architecture may have stolen the show this week at the GPU Technology Conference in San Jose, California. But an emerging bottleneck at Read more…

Who is David Blackwell?

March 22, 2024

During GTC24, co-founder and president of NVIDIA Jensen Huang unveiled the Blackwell GPU. This GPU itself is heavily optimized for AI work, boasting 192GB of HB Read more…

Nvidia Looks to Accelerate GenAI Adoption with NIM

March 19, 2024

Today at the GPU Technology Conference, Nvidia launched a new offering aimed at helping customers quickly deploy their generative AI applications in a secure, s Read more…

The Generative AI Future Is Now, Nvidia’s Huang Says

March 19, 2024

We are in the early days of a transformative shift in how business gets done thanks to the advent of generative AI, according to Nvidia CEO and cofounder Jensen Read more…

Nvidia’s New Blackwell GPU Can Train AI Models with Trillions of Parameters

March 18, 2024

Nvidia's latest and fastest GPU, codenamed Blackwell, is here and will underpin the company's AI plans this year. The chip offers performance improvements from Read more…

Nvidia Showcases Quantum Cloud, Expanding Quantum Portfolio at GTC24

March 18, 2024

Nvidia’s barrage of quantum news at GTC24 this week includes new products, signature collaborations, and a new Nvidia Quantum Cloud for quantum developers. Wh Read more…

Alibaba Shuts Down its Quantum Computing Effort

November 30, 2023

In case you missed it, China’s e-commerce giant Alibaba has shut down its quantum computing research effort. It’s not entirely clear what drove the change. Read more…

Nvidia H100: Are 550,000 GPUs Enough for This Year?

August 17, 2023

The GPU Squeeze continues to place a premium on Nvidia H100 GPUs. In a recent Financial Times article, Nvidia reports that it expects to ship 550,000 of its lat Read more…

Shutterstock 1285747942

AMD’s Horsepower-packed MI300X GPU Beats Nvidia’s Upcoming H200

December 7, 2023

AMD and Nvidia are locked in an AI performance battle – much like the gaming GPU performance clash the companies have waged for decades. AMD has claimed it Read more…

DoD Takes a Long View of Quantum Computing

December 19, 2023

Given the large sums tied to expensive weapon systems – think $100-million-plus per F-35 fighter – it’s easy to forget the U.S. Department of Defense is a Read more…

Synopsys Eats Ansys: Does HPC Get Indigestion?

February 8, 2024

Recently, it was announced that Synopsys is buying HPC tool developer Ansys. Started in Pittsburgh, Pa., in 1970 as Swanson Analysis Systems, Inc. (SASI) by John Swanson (and eventually renamed), Ansys serves the CAE (Computer Aided Engineering)/multiphysics engineering simulation market. Read more…

Choosing the Right GPU for LLM Inference and Training

December 11, 2023

Accelerating the training and inference processes of deep learning models is crucial for unleashing their true potential and NVIDIA GPUs have emerged as a game- Read more…

Intel’s Server and PC Chip Development Will Blur After 2025

January 15, 2024

Intel's dealing with much more than chip rivals breathing down its neck; it is simultaneously integrating a bevy of new technologies such as chiplets, artificia Read more…

Baidu Exits Quantum, Closely Following Alibaba’s Earlier Move

January 5, 2024

Reuters reported this week that Baidu, China’s giant e-commerce and services provider, is exiting the quantum computing development arena. Reuters reported � Read more…

Leading Solution Providers

Contributors

Comparing NVIDIA A100 and NVIDIA L40S: Which GPU is Ideal for AI and Graphics-Intensive Workloads?

October 30, 2023

With long lead times for the NVIDIA H100 and A100 GPUs, many organizations are looking at the new NVIDIA L40S GPU, which it’s a new GPU optimized for AI and g Read more…

Shutterstock 1179408610

Google Addresses the Mysteries of Its Hypercomputer 

December 28, 2023

When Google launched its Hypercomputer earlier this month (December 2023), the first reaction was, "Say what?" It turns out that the Hypercomputer is Google's t Read more…

AMD MI3000A

How AMD May Get Across the CUDA Moat

October 5, 2023

When discussing GenAI, the term "GPU" almost always enters the conversation and the topic often moves toward performance and access. Interestingly, the word "GPU" is assumed to mean "Nvidia" products. (As an aside, the popular Nvidia hardware used in GenAI are not technically... Read more…

Shutterstock 1606064203

Meta’s Zuckerberg Puts Its AI Future in the Hands of 600,000 GPUs

January 25, 2024

In under two minutes, Meta's CEO, Mark Zuckerberg, laid out the company's AI plans, which included a plan to build an artificial intelligence system with the eq Read more…

Google Introduces ‘Hypercomputer’ to Its AI Infrastructure

December 11, 2023

Google ran out of monikers to describe its new AI system released on December 7. Supercomputer perhaps wasn't an apt description, so it settled on Hypercomputer Read more…

China Is All In on a RISC-V Future

January 8, 2024

The state of RISC-V in China was discussed in a recent report released by the Jamestown Foundation, a Washington, D.C.-based think tank. The report, entitled "E Read more…

Intel Won’t Have a Xeon Max Chip with New Emerald Rapids CPU

December 14, 2023

As expected, Intel officially announced its 5th generation Xeon server chips codenamed Emerald Rapids at an event in New York City, where the focus was really o Read more…

IBM Quantum Summit: Two New QPUs, Upgraded Qiskit, 10-year Roadmap and More

December 4, 2023

IBM kicks off its annual Quantum Summit today and will announce a broad range of advances including its much-anticipated 1121-qubit Condor QPU, a smaller 133-qu Read more…

  • arrow
  • Click Here for More Headlines
  • arrow
HPCwire