ISO C++ and SYCL Join for the Future of Heterogeneous Programming
09 June 2020
This article is published on the IEEE Computer Society publication.
SYCL is being talked about a lot, especially now that it has been selected as the programming model for Argonne National Lab’s Aurora supercomputer, the first exascale supercomputer in the world. The US Exascale Computing Project selects a programming model based on its exacting standard compliance because they have workloads that last decades, while their hardware can change every few years. In my time, the U.S Department of Energy (DOE) has used hardware from Cray, IBM, Intel, and others. For good reason,they tend to avoid proprietary programming models, believing in open standards that are collaboratively contributed to by many companies, instead of being defined by a few or single entity. SYCL’s selection is the group’s belief that it is an open standard that can be relied on long into the future.
To give you some background, I’m Michael Wong, and I am the chair of SYCL. I have also been involved in ISO C++ for almost twenty years, starting around 2002. During that time I have helped design C++11, 14, 17, and 20 and now I chair the ISO C++ Directions group, where five of us advise on the future direction for C++. We are all experienced and recognized leaders, that consist of myself, Bjarne Stroustrup, the designer of C++, Daveed Vandevoorde, VP of EDG compiler, Howard Hinnant, a technical lead at Ripple Lab, XRP Network software and previous chair of the Library Working Group, and Roger Orr, head of the delegation of UK and chair of SG13 on Human Machine Interface.
We were selected based on their years of contribution to ISO C++, and our noted impartiality and fairness in always looking out for the overall good of the C++ language, rather than any partisan behaviors towards our affiliations.
I have also been involved in almost every aspect of ISO C++, designing features (generalized attributes, weak memory model, and other), study group chairing(SG14 embedded, SG19 Machine learning), strategic planning(Directions Group). In 2012, Herb Sutter asked me to help set up the ISOCPP foundation as a place to unify all the diverse bits of knowledge of C++ all over the internet in one place and to make sure it is the latest and correct information. From that foundation, we have founded the annual CPPCON, which is directly funded by the ISOCPP foundation and I currently serve as its Director and VP.
C++ has been a huge part of my life and is something I am extremely passionate about, but I always try to maintain perspective, appreciating the learnings and offerings of other languages. I have worked on some form of heterogeneous languages since IBM’s Cell processor in 2006, and I was OpenMP CEO from 2011-2016 when it was adding accelerator support for supercomputers. I’ve also been the chair for the SYCL working group for four years. SYCL is a good fit for me since it meets the needs of the market; it is an open standard, contributed to by all, and it started with ISO C++ while adding the heterogeneous dispatch. I foresaw heterogeneous dispatch as a necessary step towards future directions in many areas such as self-driving cars, IoT, high- performance computing, FPGAs, and custom AI devices. SYCL was designed from the ground up to be ISO C++ first, then augmented with heterogeneous support using OpenCL. At that time, I knew every heterogeneous C++ language or framework (OpenMP, HPX, CUDA, Kokkos, Raja, Boost.compute, OpenCL, UPC++, OpenACC, and others) because it was, and is, my passion to learn from the very best that all these languages have to offer.
SYCL is part of a set of open specifications developed by The Khronos Group and sits in the “Parallel Computation Group.”
It is a single-source C++ parallel programming abstraction or framework that takes standard ISO C++ application code, including frameworks like TensorFlow, and compiles them with a host CPU compiler, and a device SYCL compiler generating code for many types of processors.
Leading the development of SYCL as well as being closely involved in the ISO C++ definition gives me the ability to ensure these standards are complementary and not competing against or contradicting each other. I would say that two of the main objectives of the SYCL standards are to:
• Ensure SYCL uses only standard ISO C++ syntax
• Align SYCL, and in the long term converge, with ISO C++
There are several implementations of SYCL already available - ComputeCpp, DPC++, hipSYCL, and triSYCL. You can find details of each of these on the SYCLtech website alongside other information including news, videos, and research papers.
Two years ago we were talking about SYCL 1.2 (which was released in 2015) and SYCL 1.2.1 (which was released in 2017), and their alignment with C++11. In the past, we released SYCL v1.2 in 2015 and then SYCL v1.2.1 in 2017. We adopted a bus-train model of delivery matching the ISO C++ roadmap.
In 2020, the proposed future roadmap of SYCL was unveiled and it is clear how the standard has moved to be more closely aligned with the C++ ISO standard.
This year will see a provisional SYCL specification made available for public review during Q3, with a final specification release in Q4 2020. This version of SYCL will be based on C++17, aligning with the latest ratified version of the ISO C++ standard. This means it enables exciting C++ features such as Class Template Argument Deduction (CTAD) and Deduction Guides that make code less verbose. There are also other great features which I will highlight in this post. We have also changed the naming scheme to naming by year rather than being related to OpenCL versioning, allowing us to be based on multiple back-end options. We have seen already that it is possible to build back-ends using PTX for NVIDIA processors and HIP for AMD processors.
We are now projecting that a future SYCL version will be released after 2021 (exact version to be named later) and will be based on C++20 which is likely to be ratified at the end of the year. This shows the increasing alignment that SYCL is developing with ISO C++ and we are also contributing our heterogeneous knowledge into the ISO specifications and adapting C++ features to ensure they can accommodate parallel and heterogeneous architectures.
For me, I am also involved in the affinity proposal based on my similar co-authored OpenMP affinity proposal to push heterogeneous C++ groups to ensure that we can reach this goal.
In my keynote at the LLVM conference in 2018, I specifically highlighted how there is a quiet revolution in ISO C++ to bring about heterogeneous computing in ISO C++. The work to overcome the “four horsemen” as I call them, which has been a common theme in all the frameworks: data movement, data locality, data affinity, and data layout. Every heterogeneous language I have worked on or studied has had to deal with some or all those problems, often using similar solutions.
SYCL has had tremendous growth in the last three years with Working Group participation up 100 percent. We now have an active presence at the Supercomputing conference due to US National Laboratory interest and Intel support for the Aurora supercomputer using oneAPI and DPC++. There is active open-source collaborative implementation in the LLVM/Clang project which hosts its weekly meeting.
We are now seeing the adoption of SYCL in HPC for exascale computing, in AI for automotive ADAS and self-driving vehicles, as well as increasingly in FPGA, AI, and custom chips. We will continue the tight integration with ISO C++ and OpenCL but ensure flexibility for alternative back-ends. Look for more open collaboration using GitHub and continued cadence of ratification of between 1.5-3 years, just like ISO C++.
And just like ISO C++, we plan to look ahead to a future where we integrate their features, such as
• Executors, Coroutines, Futures
• Adapt property mechanism
• Concepts
• Modules
• Parallel algorithm with Ranges
It’s a testament to the progress of SYCL that we have a growing group of skilled individuals that can deliver a standard that works for all heterogeneous systems. There is now a group of more than 30 at the working group meetings and there continues to be strong attendance from AMD, Argonne National Laboratory, Arm, Codeplay, Intel, Qualcomm, University of Bristol, University of Salerno and Xilinx. The ecosystem is strong and continues to grow with contributions in research, benchmarks, linear algebra, and Machine learning.
We have an extremely talented group of people who are dedicated to improving the landscape of SYCL. The commits have recently spiked and grown in our repositories. These spikes show when we are about to release and the massive recent activity is as we prepare for SYCL 2020.
In this chart, you see all the ways you can participate in SYCL, and three out of four of them require no membership with Khronos. Anyone can suggest a feature or a fix and a small fee will allow you to participate in the design of features in the working group and give you a larger voice on the future of SYCL.
“There is only one thing in life worse than being talked about, and that is not being talked about.” Oscar Wilde.
While there were doubters about SYCL in the beginning, I feel that Oscar Wilde’s quote applies aptly for SYCL, and that the right thing to do is be proud of our accomplishments and focus on our future work rather than waste time in flame wars, bashing or comparing it with what others are doing or not doing.
I have learned that we are best to leave the judgment to consumers and users, letting them decide. In the meantime, everyone involved, friends and competitors alike will continue to work towards our common goal. All come with the best of intentions and have valuable knowledge to contribute based on the experience they had in delivering their language. A language or framework gains from the mixing of all this knowledge. There is nothing to be gained in bashing one over the other, as I have learned that 'flame wars' benefit no one. Everyone is making engineering tradeoffs. There is no one best language, and anyone trying to tell you the contrary is trying to sell you something. It is best to focus on open collaboration and deliver the best we can for the heterogeneous world both in ISO C++ and the SYCL world so that both can converge in the future. Our intention is that SYCL will always have a role in working on the latest devices and research and together with ISO C++, and many other heterogeneous frameworks, drive towards the best possible future for heterogeneous computing. In that future, the only thing that matters is that the consumer gains in the best model possible.
If you want to keep up with the latest on the SYCL standard, check the SYCL.tech website, follow the Codeplay and SYCLstd Twitter accounts, and see the latest SYCL spec on GitHub.