Skip to content

Commit fa83add

Browse files
deploy: d1b2a2b
1 parent 50e1d9f commit fa83add

File tree

118 files changed

+36068
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+36068
-0
lines changed

pull/1116/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 6d807dd66b561429f1b82b39b187f96e
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/1116/.nojekyll

Whitespace-only changes.
39.2 KB
Loading
16.7 KB
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. _index:
2+
.. include:: ./../ext_links.txt
3+
4+
5+
API Reference
6+
=============
7+
8+
Coming soon
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. _contributions:
2+
.. include:: ./ext_links.txt
3+
4+
Contribution Guide
5+
==================
6+
7+
Classification of Contributions
8+
-------------------------------
9+
10+
Development Cycle
11+
-----------------
12+
13+
Issues and Pull Requests
14+
------------------------
15+
16+
Coding Guidelines
17+
-----------------
18+
19+
Unit Testing
20+
-------------
21+
22+
Documentation
23+
-------------
24+
25+
Tips for Developers
26+
-------------------

pull/1116/_sources/examples.rst.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. _examples:
2+
.. include:: ./ext_links.txt
3+
4+
List of examples
5+
================
6+
7+
.. todo::
8+
Provide list of examples for numba-dpex
9+
10+
Benchmarks
11+
**********
12+
13+
.. todo::
14+
Provide instructions for dpbench
15+
16+
Jupyter* Notebooks
17+
******************
18+
19+
.. todo::
20+
Provide instructions for Jupyter Notebook samples
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
.. _getting_started:
2+
.. include:: ./ext_links.txt
3+
4+
.. |copy| unicode:: U+000A9
5+
6+
.. |trade| unicode:: U+2122
7+
8+
Getting Started
9+
===============
10+
11+
12+
Installing pre-built conda packages
13+
-----------------------------------
14+
15+
``numba-dpex`` along with its dependencies can be installed using ``conda``.
16+
It is recommended to use conda packages from the ``anaconda.org/intel`` channel
17+
to get the latest production releases.
18+
19+
.. code-block:: bash
20+
21+
conda create -n numba-dpex-env \
22+
numba-dpex dpnp dpctl dpcpp-llvm-spirv \
23+
-c intel -c conda-forge
24+
25+
To try out the bleeding edge, the latest packages built from tip of the main
26+
source trunk can be installed from the ``dppy/label/dev`` conda channel.
27+
28+
.. code-block:: bash
29+
30+
conda create -n numba-dpex-env \
31+
numba-dpex dpnp dpctl dpcpp-llvm-spirv \
32+
-c dppy/label/dev -c intel -c conda-forge
33+
34+
35+
36+
Building from source
37+
--------------------
38+
39+
``numba-dpex`` can be built from source using either ``conda-build`` or
40+
``setuptools`` (with ``scikit-build`` backend).
41+
42+
Steps to build using ``conda-build``:
43+
44+
1. Ensure ``conda-build`` is installed in the ``base`` conda environment or
45+
create a new conda environment with ``conda-build`` installed.
46+
47+
.. code-block:: bash
48+
49+
conda create -n build-env conda-build
50+
conda activate build-env
51+
52+
2. Build using the vendored conda recipe
53+
54+
.. code-block:: bash
55+
56+
conda build conda-recipe -c intel -c conda-forge
57+
58+
3. Install the conda package
59+
60+
.. code-block:: bash
61+
62+
conda install -c local numba-dpex
63+
64+
Steps to build using ``setup.py``:
65+
66+
As before, a conda environment with all necessary dependencies is the suggested
67+
first step.
68+
69+
.. code-block:: bash
70+
71+
# Create a conda environment that hass needed dependencies installed
72+
conda create -n numba-dpex-env \
73+
scikit-build cmake dpctl dpnp numba dpcpp-llvm-spirv llvmdev pytest \
74+
-c intel -c conda-forge
75+
# Activate the environment
76+
conda activate numba-dpex-env
77+
# Clone the numba-dpex repository
78+
git clone https://github.com/IntelPython/numba-dpex.git
79+
cd numba-dpex
80+
python setup.py develop
81+
82+
Building inside Docker
83+
----------------------
84+
85+
A Dockerfile is provided on the GitHub repository to build ``numba-dpex``
86+
as well as its direct dependencies: ``dpctl`` and ``dpnp``. Users can either use
87+
one of the pre-built images on the ``numba-dpex`` GitHub page or use the
88+
bundled Dockerfile to build ``numba-dpex`` from source. Using the Dockerfile
89+
also ensures that all device drivers and runtime libraries are pre-installed.
90+
91+
Building
92+
~~~~~~~~
93+
94+
Numba dpex ships with multistage Dockerfile, which means there are
95+
different `targets <https://docs.docker.com/build/building/multi-stage/#stop-at-a-specific-build-stage>`_
96+
available for build. The most useful ones:
97+
98+
- ``runtime``
99+
- ``runtime-gpu``
100+
- ``numba-dpex-builder-runtime``
101+
- ``numba-dpex-builder-runtime-gpu``
102+
103+
To build docker image
104+
105+
.. code-block:: bash
106+
107+
docker build --target runtime -t numba-dpex:runtime ./
108+
109+
110+
To run docker image
111+
112+
.. code-block:: bash
113+
114+
docker run -it --rm numba-dpex:runtime
115+
116+
.. note::
117+
118+
When trying to build a docker image with Intel GPU support, the Dockerfile
119+
will attempt to use the GitHub API to get the latest Intel GPU drivers.
120+
Users may run into an issue related to Github API call limits. The issue
121+
can be bypassed by providing valid GitHub credentials using the
122+
``GITHUB_USER`` and ``GITHUB_PASSWORD``
123+
`build args <https://docs.docker.com/engine/reference/commandline/build/#build-arg>`_
124+
to increase the call limit. A GitHub
125+
`access token <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token>`_
126+
can also be used instead of the password.
127+
128+
.. note::
129+
130+
When building the docker image behind a firewall the proxy server settings
131+
should be provided using the ``http_proxy`` and ``https_proxy`` build args.
132+
These build args must be specified in lowercase.
133+
134+
The bundled Dockerfile supports different python versions that can be specified
135+
via the ``PYTHON_VERSION`` build arg. By default, the docker image is based on
136+
the official python image based on slim debian. The requested python version
137+
must be from the available python docker images.
138+
139+
The ``BASE_IMAGE`` build arg can be used to build the docker image from a
140+
custom image. Note that as the Dockerfile is based on debian any custom base
141+
image should be debian-based, like debian or ubuntu.
142+
143+
The list of other build args are as follows. Please refer the Dockerfile to
144+
see currently all available build args.
145+
146+
- ``PYTHON_VERSION``
147+
- ``CR_TAG``
148+
- ``IGC_TAG``
149+
- ``CM_TAG``
150+
- ``L0_TAG``
151+
- ``ONEAPI_VERSION``
152+
- ``DPCTL_GIT_BRANCH``
153+
- ``DPCTL_GIT_URL``
154+
- ``DPNP_GIT_BRANCH``
155+
- ``DPNP_GIT_URL``
156+
- ``NUMBA_DPEX_GIT_BRANCH``
157+
- ``NUMBA_DPEX_GIT_URL``
158+
- ``CMAKE_VERSION``
159+
- ``CMAKE_VERSION_BUILD``
160+
- ``INTEL_NUMPY_VERSION``
161+
- ``INTEL_NUMBA_VERSION``
162+
- ``CYTHON_VERSION``
163+
- ``SCIKIT_BUILD_VERSION``
164+
- ``http_proxy``
165+
- ``https_proxy``
166+
- ``GITHUB_USER``
167+
- ``GITHUB_PASSWORD``
168+
- ``BASE_IMAGE``
169+
170+
171+
Using the pre-built images
172+
~~~~~~~~~~~~~~~~~~~~~~~~~~
173+
174+
There are several pre-built docker images available:
175+
176+
- ``runtime`` package that provides a pre-built environment with ``numba-dpex``
177+
already installed. It is ideal to quickly setup and try
178+
``numba-dpex``.
179+
180+
.. code-block:: text
181+
182+
ghcr.io/intelpython/numba-dpex/runtime:<numba_dpex_version>-py<python_version>[-gpu]
183+
184+
- ``builder`` package that has all required dependencies pre-installed and is
185+
ideal for building ``numba-dpex`` from source.
186+
187+
.. code-block:: text
188+
189+
ghcr.io/intelpython/numba-dpex/builder:<numba_dpex_version>-py<python_version>[-gpu]
190+
191+
- ``stages`` package primarily meant for creating a new docker image that is
192+
built on top of one of the pre-built images.
193+
194+
After setting up the docker image, to run ``numba-dpex`` the following snippet
195+
can be used.
196+
197+
.. code-block:: bash
198+
199+
docker run --rm -it ghcr.io/intelpython/numba-dpex/runtime:0.20.0-py3.10 bash
200+
201+
It is advisable to verify the SYCL runtime and driver installation within the
202+
container by either running,
203+
204+
.. code-block:: bash
205+
206+
sycl-ls
207+
208+
or,
209+
210+
.. code-block:: bash
211+
212+
python -m dpctl -f
213+
214+
.. note::
215+
216+
To enable GPU device, the ``device`` argument should be used and one of the
217+
``*-gpu`` images should be used.
218+
219+
For passing GPU into container on linux use arguments ``--device=/dev/dri``.
220+
However if you are using WSL you need to pass
221+
``--device=/dev/dxg -v /usr/lib/wsl:/usr/lib/wsl`` instead.
222+
223+
For example, to run ``numba-dpex`` with GPU support on WSL:
224+
225+
.. code-block:: bash
226+
227+
docker run --rm -it \
228+
--device=/dev/dxg -v /usr/lib/wsl:/usr/lib/wsl \
229+
ghcr.io/intelpython/numba-dpex/runtime:0.20.0-py3.10-gpu
230+
231+
232+
233+
Testing
234+
-------
235+
236+
``numba-dpex`` uses pytest for unit testing and the following example
237+
shows a way to run the unit tests.
238+
239+
.. code-block:: bash
240+
241+
python -m pytest --pyargs numba_dpex.tests
242+
243+
Examples
244+
--------
245+
246+
A set of examples on how to use ``numba-dpex`` can be found in
247+
``numba_dpex/examples``.

pull/1116/_sources/glossary.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. _glossary:
2+
.. include:: ./ext_links.txt
3+
4+
Glossary
5+
========

pull/1116/_sources/index.rst.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. _index:
2+
.. include:: ./ext_links.txt
3+
4+
.. Feedbacks:
5+
.. Use proper names (as provided by marketing)
6+
.. Do not use "we/I"
7+
.. Use correct acronym, expand acronym at the first instance
8+
9+
10+
.. Follow cupy docs.
11+
12+
.. Overview:
13+
.. Main Features
14+
.. Project Goal
15+
16+
.. Getting Started:
17+
.. Yevheni
18+
.. Docker page
19+
20+
.. User Guide:
21+
.. https://intelpython.github.io/oneAPI-for-SciPy/details/programming_model/
22+
.. Kernel Programming API --> Kernel Programming Basics
23+
.. Compiling and Offloading DPNP
24+
.. - Introduce @dpjit
25+
.. - Array constructor in dpjit
26+
.. - ufunc (refer to numba)
27+
.. - prange
28+
.. -
29+
.. Debugging using GDB
30+
.. # Performance Tips
31+
.. # Troubleshooting
32+
.. Useful Links
33+
.. # To-Do
34+
35+
.. API Reference:
36+
37+
38+
Data Parallel Extension for Numba*
39+
==================================
40+
41+
.. module:: numba_dpex
42+
43+
.. toctree::
44+
:maxdepth: 2
45+
46+
overview
47+
getting_started
48+
user_guide/index
49+
api_reference/index
50+
51+
.. toctree::
52+
:maxdepth: 2
53+
:caption: Development
54+
55+
contribution_guide
56+
57+
.. toctree::
58+
:maxdepth: 2
59+
:caption: Misc Notes
60+
61+
examples
62+
glossary
63+
license
64+
release-notes

pull/1116/_sources/license.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _license:
2+
.. include:: ./ext_links.txt
3+
4+
License
5+
=======
6+
7+
Numba-dpex is Licensed under Apache License 2.0 that can be found in `LICENSE
8+
<https://github.com/IntelPython/numba-dpex/blob/main/LICENSE>`_. All usage and
9+
contributions to the project are subject to the terms and conditions of this
10+
license.

0 commit comments

Comments
 (0)