fluiddyn / transonic

:rocket: Make your Python code fly at transonic speeds!
https://transonic.readthedocs.io
BSD 3-Clause "New" or "Revised" License
119 stars 0 forks source link
aot cython extensions jit numba numpy pythran

Make your Python code fly at transonic speeds!

Latest version Code coverage Documentation status Supported Python versions Heptapod CI Github Actions mybinder sonarcloud

Documentation: https://transonic.readthedocs.io

Transonic is a pure Python package (requiring Python >= 3.9) to easily accelerate modern Python-Numpy code with different accelerators (currently Cython, Pythran, Numba and JAX, but potentially later Cupy, PyTorch, Weld, Pyccel, etc...).

The accelerators are not hard dependencies of Transonic: Python codes using Transonic run fine without any accelerators installed (of course without speedup)!

[!WARNING] Transonic is still in an active development stage (see our roadmap). Remarks and suggestions are very welcome.

However, Transonic is now really usable, useful and used "in production" in FluidSim and FluidFFT (see examples for blocks and @boost).

The long-term project

[!NOTE] The context of the creation of Transonic is presented in these documents:

Transonic targets Python end-users and library developers.

It is based on the following principles:

To summarize, a strategy to quickly develop a very efficient scientific application/library with Python could be:

  1. Use modern Python coding, standard Numpy/Scipy for the computations and all the cool libraries you want.
  2. Profile your applications on real cases, detect the bottlenecks and apply standard optimizations with Numpy.
  3. Add few lines of Transonic to compile the hot spots.

What we have now

We start to have a good API to accelerate Python-Numpy code (functions, methods and blocks of code). The default Transonic backend uses Pythran and works well. Here, we explain why Pythran is so great for Python users and why Transonic is great for Pythran users. There are also (more experimental) backends for Cython and Numba.

[!NOTE] Transonic can be used in libraries and applications using MPI (as FluidSim).

Installation and configuration

pip install transonic

Transonic is sensible to environment variables:

License

Transonic is distributed under the BSD License.