Short reminder: Transonic is a pure Python package (requiring Python >= 3.6) to easily accelerate modern Python-Numpy code with different accelerators (currently Cython, Pythran and Numba).

We've just reached an important technical milestone with the release of the 0.4.0 version.

If you use Pythran master, note that Transonic 0.4.0 is (on purpose) only compatible with the stable version of Pythran so one needs to install transonic with something like:

pip install https://github.com/fluiddyn/transonic/archive/master.zip

I consolidated the work of Pierre Blanc-fatin on the possibility to use different Python accelerators with the same Numpy code.

group guys

Different accelerators for one process and one module

Before 0.4.0, it was not possible to use more than one backend for one process! This strong limitation is now overcome. We now have an API to choose which backend is used for a specific module or function. For example, one can write something like:

import os
from transonic import boost, set_backend_for_this_module

if os.name == 'nt':  # Windows
    backend = "numba"  # or "cython"
else:
    backend = "pythran"

set_backend_for_this_module(backend)

@boost
def myfunc(...):
    ...

Since it is possible to choose with a fine granularity which backend is used for which function, it is now super easy to write benchmarks with Transonic.

transonic.typing

I've done a big refactoring of how types are represented in Transonic (see for example here). We have now a flexible solution to tell for each backend how the Transonic types are expressed. It is for example possible to define for the Cython backend np.ndarray and memoryviews. Or to specify the memory layout of arrays (C, Fortran, "C_or_F" or strided) or fixed dimensions (for example for images, Array[np.float32, "[3,:,:]"]).

What's next?

Technically, some ideas are listed in our roadmaps.

But it's now time to work on adoption (in particular for packages) and on building a "community" of users and developers.

After my presentation at EuroScipy, Ashwin Vishnu will soon have the opportunity to present Transonic at PyCon Sweden!


Published

Category

Notes

Tags

Links

Mailing List