https://github.com/fluiddyn/transonic
:rocket: Make your Python code fly at transonic speeds!
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 4 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
:rocket: Make your Python code fly at transonic speeds!
Basic Info
- Host: GitHub
- Owner: fluiddyn
- License: bsd-3-clause
- Language: Python
- Default Branch: branch/default
- Homepage: https://transonic.readthedocs.io
- Size: 2.88 MB
Statistics
- Stars: 124
- Watchers: 4
- Forks: 0
- Open Issues: 6
- Releases: 0
Topics
Metadata Files
README.md
Make your Python code fly at transonic speeds!
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:
We'd like to write scientific / computing applications / libraries with pythonic, readable, modern code (Python >= 3.6).
In some cases, Python-Numpy is too slow. However, there are tools to accelerate such Python-Numpy code which lead to very good performances!
Let's try to write universal code which express what we want to compute and not the special hacks we want to use to make it fast. We just need nice ways to express that a function, a method or a block of code has to be accelerated (and how it has to be accelerated). We'd like to be able to do this in a pythonic way, with decorators and context managers.
There are many tools to accelerate Python-Numpy code! Let's avoid writting 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.
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 cases, the benefice of writting big compiled extensions (with Cython or in other languages) is negligible.
Adding types is sometimes necessary. In modern Python, we have nice syntaxes for type annotations! Let's use them.
Ahead-of-time (AOT) and just-in-time (JIT) compilation modes are both useful. We'd like to have a nice, simple and unified API for these two modes.
- AOT is useful to be able to distribute compiled packages and in some cases, more optimizations can be applied.
- JIT is simpler to use (no need for type annotations) and optimizations can be more hardware specific.
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:
- Use modern Python coding, standard Numpy/Scipy for the computations and all the cool libraries you want.
- Profile your applications on real cases, detect the bottlenecks and apply standard optimizations with Numpy.
- 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
bash
pip install transonic
Transonic is sensible to environment variables:
TRANSONIC_DIRcan be set to control where the cached files are saved.TRANSONIC_DEBUGtriggers a verbose mode.TRANSONIC_COMPILE_AT_IMPORTcan be set to enable a mode for which Transonic compiles at import time the Pythran file associated with the imported module. This behavior can also be triggered programmatically by using the functionset_compile_at_import.TRANSONIC_NO_REPLACEcan be set to disable all code replacements. This is useful to compare execution times and when measuring code coverage.TRANSONIC_COMPILE_JITcan be set to false to disable the compilation of jited functions. This can be useful for unittests.TRANSONIC_BACKENDto choose between the supported backends. The default backend "pythran" is quite robust. There are now 3 other backends: "cython", "numba" and "python" (prototypes).TRANSONIC_MPI_TIMEOUTsets the MPI timeout (default to 5 s).
License
Transonic is distributed under the BSD License.
Owner
- Name: FluidDyn
- Login: fluiddyn
- Kind: organization
- Website: https://fluiddyn.netlify.app
- Repositories: 3
- Profile: https://github.com/fluiddyn
FluidDyn project | framework for research and teaching in fluid dynamics - git mirror
GitHub Events
Total
- Watch event: 3
- Delete event: 1
- Push event: 16
- Create event: 5
Last Year
- Watch event: 3
- Delete event: 1
- Push event: 16
- Create event: 5
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| paugier | p****r@u****r | 670 |
| Ashwin Vishnu | a****o@k****e | 42 |
| Pierre Blanc-fatin | p****t@g****m | 37 |
| ogiorgis | o****s@l****r | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 13
- Total pull requests: 1
- Average time to close issues: 4 months
- Average time to close pull requests: 25 minutes
- Total issue authors: 4
- Total pull request authors: 1
- Average comments per issue: 3.77
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jeanlaroche (6)
- paugier (5)
- exenGT (1)
- rgommers (1)
Pull Request Authors
- ashwinvis (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,755 last-month
- Total docker downloads: 127
- Total dependent packages: 6
- Total dependent repositories: 9
- Total versions: 50
- Total maintainers: 1
pypi.org: transonic
Make your Python code fly at transonic speeds!
- Documentation: https://transonic.readthedocs.io
- License: BSD License
-
Latest release: 0.7.3
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- clang
- cython
- numba
- numpy
- pip
- python 3.7.*
- pythran
- transonic *
- transonic *