-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
282 lines (261 loc) · 13.9 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/themes/prism.min.css" integrity="sha256-N1K43s+8twRa+tzzoF3V8EgssdDiZ6kd9r8Rfgg8kZU="
crossorigin="anonymous" />
<title>XND</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light" style="background-color: #FFFFFF;">
<div class="navbar-brand">
<img src="images/xnd-brand.png" style="height: 2rem;">
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link" href="#gumath">gumath</a>
<a class="nav-item nav-link" href="#xnd">xnd</a>
<a class="nav-item nav-link" href="#ndtypes">ndtypes</a>
<a class="nav-item nav-link" href="#xndtools">xndtools</a>
</div>
</div>
</nav>
<main>
<div class="jumbotron p-4">
<div class="container text-center">
<img class="img-fluid mb-4" src="images/xndlogo transparentbg.png" />
<p class="lead font-weight-normal">
Developer libraries for array computing.
</p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 id="motivation" class="display-4">Motivation</h2>
<p>
NumPy has been very impactful in the Python ecosystem, providing efficient array representations and computations. It is
still heavily used today and many recent Python libraries either use it internally or were influenced
by its API.
</p>
<p>
However, with the explosion of machine learning and data analysis work happening in Python, many new libraries have implemented
their own typed arrays and computation layers, because the NumPy model is not flexible enough. It
is hard to extend NumPy with new types and get efficient computation on a variety of hardware devices.
It can also be difficult to use just the type system of NumPy or just the computational infrastructure
of NumPy.
</p>
<p>
We are building XND to recreate the foundations of NumPy as a number of smaller libraries, combining the lessons learned
in the past twenty years of array computing in Python with the needs of newer applications. This
is not a replacement of NumPy. Eventually, NumPy could use XND as could Pandas, Dask, and other libraries.
</p>
<p>
In fact, we are actively working on using XND in Numba and are also very interested in integrating it with a variety of libraries
including Dask, xarray, Numba, Chainer, PyTorch, Tensorflow, PyMC4, TVM/NNVM, Plasma Store, Apache
Arrow, and Tensor Comprehensions.
</p>
<p>
Please reach out if you have ideas or want to help, on either of the Gitter channels below:
</p>
<a class="btn btn-outline-danger" href="https://gitter.im/Plures/xnd">XND</a>
<a class="btn btn-outline-danger" href="https://gitter.im/Plures/xnd-ml">XND integrations</a>
<p class="mt-3">
We also have <strong>weekly public XND meetings</strong> that you are welcome to attend:
</p>
<a class="btn btn-outline-danger"
href="https://calendar.google.com/calendar/b/1?cid=cXVhbnNpZ2h0LmNvbV9manY0dGR1MTVtdW5vNjBjODc3NTRnNGs0MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t"
>Public Meeting Calendar</a>
<p class="mt-3">
If you want to understand more about XND and Plures projects, we invite you to check out this introductory notebook:
</p>
<a class="btn btn-outline-success" target="_blank"
href="https://github.com/Quansight/xnd-notebooks/blob/master/introduction.ipynb"
>Introduction Notebook (Git repo)</a>
<a class="btn btn-outline-success" target="_blank"
href="https://mybinder.org/v2/gh/Quansight/xnd-notebooks/master/"
>XND Notebooks (Binder)</a>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2 class="display-4 mt-5">Packages</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h2 id="gumath">
gumath
<small class="text-muted">is a library for function dispatch.</small>
</h2>
<p>
<strong>
<code>libgumath</code>
</strong> is a C library supporting a general dispatch mechanism for general memory containers as well as a
specific implementation for NumPy-like containers of a composable, generalized function concept.
</p>
<p>
<strong>
<code>gumath</code>
</strong> is a Python wrapper for
<code>libgumath</code>.</p>
<a class="btn btn-outline-primary" href="https://github.com/xnd-project/gumath/" role="button">Code</a>
<a class="btn btn-outline-success" href="http://xnd.readthedocs.io/en/latest/libgumath/index.html" role="button">C Docs</a>
<a class="btn btn-outline-success" href="http://xnd.readthedocs.io/en/latest/gumath/index.html" role="button">Python Docs</a>
</div>
<div class="col-md-6">
<pre><code class="language-bash">$ conda install -c xnd/label/dev gumath
# or
$ python3 -m pip install gumath</code></pre>
<pre><code class="language-python">>>> from gumath import functions as fn
>>> from xnd import xnd
>>> fn.sin(xnd([[1, 2], [3, 4]], type='2 * 2 * float64'))
xnd([[0.8414709848078965, 0.9092974268256817], [0.1411200080598672, -0.7568024953079282]], type='2 * 2 * float64'))</code></pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h2 id="xnd">
xnd
<small class="text-muted">is a library for typed memory blocks.</small>
</h2>
<p>
<strong>
<code>libxnd</code>
</strong> implements support for typed memory blocks using the
<code>libndtypes</code> type library.</p>
<p>The
<strong>
<code>xnd</code>
</strong> module implements a container type that maps most Python values relevant for scientific computing
directly to typed memory.</p>
<a class="btn btn-outline-primary" href="https://github.com/xnd-project/xnd/" role="button">Code</a>
<a class="btn btn-outline-success" href="http://xnd.readthedocs.io/en/latest/libxnd/index.html" role="button">C Docs</a>
<a class="btn btn-outline-success" href="http://xnd.readthedocs.io/en/latest/xnd/index.html" role="button">Python Docs</a>
</div>
<div class="col-md-6">
<pre><code class="language-python">>>> from xnd import xnd
>>> xnd([{'b': [10.2, 232.3]}, {'b': [0.2, 0.23]}])
xnd([{'b': [10.2, 232.3]}, {'b': [0.2, 0.23]}], type='2 * {b : 2 * float64}')</code></pre>
<pre><code class="language-python">>>> from xnd import xnd
>>> import numpy as np
>>> xnd.from_buffer(np.arange(6).reshape(3, 2))
xnd([[0, 1], [2, 3], [4, 5]], type='3 * 2 * int64')</code></pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h2 id="ndtypes">
ndtypes
<small class="text-muted">is a library for typing memory blocks.</small>
</h2>
<p>
<strong>
<code>libndtypes</code>
</strong> implements the type part of a compiler frontend. It can describe C types needed for array computing
and additionally includes symbolic types for the purposes of dynamic type checking.</p>
<p>The
<strong>
<code>ndtypes</code>
</strong> Python module implements bindings for libndtypes. Its purpose is to support the type part required
for the xnd container module.</p>
<a class="btn btn-outline-primary" href="https://github.com/xnd-project/ndtypes/" role="button">Code</a>
<a class="btn btn-outline-success" href="http://ndtypes.readthedocs.io/en/latest/index.html" role="button">Docs</a>
</div>
<div class="col-md-6">
<pre><code class="language-python">>>> from ndtypes import ndt
>>> # fixed dimension type
>>> ndt("fixed(shape=10) * uint64")
ndt("10 * uint64")</code></pre>
<pre><code class="language-python">>>> from ndtypes import ndt
>>> # variable dimension type
>>> ndt("var * float32")
ndt("var * float32")</code></pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h2 id="xndtools">
xndtools
<small class="text-muted">is a tool to help make gumath kernels.</small>
</h2>
<p>
<strong><code>xndtools</code></strong>
provides a script that builds gumath kernels from C prototypes of the computational functions.
</p>
<a class="btn btn-outline-primary" href="https://github.com/xnd-project/xndtools/" role="button">Code</a>
<a class="btn btn-outline-success" href="http://xnd.readthedocs.io/en/latest/xndtools/index.html" role="button">Docs</a>
</div>
<div class="col-md-6">
<pre><code class="language-bash"># Generate kernels configuration file (mkl_blas-kernels.cfg)
$ xnd_tools config $CONDA_PREFIX/include/mkl_blas.h
</code></pre>
<pre><code class="language-bash"># Modify mkl_blas-kernels.cfg
[MODULE mkl_blas]
typemaps:
MKL_INT: int64
includes:
mkl_blas.h
kinds: Xnd, C
ellipses: none, ...
[KERNEL dot]
prototypes:
double ddot(MKL_INT *n, double *x, MKL_INT *incx, double *y, MKL_INT *incy);
float sdot(MKL_INT *n, float *x, MKL_INT *incx, float *y, MKL_INT *incy);
description: Compute dot product of two arrays
input_arguments: x(n), y(n)
hide_arguments: n = len(x), incx = 1, incy = 1
</code></pre>
<pre><code class="language-bash"># Generate kernels (mkl_blas-kernels.c)
# and Python extension module (mkl_blas-python.c)
$ xnd_tools module mkl_blas-kernels.cfg
</code></pre>
<pre><code class="language-python">>>> # Build Python extension and use:
>>> import mkl_blas
>>> from xnd import xnd
>>> x = xnd([[1,2], [3,4]], dtype = 'float64')
>>> mkl_blas.dot(x, x)
xnd([5.0, 25.0], type='2 * float64')
</code></pre>
</div>
</div>
</div>
</main>
<footer class="mt-4 py-4 bg-light">
<div class="container">
<div class="row">
<div class="col-6">
<p class="mb-0">Supported by
<a href="https://www.quansight.com/">Quansight</a>
</p>
</div>
<div class="col-6">
<p class="float-right mb-0">
<a href="https://github.com/xnd-project/website">Edit on GitHub</a>
</p>
</div>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<!-- Code highlighting -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-bash.min.js" integrity="sha256-Ch5rv5tgAdVMCh7Wqb0UOcXkQAHNFSezi+0v/0z6xfw="
crossorigin="anonymous"></script>
</body>
</html>