Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 850486b

Browse files
authored
Merge pull request #107 from PokhodenkoSA/move/readme
Move README.rst and HowTo.rst to `numba-dppy`
2 parents b5bdbab + f30cedb commit 850486b

File tree

3 files changed

+140
-97
lines changed

3 files changed

+140
-97
lines changed

README.rst

Lines changed: 70 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,96 @@
1-
Numba with PyDPPL
2-
=================
1+
*****
2+
Numba with patches for numba-dppy
3+
*****
34

4-
========
5-
1. What?
6-
========
5+
.. image:: https://badges.gitter.im/numba/numba.svg
6+
:target: https://gitter.im/numba/numba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
7+
:alt: Gitter
78

8-
DPPL proof-of-concept backend for NUMBA to support compilation for Intel CPU and
9-
GPU architectures. The present implementation of DPPL is based on OpenCL 2.1,
10-
but is likely to change in the future to rely on Sycl/DPC++ or Intel Level-0
11-
driver API.
9+
.. image:: https://img.shields.io/badge/discuss-on%20discourse-blue
10+
:target: https://numba.discourse.group/
11+
:alt: Discourse
1212

13-
===============
14-
2. Perquisites?
15-
===============
13+
Patches for numba-dppy
14+
######################
1615

17-
- Bash : In the system and not as default Shell
18-
- Tar : To extract files
19-
- Git : To fetch required dependencies listed below
20-
- C/C++ compiler : To build the dependencies
21-
- Cmake : For managing build process of dependencies
22-
- Python3 : Version 3 is required
23-
- Conda or miniconda : Can be found at https://docs.conda.io/en/latest/miniconda.html
24-
- OpenCL 2.1 driver : DPPL currently works for both Intel GPUs and CPUs is a correct OpenCL driver version is found on the system.
25-
Note. To use the GPU users should be added to "video" user group on Linux systems.
16+
See https://github.com/IntelPython/numba-dppy.
17+
If `numba-dppy` package is installed this version of Numba provides
18+
additional features.
19+
Without `numba-dppy` package this version of Numba works like original Numba.
2620

21+
A Just-In-Time Compiler for Numerical Functions in Python
22+
#########################################################
2723

28-
The following requisites will need to be present in the system. Refer to next section for more details.
29-
*******************************************************************************************************
24+
Numba is an open source, NumPy-aware optimizing compiler for Python sponsored
25+
by Anaconda, Inc. It uses the LLVM compiler project to generate machine code
26+
from Python syntax.
3027

31-
- NUMBA v0.51 : The DPPL backend has only been tested for NUMBA v0.51.
32-
The included install script downloads and applies
33-
the DPPy patch to the correct NUMBA version.
28+
Numba can compile a large subset of numerically-focused Python, including many
29+
NumPy functions. Additionally, Numba has support for automatic
30+
parallelization of loops, generation of GPU-accelerated code, and creation of
31+
ufuncs and C callbacks.
3432

35-
- LLVM-SPIRV translator: Used for SPIRV generation from LLVM IR.
33+
For more information about Numba, see the Numba homepage:
34+
http://numba.pydata.org
3635

37-
- LLVMDEV : To support LLVM IR generation.
36+
Supported Platforms
37+
===================
3838

39-
- Others : All existing dependencies for NUMBA, such as llvmlite, also apply to DPPL.
39+
* Operating systems and CPU:
4040

41-
==================
42-
3. How to install?
43-
==================
44-
Install Pre-requisites
45-
**********************
46-
Make sure the following dependencies of NUMBA-PyDPPL are installed
47-
in your conda environemtn:
41+
- Linux: x86 (32-bit), x86_64, ppc64le (POWER8 and 9), ARMv7 (32-bit),
42+
ARMv8 (64-bit)
43+
- Windows: x86, x86_64
44+
- macOS: x86_64
4845

49-
- llvmlite =0.33
50-
- spirv-tools
51-
- llvm-spirv
52-
- llvmdev
53-
- dpCtl =0.3
46+
* (Optional) Accelerators and GPUs:
5447

55-
Make sure the dependencies are installed with consistent version of LLVM 10.
48+
* NVIDIA GPUs (Kepler architecture or later) via CUDA driver on Linux, Windows,
49+
macOS (< 10.14)
50+
* AMD GPUs via ROCm driver on Linux
5651

57-
Install dpCtl backend
58-
*********************
59-
NUMBA-PyDPPL also depend on dpCtl backend. It can be found `here <https://github.com/IntelPython/dpCtl>`_.
60-
Please install dpCtl from package.
52+
Dependencies
53+
============
6154

62-
Install NUMBA-PyDPPL
63-
********************
64-
After all the dependencies are installed please run ``build_for_develop.sh``
65-
to get a local installation of NUMBA-PyDPPL.
55+
* Python versions: 3.6-3.8
56+
* llvmlite 0.34.*
57+
* NumPy >=1.15 (can build with 1.11 for ABI compatibility)
6658

67-
================
68-
4. Running tests
69-
================
59+
Optionally:
7060

71-
To make sure the installation was successful, try running the examples and the
72-
test suite:
61+
* Scipy >=1.0.0 (for ``numpy.linalg`` support)
7362

74-
$PATH_TO_NUMBA-PyDPPL/numba/dppl/examples/
7563

76-
To run the test suite execute the following:
64+
Installing
65+
==========
7766

78-
.. code-block:: bash
67+
The easiest way to install Numba and get updates is by using the Anaconda
68+
Distribution: https://www.anaconda.com/download
7969

80-
python -m numba.runtests numba.dppl.tests
70+
::
8171

82-
===========================
83-
5. How Tos and Known Issues
84-
===========================
72+
$ conda install numba
8573

86-
Refer the HowTo.rst guide for an overview of the programming semantics,
87-
examples, supported functionalities, and known issues.
74+
For more options, see the Installation Guide: http://numba.pydata.org/numba-doc/latest/user/installing.html
8875

89-
* Installing while Intel oneAPI Base Toolkit is activated have shown to throw error
90-
while installation of NUMBA-PyDPPL because of incompatible TBB interface,
91-
one way around that is to temporarily move env variable TBBROOT to something else*
76+
Documentation
77+
=============
9278

93-
===================
94-
6. Reporting issues
95-
===================
79+
http://numba.pydata.org/numba-doc/latest/index.html
80+
81+
82+
Mailing Lists
83+
=============
84+
85+
Join the Numba mailing list numba-users@continuum.io:
86+
https://groups.google.com/a/continuum.io/d/forum/numba-users
87+
88+
Some old archives are at: http://librelist.com/browser/numba/
89+
90+
91+
Continuous Integration
92+
======================
9693

97-
Please use https://github.com/IntelPython/numba/issues to report issues and bugs.
94+
.. image:: https://dev.azure.com/numba/numba/_apis/build/status/numba.numba?branchName=master
95+
:target: https://dev.azure.com/numba/numba/_build/latest?definitionId=1?branchName=master
96+
:alt: Azure Pipelines

HowTo.rst renamed to numba-dppy/HowTo.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
Features
33
========
44

5-
DPPL is currently implemented using OpenCL 2.1. The features currently available
5+
DPPY is currently implemented using OpenCL 2.1. The features currently available
66
are listed below with the help of sample code snippets. In this release we have
77
the implementation of the OAK approach described in MS138 in section 4.3.2. The
88
new decorator is described below.
99

10-
To access the features driver module have to be imported from numba.dppl.dppl_driver
10+
To access the features driver module have to be imported from numba_dppy.dppl_driver
1111

1212
New Decorator
1313
=============
1414

15-
The new decorator included in this release is *dppl.kernel*. Currently this decorator
15+
The new decorator included in this release is *numba_dppy.kernel*. Currently this decorator
1616
takes only one option *access_types* which is explained below with the help of an example.
1717
Users can write OpenCL tpye kernels where they can identify the global id of the work item
1818
being executed. The supported methods inside a decorated function are:
1919

20-
- dppl.get_global_id(dimidx)
21-
- dppl.get_local_id(dimidx)
22-
- dppl.get_group_num(dimidx)
23-
- dppl.get_num_groups(dimidx)
24-
- dppl.get_work_dim()
25-
- dppl.get_global_size(dimidx)
26-
- dppl.get_local_size(dimidx)
20+
- numba_dppy.get_global_id(dimidx)
21+
- numba_dppy.get_local_id(dimidx)
22+
- numba_dppy.get_group_num(dimidx)
23+
- numba_dppy.get_num_groups(dimidx)
24+
- numba_dppy.get_work_dim()
25+
- numba_dppy.get_global_size(dimidx)
26+
- numba_dppy.get_local_size(dimidx)
2727

2828
Currently no support is provided for local memory in the device and everything is in the
2929
global memory. Barrier and other memory fences will be provided once support for local
@@ -61,7 +61,7 @@ Primitive types are passed by value to the kernel, currently supported are int,
6161
Math Kernels
6262
============
6363

64-
This release has support for math kernels. See numba/dppl/tests/dppl/test_math_functions.py
64+
This release has support for math kernels. See numba_dppy/tests/dppl/test_math_functions.py
6565
for more details.
6666

6767

@@ -72,7 +72,7 @@ Examples
7272
Sum of two 1d arrays
7373
====================
7474

75-
Full example can be found at numba/dppl/examples/sum.py.
75+
Full example can be found at numba_dppy/examples/sum.py.
7676

7777
To write a program that sums two 1d arrays we at first need a OpenCL device environment.
7878
We can get the environment by using *ocldrv.runtime.get_gpu_device()* for getting the
@@ -82,7 +82,7 @@ where *device_env.copy_array_to_device(data)* will read the ndarray and copy tha
8282
and *ocldrv.DeviceArray(device_env.get_env_ptr(), data)* will create a buffer in the device
8383
that has the same memory size as the ndarray being passed. The OpenCL Kernel in the
8484
folllowing example is *data_parallel_sum*. To get the id of the work item we are currently
85-
executing we need to use the *dppl.get_global_id(0)*, since this example only 1 dimension
85+
executing we need to use the *numba_dppy.get_global_id(0)*, since this example only 1 dimension
8686
we only need to get the id in dimension 0.
8787

8888
While invoking the kernel we need to pass the device environment and the global work size.
@@ -91,9 +91,9 @@ back to the host and we can use *device_env.copy_array_from_device(ddata)*.
9191

9292
.. code-block:: python
9393
94-
@dppl.kernel
94+
@numba_dppy.kernel
9595
def data_parallel_sum(a, b, c):
96-
i = dppl.get_global_id(0)
96+
i = numba_dppy.get_global_id(0)
9797
c[i] = a[i] + b[i]
9898
9999
global_size = 10
@@ -126,7 +126,7 @@ ndArray Support
126126

127127
Support for passing ndarray directly to kernels is also supported.
128128

129-
Full example can be found at numba/dppl/examples/sum_ndarray.py
129+
Full example can be found at numba_dppy/examples/sum_ndarray.py
130130

131131
For availing this feature instead of creating device buffers explicitly like the previous
132132
example, users can directly pass the ndarray to the kernel. Internally it will result in
@@ -148,7 +148,7 @@ Reduction
148148

149149
This example will demonstrate a sum reduction of 1d array.
150150

151-
Full example can be found at numba/dppl/examples/sum_reduction.py.
151+
Full example can be found at numba_dppy/examples/sum_reduction.py.
152152

153153
In this example to sum the 1d array we invoke the Kernel multiple times.
154154
This can be implemented by invoking the kernel once, but that requires
@@ -161,15 +161,15 @@ ParFor Support
161161

162162
*Parallel For* is supported in this release for upto 3 dimensions.
163163

164-
Full examples can be found in numba/dppl/examples/pa_examples/
164+
Full examples can be found in numba_dppy/examples/pa_examples/
165165

166166

167167
=======
168168
Testing
169169
=======
170170

171-
All examples can be found in numba/dppl/examples/
171+
All examples can be found in numba_dppy/examples/
172172

173-
All tests can be found in numba/dppl/tests/dppl and can be triggered by the following command:
173+
All tests can be found in numba_dppy/tests/dppl and can be triggered by the following command:
174174

175-
``python -m numba.runtests numba.dppl.tests``
175+
``python -m numba.runtests numba_dppy.tests``

numba-dppy/README.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# numba-dppy
22

3-
## Numba + dpCtl + dpNP = numba-dppy
3+
## Numba + dpPy + dpCtl + dpNP = numba-dppy
44

55
`numba-dppy` extends Numba with new backend for support compilation
66
for Intel CPU and GPU architectures.
77

88
For more information about Numba, see the Numba homepage:
9-
http://numba.pydata.org
9+
http://numba.pydata.org.
10+
11+
Note: `numba-dppy` requires patched version of Numba.
12+
See https://github.com/IntelPython/numba.
1013

1114
For more information about dpCtl, see the dpCtl homepage:
1215
https://intelpython.github.io/dpctl/
@@ -16,6 +19,47 @@ https://intelpython.github.io/dpnp/
1619

1720
## Dependencies
1821

19-
* numba
20-
* dpCtl
21-
* dpNP (optional)
22+
* numba >=0.51 (IntelPython/numba)
23+
* dpCtl >=0.3.8
24+
* dpNP >=0.3 (optional)
25+
* llvm-spirv (SPIRV generation from LLVM IR)
26+
* llvmdev (LLVM IR generation)
27+
* spirv-tools
28+
29+
## dpPy
30+
31+
dpPy is a proof-of-concept backend for NUMBA to support compilation for
32+
Intel CPU and GPU architectures.
33+
The present implementation of dpPy is based on OpenCL 2.1, but is likely
34+
to change in the future to rely on Sycl/DPC++ or Intel Level-0 driver API.
35+
36+
## Installation
37+
38+
Use setup.py or conda (see conda-recipe).
39+
40+
## Testing
41+
42+
See folder `numba_dppy/tests`.
43+
44+
Run tests:
45+
```bash
46+
python -m numba.runtests numba_dppy.tests
47+
```
48+
49+
## Examples
50+
51+
See folder `numba_dppy/examples`.
52+
53+
Run examples:
54+
```bash
55+
python numba_dppy/examples/sum.py
56+
```
57+
58+
## How Tos
59+
60+
Refer the HowTo.rst guide for an overview of the programming semantics,
61+
examples, supported functionalities, and known issues.
62+
63+
## Reporting issues
64+
65+
Please use https://github.com/IntelPython/numba-dppy/issues to report issues and bugs.

0 commit comments

Comments
 (0)