This repository has been archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
259 lines (226 loc) · 13.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="_static/numba-blue-icon-rgb.svg">
<title>Numba: A High Performance Python Compiler</title>
<!-- Bootstrap core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="_static/prism-duotone-light.css">
<!-- Custom styles for this template -->
<link href="_static/main-page.css" rel="stylesheet">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg">
<div class="navbar-brand">
<img src="_static/numba-blue-icon-rgb.svg" style="height: 2rem;" alt="Numba logo">
</div>
<div class="navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="navbar-item"><a class="nav-link" href="https://numba.readthedocs.io/en/stable/user/5minguide.html">Learn Numba in 5 minutes</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Documentation
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/index.html">Overview</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/user/index.html">User Manual</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/reference/index.html">Reference Manual</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/cuda/index.html">NVIDIA CUDA GPU Programming</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/roc/index.html">AMD ROCm GPU Programming</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/developer/index.html">Developer Manual</a>
<a class="dropdown-item" href="https://numba.readthedocs.io/en/stable/release-notes.html">Release Notes</a>
</div>
</li>
<li class="navbar-item"><a class="nav-link" href="https://numba.readthedocs.io/en/stable/user/installing.html">Install</a></li>
<li class="navbar-item"><a class="nav-link" href="https://numba.pydata.org/numba-examples/">Examples</a></li>
<li class="navbar-item"><a class="nav-link" href="https://numba.readthedocs.io/en/stable/user/talks.html">Talks/Tutorials</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Community
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink2">
<a class="dropdown-item" href="https://github.com/numba/numba">Github</a>
<a class="dropdown-item" href="https://pypi.org/project/numba/">PyPI</a>
<a class="dropdown-item" href="https://gitter.im/numba/numba">Gitter Chat</a>
<a class="dropdown-item" href="https://groups.google.com/a/continuum.io/forum/#!forum/numba-users">Numba Mailing List</a>
</div>
</li>
</ul>
</div>
</nav>
<div class="hero position-relative overflow-hidden p-3 text-center text-dark">
<div class="col-md-5 p-lg-1 mx-auto my-5">
<img src="_static/numba-blue-horizontal-rgb.svg" style="max-width: 30rem;" alt="Numba logo">
<p class="lead font-weight-normal">
Numba makes Python code fast
</p>
<p class="lead ">
Numba is an open source JIT compiler that translates a subset of Python and NumPy code into fast machine code.
</p>
<a class="btn outline-numba btn-lg" href="https://numba.readthedocs.io/en/stable/user/5minguide.html">Learn More</a>
<a class="btn filled-numba btn-lg" href="https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks"
role="button">Try Numba »</a>
</div>
<div class="product-device box-shadow d-none d-md-block"></div>
<div class="product-device product-device-2 box-shadow d-none d-md-block"></div>
</div>
</header>
<main role="main">
<!-- Wrap the rest of the page in another container to center all the content. -->
<div class="container marketing p-md-5">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Accelerate Python Functions</h2>
<p class="lead">Numba translates Python functions to optimized machine code at runtime using the
industry-standard <a href="https://llvm.org/">LLVM</a> compiler library. Numba-compiled numerical algorithms in Python can approach the speeds of C or FORTRAN.</p>
<p class="lead">You don't need to replace the Python interpreter, run a separate compilation step, or even
have a C/C++ compiler installed. Just apply one of the Numba decorators to your Python function, and Numba does the rest.
</p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/user/jit.html" role="button">Learn More »</a>
<a class="btn btn-secondary" href="https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks%2Fbasics.ipynb" role="button">Try Now »</a>
</div>
<div class="col-md-5 code-block">
<pre><code class="language-python">from numba import jit
import random
@jit(nopython=True)
def monte_carlo_pi(nsamples):
acc = 0
for i in range(nsamples):
x = random.random()
y = random.random()
if (x ** 2 + y ** 2) < 1.0:
acc += 1
return 4.0 * acc / nsamples</code></pre>
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Built for Scientific Computing</h2>
<p class="lead">Numba is designed to be used with NumPy arrays and functions. Numba generates specialized code for
different array data types and layouts to optimize performance. Special decorators can create <a href="https://docs.scipy.org/doc/numpy/reference/ufuncs.html">universal functions</a> that broadcast over NumPy arrays just like NumPy functions do.</p>
<p class="lead">Numba also works great with Jupyter notebooks for interactive computing, and with distributed execution frameworks, like Dask and Spark.</p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/reference/numpysupported.html" role="button">Learn More »</a>
<a class="btn btn-secondary" href="https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks%2Fnumpy.ipynb" role="button">Try Now »</a>
</div>
<div class="col-md-5 code-block">
<pre><code class="language-python">@numba.jit(nopython=True, parallel=True)
def logistic_regression(Y, X, w, iterations):
for i in range(iterations):
w -= np.dot(((1.0 /
(1.0 + np.exp(-Y * np.dot(X, w)))
- 1.0) * Y), X)
return w</code></pre>
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<h2 class="featurette-heading">Parallelize Your Algorithms</h2>
<p>Numba offers a range of options for parallelizing your code for CPUs and GPUs, often with only minor code changes.</p>
<div class="row">
<div class="col-lg-4">
<h2 class="mt-3">Simplified Threading</h2>
<pre><code class="language-python">@jit(nopython=True, parallel=True)
def simulator(out):
# iterate loop in parallel
for i in prange(out.shape[0]):
out[i] = run_sim()</code></pre>
<p>Numba can automatically execute NumPy array expressions on multiple CPU cores and makes it easy to write parallel loops.</p>
<p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/user/parallel.html" role="button">Learn More »</a>
<a class="btn btn-secondary" href="https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks%2Fthreads.ipynb" role="button">Try Now »</a>
</p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<h2 class="mt-3">SIMD Vectorization</h2>
<pre><code class="language-nasm">LBB0_8:
vmovups (%rax,%rdx,4), %ymm0
vmovups (%rcx,%rdx,4), %ymm1
vsubps %ymm1, %ymm0, %ymm2
vaddps %ymm2, %ymm2, %ymm2</code></pre>
<p>Numba can automatically translate some loops into vector instructions for 2-4x speed improvements. Numba adapts to your CPU capabilities, whether your CPU supports SSE, AVX, or AVX-512.</p>
<p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/user/performance-tips.html" role="button">Learn More »</a>
<a class="btn btn-secondary" href="https://mybinder.org/v2/gh/numba/numba-examples/master?filepath=notebooks%2Fsimd.ipynb" role="button">Try Now »</a>
</p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<h2 class="mt-3">GPU Acceleration</h2>
<img src="_static/nvidia_cuda.jpg" class="top-image" alt="NVIDIA CUDA logo">
<img src="_static/amd_rocm.png" class="top-image" alt="AMD ROCm logo">
<p>With support for both NVIDIA's CUDA and AMD's ROCm drivers, Numba lets you write parallel GPU algorithms entirely from Python.</p>
<p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/cuda/index.html" role="button">Numba CUDA »</a>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/roc/index.html" role="button">Numba ROCm »</a>
</p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-12">
<h2 class="featurette-heading">Portable Compilation</h2>
<p class="lead">Ship high performance Python applications without the headache of binary compilation and packaging. Your source code remains pure Python while Numba handles the compilation at runtime. We test Numba continuously in more than 200 different platform configurations.</p>
<p class="lead">Numba supports Intel and AMD x86, POWER8/9, and ARM CPUs, NVIDIA and AMD GPUs, Python 3.6-3.9, as well as Windows/macOS/Linux. Precompiled Numba binaries for most systems are available as conda packages and pip-installable wheels.</p>
<a class="btn btn-outline-secondary" href="https://numba.readthedocs.io/en/stable/user/installing.html" role="button">Learn More »</a>
</div>
</div>
</div>
<hr class="featurette-divider">
<section id="supporters">
<div class="container supporters">
<h2>Acknowledgements</h2>
<p>Numba development is made possible through the current and/or past support of a number of organizations:<p>
<div class="row">
<div class="col supporter">
<a href="https://anaconda.com"><img src="_static/anaconda_logo.png" alt="Anaconda logo"></a>
</div>
<div class="col supporter">
<a href="https://www.darpa.mil"><img src="_static/darpa_logo.png" alt="DARPA logo"></a>
</div>
<div class="col supporter">
<a href="https://www.moore.org/grant-detail?grantId=GBMF5423"><img src="_static/moore_logo.png" alt="Moore foundation logo"></a>
</div>
</div>
<div class="row">
<div class="col supporter">
<a href="https://www.intel.com"><img src="_static/intel_logo.png" alt="Intel logo"></a>
</div>
<div class="col supporter">
<a href="https://www.nvidia.com/"><img src="_static/nvidia_logo.png" alt="NVIDIA logo"></a>
</div>
<div class="col supporter">
<a href="https://www.amd.com"><img src="_static/amd_logo.png" alt="AMD logo"></a>
</div>
</div>
</div>
</section>
<!-- /END THE FEATURETTES -->
<!-- FOOTER -->
<footer class="container">
<p>© 2018 Anaconda</p>
<p><i>HTML layout adapted from the <a href="http://dask.pydata.org/">Dask</a> homepage.</i></p>
</footer>
</main>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<!-- Code highlighting -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/components/prism-python.min.js"></script>
</body>
</html>