Michael Wong Codeplay Software VP of Research and Development Http:://Wongmichael.Com/About [email protected]

Michael Wong Codeplay Software VP of Research and Development Http:://Wongmichael.Com/About Michael@Codeplay.Com

The future direction of and ISO heterogeneous programming Michael Wong Codeplay Software VP of Research and Development http:://wongmichael.com/about [email protected] GPU DAY 2019 VP of R&D of Codeplay Chair of SYCL Heterogeneous Programming Language C++ Directions Group ISOCPP.org Director, VP http://isocpp.org/wiki/faq/wg21#michael- Who am I? wong Head of Delegation for C++ Standard for Canada Chair of Programming Languages for Ported TensorFlow Build LLVM-based to open standards compilers for Standards Council of Canada using SYCL accelerators Chair of WG21 SG19 Machine Learning Chair of WG21 SG14 Games Dev/Low Releasing open- Latency/Financial Trading/Embedded source, open- Implement Editor: C++ SG5 Transactional Memory standards based AI OpenCL and SYCL acceleration tools: for accelerator Technical Specification SYCL-BLAS, SYCL- processors Editor: C++ SG1 Concurrency Technical ML, VisionCpp Specification MISRA C++ and AUTOSAR wongmichael.com/about We build GPU compilers for semiconductor companies • Now working to make AI/Ml heteroegneous acceleration safe for autonomous vehicle Numerous people internal and external to the original C++/Khronos group, in industry and academia, have made contributions, influenced ideas, written part of this presentations, and offered feedbacks to form part of this talk. Specifically, Paul Mckenney, Joe Hummel, Bjarne Stroustru, Botond Ballo for some of the slides. I even lifted this acknowledgement and disclaimer from some Acknowle of them. dgement Disclaimer But I claim all credit for errors, and stupid mistakes. These are mine, all mine! Legal Disclaimer THIS WORK REPRESENTS THE VIEW OF THE OTHER COMPANY, PRODUCT, AND SERVICE AUTHOR AND DOES NOT NECESSARILY NAMES MAY BE TRADEMARKS OR SERVICE REPRESENT THE VIEW OF CODEPLAY. MARKS OF OTHERS. Codeplay - Connecting AI to Silicon Products Addressable Markets Automotive (ISO 26262) C++ platform via the SYCL™ open standard, enabling IoT, Smartphones & Tablets vision & machine learning e.g. TensorFlow™ High Performance Compute (HPC) Medical & Industrial Technologies: Vision Processing The heart of Codeplay's compute technology Machine Learning enabling OpenCL™, SPIR™, HSA™ and Vulkan™ Artificial Intelligence Big Data Compute Company Customers High-performance software solutions for custom heterogeneous systems Enabling the toughest processor systems with tools and middleware based on open standards Established 2002 in Scotland Partners ~70 employees 3 Act Play • Is ISO C++ going heterogeneous? • Is SYCL gaining in the marketplace? • Is there a direction for C++ and SYCL? • What gets me up every morning? C++11,14,17“No more Raw Food” Don’t use Don’t use raw numbers, do type-rich programming with UDL Don’t declare Don’t declare, use auto whenever possible Don’t use Don’t use raw NULL or (void *) 0, use nullptr Don’t use Don’t use raw new and delete, use unique_ptr/shared_ptr Don’t use Don’t use heap-allocated arrays, use std::vector and std::string, or the new VLA, then dynarray<> Don’t use Don’t use functors, use lambdas Don’t use Don’t use raw loops; use STL algorithms, ranged-based for loops, and lambdas Rule Rule of Three? Rule of Zero or Rule of Five. Parallelism “Use the right abstraction” Abstraction How is it supported Cores C++11/14/17 threads, async HW threads C++11/14/17 threads, async Vectors Parallelism TS2 Atomic, Fences, lockfree, futures, C++11/14/17 atomics, Concurrency TS1, counters, transactions Transactional Memory TS1 Parallel Loops Async, TBB:parallel_invoke, C++17 parallel algorithms, for_each Heterogeneous offload, fpga OpenCL, SYCL, HSA, OpenMP/ACC, Kokkos, Raja Distributed HPX, MPI, UPC++ Caches C++17 false sharing support Numa Executors, Execution Context, Affinity TLS EALS Exception handling in concurrent EH reduction properties environment Act 1 • Is ISO C++ going heterogeneous? Iron Triangle of Parallel Programming Language Nirvana Portability Performance Productivity Performance Portability Productivity OpenCL OpenMP Portability CUDA SYCL Iron Triangle of Parallel Programming Nirvana is about making engineering tradeoffs Concurrency vs Parallelism What makes parallel or concurrent programming harder than serial programming? What’s the difference? How much of this is simply a new mindset one has to adopt? Parallel/concurrency before C++11 (C++98) Asynchronus Agents Concurrent collections Mutable shared state Heterogeneous (GPUs, accelerators, FPGA, embedded AI processors) summary tasks that run operations on groups avoid races and Dispatch/offload to independently and of things, exploit synchronizing objects other nodes (including communicate via parallelism in data and in shared memory distributed) messages algorithm structures examples GUI,background trees, quicksorts, locked data(99%), Pipelines, reactive printing, disk/net compilation lock-free libraries programming, access (wizards), atomics offload,, target, (experts) dispatch key metrics responsiveness throughput, many race free, lock free Independent forward core scalability progress,, load-shared requirement isolation, messages low overhead composability Distributed, heterogeneous today's abstractions POSIX threads, win32 openmp, TBB, PPL, locks, lock hierarchies, OpenCL, CUDA threads, OpenCL, OpenCL, vendor vendor atomic vendor intrinsic intrinsic instructions, vendor intrinsic Parallel/concurrency after C++11 Asynchronus Agents Concurrent collections Mutable shared state Heterogeneous (GPUs, accelerators, FPGA, embedded AI processors) summary tasks that run operations on groups of avoid races and Dispatch/offload to other independently and things, exploit parallelism synchronizing objects in nodes (including communicate via messages in data and algorithm shared memory distributed) structures examples GUI,background printing, trees, quicksorts, locked data(99%), lock-free Pipelines, reactive disk/net access compilation libraries (wizards), atomics programming, offload,, (experts) target, dispatch key metrics responsiveness throughput, many core race free, lock free Independent forward scalability progress,, load-shared requirement isolation, messages low overhead composability Distributed, heterogeneous today's abstractions C++11: thread,lambda C++11: Async, packaged C++11: locks, memory C++11: lambda function, TLS tasks, promises, futures, model, mutex, condition atomics variable, atomics, static init/term Parallel/concurrency after C++14 Asynchronus Agents Concurrent collections Mutable shared state Heterogeneous summary tasks that run operations on groups of avoid races and Dispatch/offload to other independently and things, exploit parallelism synchronizing objects in nodes (including communicate via messages in data and algorithm shared memory distributed) structures examples GUI,background printing, trees, quicksorts, locked data(99%), lock-free Pipelines, reactive disk/net access compilation libraries (wizards), atomics programming, offload,, (experts) target, dispatch key metrics responsiveness throughput, many core race free, lock free Independent forward scalability progress,, load-shared requirement isolation, messages low overhead composability Distributed, heterogeneous today's abstractions C++11: thread,lambda C++11: Async, packaged C++11: locks, memory C++11: lambda function, TLS, async tasks, promises, futures, model, mutex, condition atomics, variable, atomics, static C++14: none C++14: generic lambda init/term, C++ 14: shared_lock/shared_timed _mutex, OOTA, atomic_signal_fence, Parallel/concurrency after C++17 Asynchronus Agents Concurrent collections Mutable shared state Heterogeneous (GPUs, accelerators, FPGA, embedded AI processors) summary tasks that run operations on groups avoid races and Dispatch/offload to independently and of things, exploit synchronizing objects other nodes (including communicate via parallelism in data and in shared memory distributed) messages algorithm structures today's C++11: thread,lambda C++11: Async, C++11: locks, memory C++11: lambda abstractions function, TLS, async packaged tasks, model, mutex, promises, futures, condition variable, C++14: none C++14: generic lambda atomics, atomics, static init/term, C++17: progress C++ 17: ParallelSTL, C++ 14: guarantees, TOE, control false sharing shared_lock/shared_ti execution policies med_mutex, OOTA, atomic_signal_fence, C++ 17: scoped _lock, shared_mutex, ordering of memory models, progress guarantees, TOE, execution policies ISO C++ Standard C++ Std Timeline/status ISO C++ Timeline https://isocpp.org/std/status Pre-C++11 projects ISO Name Status What is it? C++17? number ISO/IEC TR Technical Report on Published 2006 (ISO store) C++ Performance No 18015:20 C++ Performance Draft: TR18015 (2006-02-15) report 06 ISO/IEC Published 2007-11-15 (ISO store) Has 14 Boost N/A (mostly TR Technical Report on Draft: n1745 (2005-01-17) libraries, 13 of already 19768:20 C++ Library Extensions TR 29124 split off, the rest which was added included into 07 merged into C++11 to C++11. C++11) Published 2010-09-03 (ISO Store) Really, ORDINARY ISO/IEC Extensions to the C++ Final draft: n3060 (2010-03-06). math today with a TR Library to support YES Under consideration to merge Boost and 29124:20 mathematical special into C++17 by p0226 (2016-02- Dinkumware 10 functions 10) Implementation Extensions for the Published 2011-10-25 (ISO Store) Decimal Floating ISO/IEC programming language Draft: n2849 (2009-03-06) Point TR No. Ongoing C++ to support decimal May be superseded by a future decimal32 24733:20 work in SG6 floating-point Decimal TS or merged into C++ by decimal64 11

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    115 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us