1
- .. _overview
1
+ .. _overview :
2
2
.. include :: ./ext_links.txt
3
3
4
4
Overview
5
5
========
6
6
7
- Data-Parallel Extensions for Numba* (`numba-dpex `_) is a standalone extension
8
- for the `Numba* `_ Python JIT compiler. Numba-dpex adds two new features to
9
- Numba: an architecture-agnostic kernel programming API, and a new compilation
10
- target that adds typing and compilation support for the `dpnp `_ library. Dpnp is
11
- a Python library for numerical computing that provides a data-parallel
12
- reimplementation of `NumPy* `_'s API. Numba-dpex's support for dpnp compilation
13
- is a new way for Numba users to write code in a NumPy-like API that is
14
- already supported by Numba, while at the same time automatically running such code
15
- parallelly on various types of architecture.
16
-
17
- Numba-dpex is being developed as part of `Intel AI Analytics Toolkit `_ and is
7
+ Data Parallel Extension for Numba* (`numba-dpex `_) is a standalone extension for
8
+ the `Numba* `_ Python JIT compiler. ``numba-dpex `` adds two new features to
9
+ Numba*: an architecture-agnostic kernel programming API, and a new compilation
10
+ target that adds typing and compilation support for the Data Parallel Extension
11
+ for Numpy* (`dpnp `_) library. ``dpnp `` is a Python package for numerical
12
+ computing that provides a data-parallel reimplementation of `NumPy* `_'s API.
13
+ ``numba-dpex ``'s support for ``dpnp `` compilation is a new way for Numba* users to write
14
+ code in a NumPy-like API that is already supported by Numba*, while at the same
15
+ time automatically running such code parallelly on various types of
16
+ architecture.
17
+
18
+ ``numba-dpex `` is being developed as part of `Intel AI Analytics Toolkit `_ and is
18
19
distributed with the `Intel Distribution for Python* `_. The extension is also
19
20
available on Anaconda cloud and as a Docker image on GitHub. Please refer the
20
21
:doc: `getting_started ` page to learn more.
@@ -27,7 +28,7 @@ Portable Kernel Programming
27
28
28
29
The kernel API has a design and API similar to Numba's ``cuda.jit `` module.
29
30
However, the API uses the `SYCL* `_ language runtime and as such is extensible to
30
- various hardware types supported by a SYCL runtime. Presently, numba-dpex uses
31
+ various hardware types supported by a SYCL runtime. Presently, `` numba-dpex `` uses
31
32
the `DPC++ `_ SYCL runtime and only supports SPIR-V-based OpenCL and `oneAPI
32
33
Level Zero `_ devices CPU and GPU devices.
33
34
@@ -54,30 +55,30 @@ interface.
54
55
print (c)
55
56
56
57
In the above example, we allocated three arrays on a default ``gpu `` device
57
- using the dpnp library. These arrays are then passed as input arguments to the
58
+ using the `` dpnp `` library. These arrays are then passed as input arguments to the
58
59
kernel function. The compilation target and the subsequent execution of the
59
60
kernel is determined completely by the input arguments and follow the
60
61
"compute-follows-data" programming model as specified in the `Python* Array API
61
62
Standard `_. To change the execution target to a CPU, the device keyword needs to
62
- be changed to ``cpu `` when allocating the dpnp arrays. It is also possible to
63
- leave the ``device `` keyword undefined and let the dpnp library select a default
63
+ be changed to ``cpu `` when allocating the `` dpnp `` arrays. It is also possible to
64
+ leave the ``device `` keyword undefined and let the `` dpnp `` library select a default
64
65
device based on environment flag settings. Refer the
65
66
:doc: `user_manual/kernel_programming/index ` for further details.
66
67
67
- dpnp compilation and offload
68
+ `` dpnp `` compilation and offload
68
69
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69
70
70
- Numba -dpex extends Numba's type system and compilation pipeline to compile dpnp
71
+ `` numba -dpex`` extends Numba's type system and compilation pipeline to compile `` dpnp ``
71
72
functions and expressions in the same way as NumPy. Unlike Numba's NumPy
72
- compilation that is serial by default, numba-dpex always compiles dpnp
73
+ compilation that is serial by default, `` numba-dpex `` always compiles `` dpnp ``
73
74
expressions into offloadable kernels and executes them in parallel. The feature
74
75
is provided using a decorator ``dpjit `` that behaves identically to
75
- ``numba.njit(parallel=True) `` with the addition of dpnp compilation and offload.
76
- Offloading by numba-dpex is not just restricted to CPUs and supports all devices
76
+ ``numba.njit(parallel=True) `` with the addition of `` dpnp `` compilation and offload.
77
+ Offloading by `` numba-dpex `` is not just restricted to CPUs and supports all devices
77
78
that are presently supported by the kernel API. ``dpjit `` allows using NumPy and
78
- dpnp expressions in the same function. All NumPy compilation and parallelization
79
- is done via the default Numba code-generation pipeline, whereas dpnp expressions
80
- are compiled using the numba-dpex pipeline.
79
+ `` dpnp `` expressions in the same function. All NumPy compilation and parallelization
80
+ is done via the default Numba code-generation pipeline, whereas `` dpnp `` expressions
81
+ are compiled using the `` numba-dpex `` pipeline.
81
82
82
83
The vector addition example depicted using the kernel API can be easily
83
84
expressed in several different ways using ``dpjit ``.
@@ -105,32 +106,32 @@ expressed in several different ways using ``dpjit``.
105
106
c[i] = a[i] + b[i]
106
107
return c
107
108
108
- As with the kernel API example, a ``dpjit `` function if invoked with dpnp
109
+ As with the kernel API example, a ``dpjit `` function if invoked with `` dpnp ``
109
110
input arguments follows the compute-follows-data programming model. Refer
110
111
:doc: `user_manual/dpnp_offload/index ` for further details.
111
112
112
113
113
- Project Goal
114
- ------------
114
+ .. Project Goal
115
+ .. ------------
115
116
116
- If C++ is not your language, you can skip writing data-parallel kernels in SYCL
117
- and directly write them in Python.
117
+ .. If C++ is not your language, you can skip writing data-parallel kernels in SYCL
118
+ .. and directly write them in Python.
118
119
119
- Our package numba-dpex extends the Numba compiler to allow kernel creation
120
- directly in Python via a custom compute API
120
+ .. Our package `` numba-dpex`` extends the Numba compiler to allow kernel creation
121
+ .. directly in Python via a custom compute API
121
122
122
123
123
124
.. Contributing
124
125
.. ------------
125
126
126
127
.. Refer the `contributing guide
127
128
.. <https://github.com/IntelPython/numba-dpex/blob/main/CONTRIBUTING>`_ for
128
- .. information on coding style and standards used in numba-dpex.
129
+ .. information on coding style and standards used in `` numba-dpex`` .
129
130
130
131
.. License
131
132
.. -------
132
133
133
- .. Numba -dpex is Licensed under Apache License 2.0 that can be found in `LICENSE
134
+ .. ``numba -dpex`` is Licensed under Apache License 2.0 that can be found in `LICENSE
134
135
.. <https://github.com/IntelPython/numba-dpex/blob/main/LICENSE>`_. All usage and
135
136
.. contributions to the project are subject to the terms and conditions of this
136
137
.. license.
0 commit comments