[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Pre-commit](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml)
[![Conda package](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml)
[![Coverage Status](https://coveralls.io/repos/github/IntelPython/dpnp/badge.svg?branch=master)](https://coveralls.io/github/IntelPython/dpnp?branch=master)
[![Build Sphinx](https://github.com/IntelPython/dpnp/workflows/Build%20Sphinx/badge.svg)](https://intelpython.github.io/dpnp)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/dpnp/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/dpnp)
# DPNP - Data Parallel Extension for NumPy*
[API coverage summary](https://intelpython.github.io/dpnp/reference/comparison.html#summary)
[Full documentation](https://intelpython.github.io/dpnp/)
[DPNP C++ backend documentation](https://intelpython.github.io/dpnp/backend_doc/)
## Build from source:
Ensure you have the following prerequisite packages installed:
- `cython`
- `cmake >=3.21`
- `dpcpp_linux-64` or `dpcpp_win-64` (depending on your OS)
- `dpctl`
- `mkl-devel-dpcpp`
- `onedpl-devel`
- `ninja`
- `numpy >=1.19,<1.25a0`
- `python`
- `scikit-build`
- `setuptools`
- `sysroot_linux-64 >=2.28` (only on Linux OS)
- `tbb-devel`
After these steps, `dpnp` can be built in debug mode as follows:
```bash
git clone https://github.com/IntelPython/dpnp
cd dpnp
python scripts/build_locally.py
```
## Install Wheel Package via pip
Install DPNP
```cmd
python -m pip install --index-url https://pypi.anaconda.org/intel/simple dpnp
```
Set path to Performance Libraries in case of using venv or system Python:
```cmd
export LD_LIBRARY_PATH=<path_to_your_env>/lib
```
It is also required to set following environment variables:
```cmd
export OCL_ICD_FILENAMES_RESET=1
export OCL_ICD_FILENAMES=libintelocl.so
```
## Run test
```bash
pytest
# or
pytest tests/test_matmul.py -s -v
# or
python -m unittest tests/test_mixins.py
```
## Run numpy external test
```bash
. ./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:
```bash
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:
```bash
. ./0.env.sh
conda-build conda-recipe/
```
## Run benchmark:
```bash
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:
| # |Name |OS |distributive|interpreter|python used from|SYCL queue manager|build commands set |forced environment |
|---|------------------------------------|-----|------------|-----------|:--------------:|:----------------:|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
|1 |Ubuntu 20.04 Python37 |Linux|Ubuntu 20.04|Python 3.7 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|2 |Ubuntu 20.04 Python38 |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|3 |Ubuntu 20.04 Python39 |Linux|Ubuntu 20.04|Python 3.9 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|4 |Ubuntu 20.04 External Tests Python37|Linux|Ubuntu 20.04|Python 3.7 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|5 |Ubuntu 20.04 External Tests Python38|Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|6 |Ubuntu 20.04 External Tests Python39|Linux|Ubuntu 20.04|Python 3.9 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|7 |Code style |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |python ./setup.py style |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, black |
|8 |Valgrind |Linux|Ubuntu 20.04| | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |
|9 |Code coverage |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, pytest-cov|
Raw data
{
"_id": null,
"home_page": "https://github.com/IntelPython/dpnp",
"name": "dpnp",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "sycl numpy python3 intel mkl oneapi gpu dpcpp",
"author": "Intel Corporation",
"author_email": null,
"download_url": null,
"platform": "Linux",
"description": "[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Pre-commit](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml)\n[![Conda package](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml)\n[![Coverage Status](https://coveralls.io/repos/github/IntelPython/dpnp/badge.svg?branch=master)](https://coveralls.io/github/IntelPython/dpnp?branch=master)\n[![Build Sphinx](https://github.com/IntelPython/dpnp/workflows/Build%20Sphinx/badge.svg)](https://intelpython.github.io/dpnp)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/dpnp/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/dpnp)\n\n# DPNP - Data Parallel Extension for NumPy*\n[API coverage summary](https://intelpython.github.io/dpnp/reference/comparison.html#summary)\n\n[Full documentation](https://intelpython.github.io/dpnp/)\n\n[DPNP C++ backend documentation](https://intelpython.github.io/dpnp/backend_doc/)\n\n## Build from source:\nEnsure you have the following prerequisite packages installed:\n\n- `cython`\n- `cmake >=3.21`\n- `dpcpp_linux-64` or `dpcpp_win-64` (depending on your OS)\n- `dpctl`\n- `mkl-devel-dpcpp`\n- `onedpl-devel`\n- `ninja`\n- `numpy >=1.19,<1.25a0`\n- `python`\n- `scikit-build`\n- `setuptools`\n- `sysroot_linux-64 >=2.28` (only on Linux OS)\n- `tbb-devel`\n\nAfter these steps, `dpnp` can be built in debug mode as follows:\n\n```bash\ngit clone https://github.com/IntelPython/dpnp\ncd dpnp\npython scripts/build_locally.py\n```\n\n## Install Wheel Package via pip\nInstall DPNP\n```cmd\npython -m pip install --index-url https://pypi.anaconda.org/intel/simple dpnp\n```\n\nSet path to Performance Libraries in case of using venv or system Python:\n```cmd\nexport LD_LIBRARY_PATH=<path_to_your_env>/lib\n```\n\nIt is also required to set following environment variables:\n```cmd\nexport OCL_ICD_FILENAMES_RESET=1\nexport OCL_ICD_FILENAMES=libintelocl.so\n```\n\n## Run test\n```bash\npytest\n# or\npytest tests/test_matmul.py -s -v\n# or\npython -m unittest tests/test_mixins.py\n```\n\n## Run numpy external test\n```bash\n. ./0.env.sh\npython -m tests.third_party.numpy_ext\n# or\npython -m tests.third_party.numpy_ext core/tests/test_umath.py\n# or\npython -m tests.third_party.numpy_ext core/tests/test_umath.py::TestHypot::test_simple\n```\n\n### Building documentation:\n```bash\nPrerequisites:\n$ conda install sphinx sphinx_rtd_theme\nBuilding:\n1. Install dpnp into your python environment\n2. $ cd doc && make html\n3. The documentation will be in doc/_build/html\n```\n\n## Packaging:\n```bash\n. ./0.env.sh\nconda-build conda-recipe/\n```\n\n## Run benchmark:\n```bash\ncd benchmarks/\n\nasv run --python=python --bench <filename without .py>\n# example:\nasv run --python=python --bench bench_elementwise\n\n# or\n\nasv run --python=python --bench <class>.<bench>\n# example:\nasv run --python=python --bench Elementwise.time_square\n\n# 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)\n```\n\n\n## Tests matrix:\n| # |Name |OS |distributive|interpreter|python used from|SYCL queue manager|build commands set |forced environment |\n|---|------------------------------------|-----|------------|-----------|:--------------:|:----------------:|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|\n|1 |Ubuntu 20.04 Python37 |Linux|Ubuntu 20.04|Python 3.7 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|2 |Ubuntu 20.04 Python38 |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|3 |Ubuntu 20.04 Python39 |Linux|Ubuntu 20.04|Python 3.9 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace pytest |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|4 |Ubuntu 20.04 External Tests Python37|Linux|Ubuntu 20.04|Python 3.7 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|5 |Ubuntu 20.04 External Tests Python38|Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|6 |Ubuntu 20.04 External Tests Python39|Linux|Ubuntu 20.04|Python 3.9 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace python -m tests_external.numpy.runtests|cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|7 |Code style |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |python ./setup.py style |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, black |\n|8 |Valgrind |Linux|Ubuntu 20.04| | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis |\n|9 |Code coverage |Linux|Ubuntu 20.04|Python 3.8 | IntelOneAPI | local |export DPNP_DEBUG=1 python setup.py clean python setup.py build_clib python setup.py build_ext --inplace |cmake-3.19.2, valgrind, pytest-valgrind, conda-build, pytest, hypothesis, conda-verify, pycodestyle, autopep8, pytest-cov|\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Data Parallel Extension for NumPy",
"version": "0.14.0",
"project_urls": {
"Homepage": "https://github.com/IntelPython/dpnp"
},
"split_keywords": [
"sycl",
"numpy",
"python3",
"intel",
"mkl",
"oneapi",
"gpu",
"dpcpp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "155d89ce420232cdd5eee296302970398e5a3fc27ccfc37a1bc1f764cdc22b40",
"md5": "466cf194b82ba8c417efb5f07afeb6a3",
"sha256": "d5ada184376cd8de3f3ae726e44a4f1e5349b127e7666e2bd31604c8a8585218"
},
"downloads": -1,
"filename": "dpnp-0.14.0-189-cp310-cp310-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "466cf194b82ba8c417efb5f07afeb6a3",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 15002204,
"upload_time": "2024-03-26T22:33:20",
"upload_time_iso_8601": "2024-03-26T22:33:20.591657Z",
"url": "https://files.pythonhosted.org/packages/15/5d/89ce420232cdd5eee296302970398e5a3fc27ccfc37a1bc1f764cdc22b40/dpnp-0.14.0-189-cp310-cp310-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "da077d33f25829ab193ebff0a62ef28de4af11be8586531aa182da35e7d68b03",
"md5": "ccdf3705ce18848186ef6f50b38bea84",
"sha256": "dc58db1f71f4ef64abc1bf46ea49ca6846c9a42f11f18dce819f29489d66ed26"
},
"downloads": -1,
"filename": "dpnp-0.14.0-189-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "ccdf3705ce18848186ef6f50b38bea84",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 10361930,
"upload_time": "2024-03-26T22:33:24",
"upload_time_iso_8601": "2024-03-26T22:33:24.432653Z",
"url": "https://files.pythonhosted.org/packages/da/07/7d33f25829ab193ebff0a62ef28de4af11be8586531aa182da35e7d68b03/dpnp-0.14.0-189-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e574f59ee74792140ef6f28a7f8768cfe578c45ab4565cd8245041fa1e908f07",
"md5": "388686af568ffd76cd94e87a06828dbd",
"sha256": "971730e1f4a8245aced08b91917bb63329d79363303f6cee49c1011fda4fce01"
},
"downloads": -1,
"filename": "dpnp-0.14.0-189-cp39-cp39-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "388686af568ffd76cd94e87a06828dbd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 15005812,
"upload_time": "2024-03-26T22:33:12",
"upload_time_iso_8601": "2024-03-26T22:33:12.796517Z",
"url": "https://files.pythonhosted.org/packages/e5/74/f59ee74792140ef6f28a7f8768cfe578c45ab4565cd8245041fa1e908f07/dpnp-0.14.0-189-cp39-cp39-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd3c4e016ec0a7a0cd3e770d01a62b4d428ecd50946163d004b8db45ae9e6eca",
"md5": "4dfa581122f6760cbea69b0c26d9a118",
"sha256": "ddd933b83200ff328bae36685cfb2668eb48bedca5b98693ff7631ee5378ad83"
},
"downloads": -1,
"filename": "dpnp-0.14.0-189-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "4dfa581122f6760cbea69b0c26d9a118",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 10365562,
"upload_time": "2024-03-26T22:33:27",
"upload_time_iso_8601": "2024-03-26T22:33:27.932849Z",
"url": "https://files.pythonhosted.org/packages/bd/3c/4e016ec0a7a0cd3e770d01a62b4d428ecd50946163d004b8db45ae9e6eca/dpnp-0.14.0-189-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-26 22:33:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "IntelPython",
"github_project": "dpnp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dpnp"
}