Loading Events

« All Events

  • This event has passed.
Aug 15

LPython: Novel, Fast, Retargetable Python Compiler

August 15, 2023 @ 11:00 am - 12:00 pm

Execution speed is a key performance metric in many software applications, especially where computationally-intensive numerical calculations are involved. The core Python interpreter is often far too slow for practical numerical computation, and thus numerous projects have emerged over the past decades to enable faster execution. Some encapsulate a set of numerical computations in compiled extension modules (NumPy, SciPy, Pandas, Polars), some enable just-in-time compilation of Python code (PyPy, Numba, TorchDynamo, Pyjion, Pyston), and some provide ahead-of-time compilation (Cython, Pythran, Numba, Codon, Nuitka). Each of these types of Python acceleration tools has its strengths and weaknesses, and each is better suited for some applications than others.

LPython is a novel ahead-of-time compiler for a subset of the Python language that can be  optimized using type-annotated Python code for multiple backends, including LLVM, C, C++, and WASM. It is a companion project to LFortran, a compiler that similarly optimizes Fortran code for these same backends. The main motivation behind LPython is to achieve maximum performance (not worse than C++ or Fortran). A key further motivation for both LFortran and LPython is ease of translation of code to the various backends, achieved through the use of a common, language-agnostic intermediate representation called the “Abstract Semantic Representation (ASR).” In theory, numerical code written in any language can be transformed into ASR, and from there into any supported backend. Thus, the ASR has the potential to be a “common path” for numerical code written in a variety of languages to be converted into an optimized form.

In this talk, Ondřej Čertík, lead LPython maintainer, will demonstrate the performance capabilities of LPython through benchmarks against Numba and C++. He will also delve into the internal workings of the compiler, explaining how it translates Python code into machine-specific instructions via the ASR intermediate representation. Ondřej will show a live demo of LPython and discuss future plans for the project, and answer any questions from the audience.

Watch the recording.

Details

Date:
August 15, 2023
Time:
11:00 am - 12:00 pm
Event Category: