Skip to content

Update documentation based on gap analysis #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fd6546c
Docs for Device Functions (#180)
PokhodenkoSA Jan 21, 2021
061d70c
Fix black
PokhodenkoSA Jan 21, 2021
e4a5a5c
Docs for GPU Reduction (#185)
PokhodenkoSA Jan 21, 2021
9028b5e
Fix black
PokhodenkoSA Jan 21, 2021
7d0d96c
Docs for Ufuncs (#197)
PokhodenkoSA Jan 22, 2021
455cdc9
Extend docs for Debugging (#187)
akharche Jan 22, 2021
3c0c409
Python features doc (#188)
1e-to Jan 22, 2021
ae3e88d
Atomics doc (#184)
1e-to Jan 22, 2021
3963904
Memory management doc (#201)
1e-to Jan 22, 2021
8e76adb
Doc for writing kernels (#191)
akharche Jan 25, 2021
fd8ae98
RNG page (#204)
PokhodenkoSA Jan 25, 2021
820f50c
Changing description of memory (#206)
1e-to Jan 25, 2021
ccc1d36
Some edits...
Feb 3, 2021
1b8f471
make the line narrower.
Feb 3, 2021
cb77307
Add example for RNG (#215)
akharche Feb 5, 2021
54392c9
Merge branch 'main' into docs
1e-to Feb 19, 2021
7849849
Merge branch 'main' into docs
PokhodenkoSA Feb 24, 2021
b9e6dd4
Add License
PokhodenkoSA Feb 24, 2021
687b79a
Merge branch 'release0.13' into docs
PokhodenkoSA Feb 25, 2021
ed339a4
Replace DPPY GPU with SYCL-supported Devices
PokhodenkoSA Feb 26, 2021
5b65ec5
Replace DPPY kernels with SYCL kernels
PokhodenkoSA Feb 26, 2021
f494ed9
Replace GPU with SYCL-supported devices
PokhodenkoSA Feb 26, 2021
b331089
Replace DPPY and Numba-dppy with numba-dppy
PokhodenkoSA Feb 26, 2021
995c414
Merge branch 'release0.13' into docs
PokhodenkoSA Feb 26, 2021
30e0da3
Clean ups to docs.
Feb 27, 2021
a5b7138
Minor edits.
Feb 27, 2021
9a60b08
Polished Getting Started
PokhodenkoSA Mar 1, 2021
4d62f35
Merge branch 'release0.13' into docs
PokhodenkoSA Mar 1, 2021
a928a28
edit docs
akharche Mar 1, 2021
de92d7d
Add synchronization options in Numba_dppy
reazulhoque Mar 1, 2021
1f2926d
Fixed file and function name
reazulhoque Mar 1, 2021
d6f0463
Few more edits.
Mar 1, 2021
a1189e7
Minor edit.
Mar 1, 2021
ad0052c
Restore examples
PokhodenkoSA Mar 1, 2021
d9439f0
Partially revert 1f2926d
PokhodenkoSA Mar 1, 2021
04e3bae
Fix examples in device-functions.rst and add example of calling one d…
PokhodenkoSA Mar 1, 2021
44ebc97
Highlite numba-dppy in text
PokhodenkoSA Mar 1, 2021
921f1a7
Small fix
PokhodenkoSA Mar 1, 2021
1ef3181
improve dev func docs
PokhodenkoSA Mar 1, 2021
da3f085
Minor edit.
Mar 1, 2021
eb12a0a
Few more minor edits.
Mar 1, 2021
09d832f
Change static_alloc to array
reazulhoque Mar 1, 2021
d9cdd1f
Few more dppy to numba_dppy.
Mar 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ examples, supported functionalities, and known issues.

## Debugging

Please follow instructions in the [DEBUGGING.md](docs/DEBUGGING.md)
Please follow instructions in the [debugging.md](docs/dppy/debugging.md)

## Reporting issues

Expand Down
67 changes: 67 additions & 0 deletions docs/CoreFeatures.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. _core_features:

Code-generation based on a device
=================================

In ``numba-dppy``, kernels are written in a device-agnostic fashion making it
easy to write portable code. A kernel is compiled for the device on which the
kernel is enqueued to be executed. The device is specified using a
``dpctl.device_context`` context manager. In the following example, two versions
of the ``sum`` kernel are compiled, one for a GPU and another for a CPU based on
which context the function was invoked. Currently, ``numba-dppy`` supports
OpenCL CPU and GPU devices and Level Zero GPU devices. In future, compilation
support may be extended to other type of SYCL devices that are supported by
DPC++'s runtime.

.. code-block:: python

import numpy as np
import numba_dppy, numba_dppy as dppy
import dpctl

@dppy.kernel
def sum(a, b, c):
i = dppy.get_global_id(0)
c[i] = a[i] + b[i]

a = np.array(np.random.random(20), dtype=np.float32)
b = np.array(np.random.random(20), dtype=np.float32)
c = np.ones_like(a)

with dpctl.device_context("level_zero:gpu"):
sum[20, dppy.DEFAULT_LOCAL_SIZE](a, b, c)

with dpctl.device_context("opencl:cpu"):
sum[20, dppy.DEFAULT_LOCAL_SIZE](a, b, c)

Automatic offload of NumPy expressions
======================================

A key distinction between ``numba-dppy`` and other the GPU backends in Numba is
the ability to automatically offload specific data-parallel sections of a
Numba ``jit`` function.

.. todo::

Details and examples to be added.

Controllable Fallback
---------------------

By default, if a section of code cannot be offloaded to the GPU, it is automatically
executed on the CPU and warning is printed. This behavior is only applicable to ``jit``
functions, auto-offloading of NumPy calls, array expressions and ``prange`` loops.
To disable this functionality and force code running on GPU set the environment variable
``NUMBA_DPPY_FALLBACK_OPTION`` to false (e.g. ``export NUMBA_DPPY_FALLBACK_OPTION=0``). In this
case the code is not automatically offloaded to the CPU and errors occur if any.

Offload Diagnostics
-------------------

Setting the debug environment variable ``NUMBA_DPPY_OFFLOAD_DIAGNOSTICS``
(e.g. ``export NUMBA_DPPY_OFFLOAD_DIAGNOSTICS=1``) provides emission of the parallel and
offload diagnostics information based on produced parallel transforms. The level of detail
depends on the integer value between 1 and 4 that is set to the environment variable
(higher is more detailed).
In the "Auto-offloading" section there is the information on which device (device name)
this parfor or kernel was offloaded.
31 changes: 0 additions & 31 deletions docs/DEBUGGING.md

This file was deleted.

175 changes: 0 additions & 175 deletions docs/HowTo.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/INDEX.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
extensions = [
"recommonmark",
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.todo",
]

todo_include_todos = True

source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
4 changes: 0 additions & 4 deletions docs/dppy-reference/index.rst

This file was deleted.

2 changes: 0 additions & 2 deletions docs/dppy/device-functions.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/dppy/index.rst

This file was deleted.

Loading