numba README

The project's README from github.com/numba/numba. As one markdown file: README.md.


Numba


.. image:: https://img.shields.io/badge/discuss-on%20discourse-blue :target: https://numba.discourse.group/ :alt: Discourse

.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.4343230.svg :target: https://doi.org/10.5281/zenodo.4343230 :alt: Zenodo

.. image:: https://img.shields.io/pypi/v/numba.svg :target: https://pypi.python.org/pypi/numba/ :alt: PyPI

.. image:: https://dev.azure.com/numba/numba/_apis/build/status/numba.numba?branchName=main :target: https://dev.azure.com/numba/numba/_build/latest?definitionId=1?branchName=main :alt: Azure Pipelines

A Just-In-Time Compiler for Numerical Functions in Python #########################################################

Numba is an open source, NumPy-aware optimizing compiler for Python sponsored by Anaconda, Inc. It uses the LLVM compiler project to generate machine code from Python syntax.

Numba can compile a large subset of numerically-focused Python, including many NumPy functions. Additionally, Numba has support for automatic parallelization of loops, generation of GPU-accelerated code, and creation of ufuncs and C callbacks.

For more information about Numba, see the Numba homepage: https://numba.pydata.org and the online documentation: https://numba.readthedocs.io/en/stable/index.html

Installation

Please follow the instructions:

https://numba.readthedocs.io/en/stable/user/installing.html

Demo

Please have a look and the demo notebooks via the mybinder service:

https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks

Contact

Numba has a discourse forum for discussions:

numba (numba/numba)

parallel-computing
Searching Database…

11.2K ·GitHub
What is this?Numba is a Just-In-Time compiler that translates a subset of Python and NumPy code into fast machine code using LLVM, letting numerical functions run near C/Fortran speed without leaving Python.
Is this a standalone compiler or something I add to my own Python code?It is a library you import into your existing Python scripts: you decorate the functions you want sped up and Numba compiles them when first called, rather than running as a separate build tool.
How do I start using it on my functions?Install it (via pip or conda) following the installation guide, then decorate the numerical function you want accelerated so Numba compiles it with LLVM on first call.
Do I need anything special installed to compile code with it?It depends on LLVM under the hood and NumPy for array support; to generate GPU code you additionally need CUDA set up on your machine.
Does it support any Python code, or just a subset?Only a large but limited subset of numerically-focused Python and many (not all) NumPy functions can be compiled, so general-purpose Python code won't necessarily work.
Can it generate GPU-accelerated code?Yes, Numba can target GPUs to produce GPU-accelerated code in addition to compiling for the CPU.
Does it also support parallelizing loops automatically?Yes, Numba has support for automatic parallelization of loops across CPU cores, in addition to single-function JIT compilation.
What are the ufuncs and C callbacks it mentions?Numba can create NumPy universal functions (ufuncs) that operate element-wise on arrays, and compile C callback functions that can be called directly from C libraries.
Where can I try it without installing anything?The project provides demo notebooks that can be run via the mybinder service directly in a browser.
What are similar projects?cupy, taichi, taskflow, codon, TornadoVM, dask, gpu.js, julia
Creator
numba
Size
85.6 MB
Stars
11.2K
Age
14y
Commits · 90 Days