Home

Awesome

Code style: black Imports: isort Pre-commit Conda package Coverage Status Build Sphinx OpenSSF Scorecard

DPNP - Data Parallel Extension for NumPy*

API coverage summary

Full documentation

DPNP C++ backend documentation

Build from source:

Ensure you have the following prerequisite packages installed:

After these steps, dpnp can be built in debug mode as follows:

git clone https://github.com/IntelPython/dpnp
cd dpnp
python scripts/build_locally.py

Install Wheel Package via pip

Install DPNP

python -m pip install --index-url https://software.repos.intel.com/python/pypi dpnp

Set path to Performance Libraries in case of using venv or system Python:

export LD_LIBRARY_PATH=<path_to_your_env>/lib

It is also required to set following environment variables:

export OCL_ICD_FILENAMES_RESET=1
export OCL_ICD_FILENAMES=libintelocl.so

Run test

pytest
# or
pytest tests/test_matmul.py -s -v
# or
python -m unittest tests/test_mixins.py

Run numpy external test

. ./0.env.sh
python -m tests.third_party.numpy_ext
# or
python -m tests.third_party.numpy_ext core/tests/test_umath.py
# or
python -m tests.third_party.numpy_ext core/tests/test_umath.py::TestHypot::test_simple

Building documentation:

Prerequisites:
$ conda install sphinx sphinx_rtd_theme
Building:
1. Install dpnp into your python environment
2. $ cd doc && make html
3. The documentation will be in doc/_build/html

Packaging:

. ./0.env.sh
conda-build conda-recipe/

Run benchmark:

cd benchmarks/

asv run --python=python --bench <filename without .py>
# example:
asv run --python=python --bench bench_elementwise

# or

asv run --python=python --bench <class>.<bench>
# example:
asv run --python=python --bench Elementwise.time_square

# add --quick option to run every case once but looks like first execution has additional overheads and takes a lot of time (need to be investigated)

Tests matrix:

#NameOSdistributiveinterpreterpython used fromSYCL queue managerbuild commands setforced environment
1Ubuntu 20.04 Python37LinuxUbuntu 20.04Python 3.7IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytestcmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
2Ubuntu 20.04 Python38LinuxUbuntu 20.04Python 3.8IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytestcmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
3Ubuntu 20.04 Python39LinuxUbuntu 20.04Python 3.9IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytestcmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
4Ubuntu 20.04 External Tests Python37LinuxUbuntu 20.04Python 3.7IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtestscmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
5Ubuntu 20.04 External Tests Python38LinuxUbuntu 20.04Python 3.8IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtestscmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
6Ubuntu 20.04 External Tests Python39LinuxUbuntu 20.04Python 3.9IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtestscmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
7Code styleLinuxUbuntu 20.04Python 3.8IntelOneAPIlocalpython ./setup.py stylecmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, black
8ValgrindLinuxUbuntu 20.04IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplacecmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis
9Code coverageLinuxUbuntu 20.04Python 3.8IntelOneAPIlocalexport DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplacecmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, pytest-cov