This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 3279a8ca authored by Pierre Augier's avatar Pierre Augier
Browse files

Doc and roadmap

parent f6fd61447adb
......@@ -2,10 +2,8 @@
Future
------
- Ability to use Cython and Numba (?)
- Alternative syntax for blocks (`issue #6
<https://bitbucket.org/fluiddyn/transonic/issues/6>`_)
See the `ROADMAP.rst file
<https://transonic.readthedocs.io/en/latest/roadmap.html>`_.
0.2.4 (2019-06-28)
------------------
......
......@@ -36,12 +36,13 @@ speedup)!
.. warning ::
Transonic is still in a early stage. Remarks and suggestions are very
welcome.
Transonic is still in a early stage (see our `roadmap
<https://transonic.readthedocs.io/en/latest/roadmap.html>`_.). Remarks and
suggestions are very welcome.
In particular, Transonic is now only able to use the Pythran compiler! So you
are not going to be able to use for example Numba with this version of
Transonic.
In particular, Transonic is now only able to use the Pythran and Cython
compilers. So you are not going to be able to use Numba with this
version of Transonic.
However, Transonic is now really usable, useful and used "in production" in
`FluidSim <https://bitbucket.org/fluiddyn/fluidsim>`_ and `FluidFFT
......@@ -82,8 +83,8 @@ It is based on the following principles:
code specialized for only one of these tools.
- Let's try to keep the code as it would be written without acceleration. For
example, with Transonic, we are able to accelerate (simple) methods of classes
even though some accelerators don't support classes.
example, with Transonic, we are able to accelerate (simple) methods of
classes even though some accelerators don't support classes.
- Let's accelerate/compile only what needs to be accelerated, i.e. only the
bottlenecks. Python and its interpreters are good for the rest. In most
......@@ -102,11 +103,8 @@ It is based on the following principles:
* JIT is simpler to use (no need for type annotations) and optimizations can
be more hardware specific.
Note that with Transonic, AOT compilers can be used as JIT compilers (with a
cache mechanism).
In contrast, some JIT compilers cannot be used as AOT compilers. For these
tools, the AOT decorators will be used in a JIT mode.
Note that with Transonic, AOT compilers (Pythran and Cython) can be used as
JIT compilers (with a cache mechanism).
To summarize, a **strategy to quickly develop a very efficient scientific
application/library** with Python could be:
......@@ -122,13 +120,14 @@ application/library** with Python could be:
What we have now
----------------
We start to have a good API to accelerate Python-Numpy code.
We start to have a good API to accelerate Python-Numpy code (functions, methods
and blocks of code).
The only implemented Transonic backend uses Pythran and works well.
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 <https://transonic.readthedocs.io/en/latest/pythran_backend.html>`_
`Here, we explain why Pythran is so great for Python users and why Transonic is
great for Pythran users
<https://transonic.readthedocs.io/en/latest/pythran_backend.html>`_
Another backend using Cython starts to work.
.. note ::
......
Cython backend (v0)
-------------------
- Analyses: variable type annotations in functions and methods
- Cython types for arrays (memory views, i.e. as ``np.float64_t[:]``)
- Cython "locals" types
- Doc Cython
Cython backend (v1)
-------------------
- Less bugs
- "exterior" functions + understand the tests
- Recompile if pxd changed
setup.py & more than one backend at runtime
-------------------------------------------
- ``make_backend_files(backend_default="cython")``
- More than one backend at runtime
- "python" backend (equivalent to NO_REPLACE)
- Warnings if file not compiled
- ``TRANSONIC_BACKEND`` changes only ``backend_default``
- Examples setup.py in documentation
Numba backend
-------------
Simpler but not so simple because no compilation!
Specify backend in code
-----------------------
.. code:: python
def func():
return 1
func_pythran = @jit(backend="pythran")(func)
func_cython = @jit(backend="cython")(func)
func_numba = @jit(backend="numba")(func)
And same with ``boost``.
- Rewrite the comparison Numba / Pythran with Transonic
Alternative syntax for blocks
-----------------------------
See `issue #6 <https://bitbucket.org/fluiddyn/transonic/issues/6>`_
# A package using Transonic (for extensions using Pythran or Cython)
A package using Transonic (for extensions using Pythran or Cython)
==================================================================
......@@ -34,18 +34,18 @@ modules, classes and functions.
.. autosummary::
:toctree: generated/
transonic.analyses
transonic.backends
transonic.aheadoftime
transonic.transpiler
transonic.analyses
transonic.annotation
transonic.justintime
transonic.pythranizer
transonic.backends
transonic.compiler
transonic.config
transonic.dist
transonic.run
transonic.justintime
transonic.log
transonic.mpi
transonic.run
transonic.util
transonic.config
More
----
......@@ -56,6 +56,7 @@ More
Transonic forge on Bitbucket <https://bitbucket.org/fluiddyn/transonic>
Transonic in PyPI <https://pypi.python.org/pypi/transonic/>
changes
roadmap
authors
for_dev
......
Roadmap
=======
.. include:: ../ROADMAP.rst
......@@ -211,7 +211,6 @@ def analyse_aot(code, pathfile):
debug("compute the annotations")
from transonic import aheadoftime
aheadoftime.is_transpiling = True
def_nodes = [
......@@ -265,7 +264,7 @@ def analyse_aot(code, pathfile):
debug(pformat(blocks))
debug("compute code dependance")
debug("compute code dependance:")
# remove the decorator (boost) to compute the code dependance
# + do not consider the class annotations
......@@ -291,7 +290,7 @@ def analyse_aot(code, pathfile):
)
code_ext = {"function": {}, "class": {}}
code_dependance = capturex.make_code_external()
# TODO implement class for new backends
# TODO implement class for new backends + debug this code :-)
if boosted_dicts["functions"]["pythran"]:
func = next(iter(boosted_dicts["functions"]["pythran"]))
code_dependance, code_ext, _, _ = get_exterior_code(
......@@ -310,13 +309,12 @@ def analyse_aot(code, pathfile):
annotations["comments"] = {}
for name_backend, backend in boosted_dicts["functions"].items():
for name_func, fdef in backend.items():
for functions_backend in boosted_dicts["functions"].values():
for name_func, fdef in functions_backend.items():
try:
signatures = signatures_p[name_func]
except KeyError:
signatures = tuple()
fdef = boosted_dicts["functions"][name_backend][name_func]
arg_names = [arg.id for arg in fdef.args.args]
annotations_sign = annotations["comments"][name_func] = []
for sig in signatures:
......
......@@ -7,7 +7,7 @@ User API
Provides the classes PythranBuildExt and PythranExtension to be used in the
setup.py.
.. autofunction:: detect_pythran_extensions
.. autofunction:: detect_transonic_extensions
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment