Skip to content

Commit

Permalink
Added Quick Start Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jul 18, 2023
1 parent 6c545ac commit 1b2a178
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 58 deletions.
2 changes: 1 addition & 1 deletion doc/ext_links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.. _DPC++: https://www.apress.com/gp/book/9781484255735
.. _SYCL*: https://www.khronos.org/sycl/
.. _dpctl: https://intelpython.github.io/dpctl/latest/index.html
.. _Data Parallel Control: https://intelpython.github.io/dpctl/latest/index.html
.. _Data Parallel Control Library: https://intelpython.github.io/dpctl/latest/index.html
.. _Intel oneAPI Base Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html
.. _Intel Distribution for Python*: https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html
.. _Intel AI Analytics Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-analytics-toolkit.html
50 changes: 0 additions & 50 deletions doc/getting_started.rst

This file was deleted.

4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _index:
.. include:: ./ext_links.txt

Data Parallel Extension for Numpy*
Data Parallel Extension for NumPy*
==================================

.. module:: dpnp
Expand All @@ -10,7 +10,7 @@ Data Parallel Extension for Numpy*
:maxdepth: 2

overview
getting_started
quick_start_guide
reference/index
dpnp_backend_api
dpctl
10 changes: 5 additions & 5 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Overview

.. module:: dpnp

The Data Parallel Extensions for Numpy (dpnp package) - a library that
The Data Parallel Extension for NumPy* (dpnp package) - a library that
implements a subset of `NumPy*`_ that can be executed on any
data parallel device. The subset is a drop-in replacement of core `NumPy*`_
functions and numerical data types.

The Data Parallel Extensions for Numpy is being developed as part of
The Data Parallel Extension for NumPy* is being developed as part of
`Intel AI Analytics Toolkit`_ and is distributed with the
`Intel Distribution for Python*`_. The dpnp package is also available
on Anaconda cloud. Please refer the :doc:`getting_started` page to learn more.
Expand All @@ -26,15 +26,15 @@ The :class:`dpnp.ndarray` class is a compatible alternative of
>>> x = np.array([1, 2, 3])

``x`` in the above example is an instance of :class:`dpnp.ndarray` that
is created identically to ``NumPy``'s one. The key difference of
is created identically to ``NumPy*``'s one. The key difference of
:class:`dpnp.ndarray` from :class:`numpy.ndarray` is that the memory
is allocated on the default `SYCL*`_ device, which is a ``"gpu"`` on systems
with integrated or discrete GPU (otherwise it is the ``"host"`` device
on systems that do not have GPU).

Most of the array manipulations are also done in the way similar to NumPy such as:
Most of the array manipulations are also done in the way similar to `NumPy*`_ such as:

>>> s = np.sum(x)

Please see the :ref:`API Reference <dpnp_reference>` for the complete list of supported NumPy APIs
Please see the :ref:`API Reference <dpnp_reference>` for the complete list of supported `NumPy*`_ APIs
along with their limitations.
123 changes: 123 additions & 0 deletions doc/quick_start_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.. _quick_start_guide:
.. include:: ./ext_links.txt

.. |copy| unicode:: U+000A9

.. |trade| unicode:: U+2122

=================
Quick Start Guide
=================

Device Drivers
=================

To start programming data parallel devices beyond CPU, you will need
an appropriate hardware. The Data Parallel Extension for NumPy* works fine
on Intel |copy| laptops with integrated graphics. In majority of cases,
your Windows*-based laptop already has all necessary device drivers installed.
But if you want the most up-to-date driver, you can always
`update it to the latest one <https://www.intel.com/content/www/us/en/download-center/home.html>`_.
Follow device driver installation instructions to complete the step.


Python Interpreter
=================

You will need Python 3.8, 3.9, or 3.10 installed on your system. If you
do not have one yet the easiest way to do that is to install
`Intel Distribution for Python*`_. It installs all essential Python numerical
and machine learning packages optimized for the Intel hardware, including
Data Parallel Extension for NumPy*.
If you have Python installation from another vendor, it is fine too. All you
need is to install Data Parallel Extension for NumPy* manually as shown
in the next installation section.


Installation
============

Install Package from Anaconda
---------------------

It is recommended to use conda packages from the ``anaconda.org/intel``
channel. You will need one of the commands below:

* Conda: ``conda install numba-dpex``

* Pip: ``pip install numba-dpex``

These commands install dpnp package along with its dependencies, including
``dpctl`` package with `Data Parallel Control Library`_ and all required
compiler runtimes and OneMKL.

.. note::
Before installing with conda or pip it is strongly advised to update ``conda`` and ``pip`` to latest versions


Build and Install Conda Package
-------------------------------

Alternatively you can create and activate a local conda build environment:

.. code-block:: bash
conda create -n build-env conda-build
conda activate build-env
And to build dpnp package from the sources:

.. code-block:: bash
conda build conda-recipe -c intel -c conda-forge
Finanly, to install the result package:

.. code-block:: bash
conda install dpnp
Build and Install with scikit-build
-----------------------------------

Another way to build and install dpnp package from the source is to use Python
``setuptools`` and ``scikit-build``. You will need to create a local conda
build environment by command below depending on hosting OS.

On Linux:

.. code-block:: bash
conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c intel -c conda-forge
conda activate build-env
On Windows:

.. code-block:: bash
conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c intel -c conda-forge
conda activate build-env
To build and install the package on Linux OS, run:

.. code-block:: bash
python setup.py install -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx
To build and install the package on Windows OS, run:

.. code-block:: bash
python setup.py install -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx
Testing
=======

If you want to execute the scope of Python test suites which are available
by the source, you will need to run a command as below:

.. code-block:: bash
pytest -s tests

0 comments on commit 1b2a178

Please sign in to comment.