Fast Python? Don't Bother

Ca04455902d1b207348b6d406432718f?s=47 Russel Winder
September 17, 2016

Fast Python? Don't Bother

PyConUK 2016 session on not using Python for high performance computation, but instead using Chapel.

Ca04455902d1b207348b6d406432718f?s=128

Russel Winder

September 17, 2016
Tweet

Transcript

  1. 1.

    Copyright © 2016 Russel Winder 1 Fast Python? Don’t Bother

    Russel Winder russel@winder.org.uk https://www.russel.org.uk @russel_winder
  2. 2.

    Copyright © 2016 Russel Winder 2 There is a rumour

    I only come to PyCon UK to talk about languages other than Python…
  3. 7.

    Copyright © 2016 Russel Winder 7 Python is… • A

    dynamically typed (or not) language. • Quite popular, in data science, and data visualisation. • Quite popular for sys. admin. • Quite popular for Web-y stuff. • Having it’s development driven by IDEs. Type signatures.
  4. 9.

    Copyright © 2016 Russel Winder 9 Python is not… •

    A high performance computational language. • A language in which you can write parallel programs.
  5. 11.

    Copyright © 2016 Russel Winder 11 Maybe the GIL is

    a good thing, it stops us using Python when we shouldn’t.
  6. 14.

    Copyright © 2016 Russel Winder 14 So how to do

    computation? • Cython • Numba • NumPy
  7. 15.

    Copyright © 2016 Russel Winder 15 Cython • Write Python

    and annotate the code to make it appear like C so it is actually C by source-to-source translation. Hats off to Pyrex.
  8. 17.

    Copyright © 2016 Russel Winder 17 Because C is a

    programming language for writing operating systems, not applications?
  9. 20.

    Copyright © 2016 Russel Winder 20 Numba • Write Python

    code and decorate with decorator so as to perform non-Python translation via LLVM to native code.
  10. 24.

    Copyright © 2016 Russel Winder 24 NumPy • And the

    whole SciPy, Pandas, etc. kit and caboodle. • A C subsystem, providing opaque data types and operations well integrated with Python as an API.
  11. 25.

    Copyright © 2016 Russel Winder 25 It’s just a C

    system with a nice API. Lots of niceness to the API.
  12. 26.

    Copyright © 2016 Russel Winder 26 Is C good enough

    for computation in the modern era?
  13. 33.

    Copyright © 2016 Russel Winder 33 Parallel Processing • Threads

    and thread pools: – C – but very low level. – C++ – better than C. – Java: Akka, Quasar, Hadoop, Apache Spark, GPars. – D – actors and data parallelism. • Partitioned Global Address Space (PGAS): – Chapel – X10 There are man, many more: Pony, Nim, etc.
  14. 38.

    Copyright © 2016 Russel Winder 38 Processes communicating over a

    network. Processes on same computer communicating using inter-process communication.
  15. 39.

    Copyright © 2016 Russel Winder 39 Processes communicating is the

    only way pure Python code can create parallelism so it must be Pythonic.
  16. 41.
  17. 42.

    Copyright © 2016 Russel Winder 42 Peek at D and

    Chapel. https://github.com/russel/Pi_Quadrature
  18. 43.

    Copyright © 2016 Russel Winder 43 Follow Up… Short hands-on

    workshop: Monday 2016-09-19T14:30+01:00 Room A
  19. 44.

    Copyright © 2016 Russel Winder 44 Fast Python? Don’t Bother

    Russel Winder russel@winder.org.uk https://www.russel.org.uk @russel_winder