Skip to content

Commit f5a6031

Browse files
Merge master into move_tests_folder
2 parents 83687e6 + 050f9b3 commit f5a6031

23 files changed

+1132
-222
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
pull-requests: write
3737

3838
env:
39-
python-ver: '3.9'
39+
python-ver: '3.12'
4040
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
4141
NO_INTEL_CHANNELS: '-c dppy/label/dev -c conda-forge --override-channels'
4242
# Install the latest oneAPI compiler to work around an issue
@@ -104,21 +104,15 @@ jobs:
104104

105105
# https://github.com/marketplace/actions/setup-miniconda
106106
- name: Setup miniconda
107-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
107+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
108108
with:
109109
miniforge-version: latest
110-
use-mamba: true
110+
use-mamba: 'true'
111111
channels: conda-forge
112+
conda-remove-defaults: 'true'
112113
python-version: ${{ env.python-ver }}
113114
activate-environment: 'docs'
114115

115-
# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
116-
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
117-
- name: Remove defaults channel
118-
run: |
119-
conda config --remove channels defaults
120-
conda config --show
121-
122116
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
123117
- name: Disable speed limit check in mamba
124118
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
@@ -132,16 +126,16 @@ jobs:
132126
- name: Install dpnp dependencies
133127
if: env.INSTALL_ONE_API == 'yes'
134128
run: |
135-
mamba install numpy"<1.24" dpctl">=0.18.0dev0" cmake cython pytest ninja scikit-build ${{ env.NO_INTEL_CHANNELS }}
129+
mamba install numpy dpctl">=0.18.0dev0" cmake cython pytest ninja scikit-build ${{ env.NO_INTEL_CHANNELS }}
136130
137131
- name: Install dpnp dependencies
138132
if: env.INSTALL_ONE_API != 'yes'
139133
run: |
140-
mamba install numpy"<1.24" dpctl">=0.18.0dev0" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
134+
mamba install numpy dpctl">=0.18.0dev0" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
141135
cmake cython pytest ninja scikit-build ${{ env.CHANNELS }}
142136
143137
- name: Install cuPy dependencies
144-
run: mamba install cupy cudatoolkit=10.0
138+
run: mamba install cupy
145139

146140
- name: Conda info
147141
run: mamba info

.github/workflows/conda-package.yml

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,15 @@ jobs:
5656
fetch-depth: 0
5757

5858
- name: Setup miniconda
59-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
59+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
6060
with:
6161
miniforge-version: latest
62-
use-mamba: true
62+
use-mamba: 'true'
6363
channels: conda-forge
64+
conda-remove-defaults: 'true'
6465
python-version: ${{ matrix.python }}
6566
activate-environment: 'build'
6667

67-
# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
68-
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
69-
- name: Remove defaults channel
70-
run: |
71-
conda config --remove channels defaults
72-
conda config --show
73-
7468
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
7569
- name: Disable speed limit check in mamba
7670
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
@@ -89,7 +83,7 @@ jobs:
8983
env:
9084
CACHE_NUMBER: 1 # Increase to reset cache
9185
with:
92-
path: ${{ env.CONDA_PKGS_DIR }}
86+
path: ${{ runner.os == 'Linux' && '/home/runner/conda_pkgs_dir' || 'C:\Users\runneradmin\conda_pkgs_dir' }}
9387
key:
9488
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
9589
restore-keys: |
@@ -150,17 +144,15 @@ jobs:
150144
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
151145
152146
- name: Setup miniconda
153-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
147+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
154148
with:
155149
miniforge-version: latest
156-
use-mamba: true
150+
use-mamba: 'true'
157151
channels: conda-forge
152+
conda-remove-defaults: 'true'
158153
python-version: ${{ matrix.python }}
159154
activate-environment: ${{ env.TEST_ENV_NAME }}
160155

161-
- name: Remove defaults channel
162-
run: conda config --remove channels defaults
163-
164156
- name: Install conda-index
165157
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
166158

@@ -279,17 +271,15 @@ jobs:
279271
dir ${{ env.extracted-pkg-path }}
280272
281273
- name: Setup miniconda
282-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
274+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
283275
with:
284276
miniforge-version: latest
285-
use-mamba: true
277+
use-mamba: 'true'
286278
channels: conda-forge
279+
conda-remove-defaults: 'true'
287280
python-version: ${{ matrix.python }}
288281
activate-environment: ${{ env.TEST_ENV_NAME }}
289282

290-
- name: Remove defaults channel
291-
run: conda config --remove channels defaults
292-
293283
- name: Store conda paths as envs
294284
run: |
295285
@echo on
@@ -424,17 +414,15 @@ jobs:
424414
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
425415

426416
- name: Setup miniconda
427-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
417+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
428418
with:
429419
miniforge-version: latest
430-
use-mamba: true
420+
use-mamba: 'true'
431421
channels: conda-forge
422+
conda-remove-defaults: 'true'
432423
python-version: ${{ matrix.python }}
433424
activate-environment: 'upload'
434425

435-
- name: Remove defaults channel
436-
run: conda config --remove channels defaults
437-
438426
- name: Install anaconda-client
439427
run: mamba install anaconda-client
440428

@@ -463,18 +451,16 @@ jobs:
463451
shell: bash -el {0}
464452

465453
steps:
466-
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
454+
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
467455
with:
468456
miniforge-version: latest
469-
use-mamba: true
457+
use-mamba: 'true'
470458
channels: conda-forge
471-
run-post: false
459+
conda-remove-defaults: 'true'
460+
run-post: 'false'
472461
python-version: '3.12'
473462
activate-environment: 'cleanup'
474463

475-
- name: Remove defaults channel
476-
run: conda config --remove channels defaults
477-
478464
- name: Install anaconda-client
479465
run: mamba install anaconda-client
480466

.github/workflows/generate_coverage.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,15 @@ jobs:
6262
sudo apt-get install lcov
6363
6464
- name: Setup miniconda
65-
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
65+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
6666
with:
6767
miniforge-version: latest
68-
use-mamba: true
68+
use-mamba: 'true'
6969
channels: conda-forge
70+
conda-remove-defaults: 'true'
7071
python-version: ${{ env.python-ver }}
7172
activate-environment: 'coverage'
7273

73-
# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
74-
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
75-
- name: Remove defaults channel
76-
run: |
77-
conda config --remove channels defaults
78-
conda config --show
79-
8074
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
8175
- name: Disable speed limit check in mamba
8276
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
71+
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
7272
with:
7373
sarif_file: results.sarif

README.md

Lines changed: 44 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6,117 +6,76 @@
66
[![Build Sphinx](https://github.com/IntelPython/dpnp/workflows/Build%20Sphinx/badge.svg)](https://intelpython.github.io/dpnp)
77
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/dpnp/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/dpnp)
88

9+
<img align="left" src="https://spec.oneapi.io/oneapi-logo-white-scaled.jpg" alt="oneAPI logo" width="75"/>
10+
911
# DPNP - Data Parallel Extension for NumPy*
12+
13+
Data Parallel Extension for NumPy* or `dpnp` is a Python library that
14+
implements a subset of NumPy* that can be executed on any data parallel device.
15+
The subset is a drop-in replacement of core NumPy* functions and numerical data types.
16+
1017
[API coverage summary](https://intelpython.github.io/dpnp/reference/comparison.html#summary)
1118

1219
[Full documentation](https://intelpython.github.io/dpnp/)
1320

14-
[DPNP C++ backend documentation](https://intelpython.github.io/dpnp/backend_doc/)
21+
`Dpnp` is the core part of a larger family of [data-parallel Python libraries and tools](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html)
22+
to program on XPUs.
1523

16-
## Build from source:
17-
Ensure you have the following prerequisite packages installed:
1824

19-
- `cython`
20-
- `cmake >=3.21`
21-
- `dpcpp_linux-64` or `dpcpp_win-64` (depending on your OS)
22-
- `dpctl`
23-
- `mkl-devel-dpcpp`
24-
- `onedpl-devel`
25-
- `ninja`
26-
- `numpy >=1.19,<1.25a0`
27-
- `python`
28-
- `scikit-build`
29-
- `setuptools`
30-
- `sysroot_linux-64 >=2.28` (only on Linux OS)
31-
- `tbb-devel`
25+
# Installing
3226

33-
After these steps, `dpnp` can be built in debug mode as follows:
27+
You can install the library using `conda`, `mamba` or [pip](https://pypi.org/project/dpnp/)
28+
package managers. It is also available as part of the [Intel(R) Distribution for Python](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html)
29+
(IDP).
3430

35-
```bash
36-
git clone https://github.com/IntelPython/dpnp
37-
cd dpnp
38-
python scripts/build_locally.py
39-
```
31+
## Intel(R) Distribution for Python
4032

41-
## Install Wheel Package via pip
42-
Install DPNP
43-
```cmd
44-
python -m pip install --index-url https://software.repos.intel.com/python/pypi dpnp
45-
```
33+
You can find the most recent release of `dpnp` every quarter as part of the IDP
34+
releases.
4635

47-
Set path to Performance Libraries in case of using venv or system Python:
48-
```cmd
49-
export LD_LIBRARY_PATH=<path_to_your_env>/lib
50-
```
36+
To get the library from the latest release, follow the instructions from
37+
[Get Started With Intel® Distribution for Python](https://www.intel.com/content/www/us/en/developer/articles/technical/get-started-with-intel-distribution-for-python.html).
5138

52-
It is also required to set following environment variables:
53-
```cmd
54-
export OCL_ICD_FILENAMES_RESET=1
55-
export OCL_ICD_FILENAMES=libintelocl.so
56-
```
39+
## Conda
5740

58-
## Run test
59-
```bash
60-
pytest
61-
# or
62-
pytest tests/test_matmul.py -s -v
63-
# or
64-
python -m unittest tests/test_mixins.py
65-
```
41+
To install `dpnp` from the Intel(R) conda channel, use the following command:
6642

67-
## Run numpy external test
6843
```bash
69-
. ./0.env.sh
70-
python -m tests.third_party.numpy_ext
71-
# or
72-
python -m tests.third_party.numpy_ext core/tests/test_umath.py
73-
# or
74-
python -m tests.third_party.numpy_ext core/tests/test_umath.py::TestHypot::test_simple
44+
conda install dpnp -c https://software.repos.intel.com/python/conda/ -c conda-forge
7545
```
7646

77-
### Building documentation:
47+
## Pip
48+
49+
The `dpnp` can be installed using `pip` obtaining wheel packages either from
50+
PyPi or from Intel(R) channel. To install `dpnp` wheel package from Intel(R)
51+
channel, run the following command:
52+
7853
```bash
79-
Prerequisites:
80-
$ conda install sphinx sphinx_rtd_theme
81-
Building:
82-
1. Install dpnp into your python environment
83-
2. $ cd doc && make html
84-
3. The documentation will be in doc/_build/html
54+
python -m pip install --index-url https://software.repos.intel.com/python/pypi dpnp
8555
```
8656

87-
## Packaging:
57+
## Installing the bleeding edge
58+
59+
To try out the latest features, install `dpnp` using our development channel on
60+
Anaconda cloud:
61+
8862
```bash
89-
. ./0.env.sh
90-
conda-build conda-recipe/
63+
conda install dpnp -c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge
9164
```
9265

93-
## Run benchmark:
94-
```bash
95-
cd benchmarks/
9666

97-
asv run --python=python --bench <filename without .py>
98-
# example:
99-
asv run --python=python --bench bench_elementwise
67+
# Building
10068

101-
# or
69+
Refer to our [Documentation](https://intelpython.github.io/dpnp/quick_start_guide.html)
70+
for more information on setting up a development environment and building `dpnp`
71+
from the source.
10272

103-
asv run --python=python --bench <class>.<bench>
104-
# example:
105-
asv run --python=python --bench Elementwise.time_square
10673

107-
# 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)
108-
```
74+
# Running Tests
10975

76+
Tests are located in folder [dpnp/tests](dpnp/tests).
11077

111-
## Tests matrix:
112-
| # |Name |OS |distributive|interpreter|python used from|SYCL queue manager|build commands set |forced environment |
113-
|---|------------------------------------|-----|------------|-----------|:--------------:|:----------------:|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
114-
|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 |
115-
|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 |
116-
|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 |
117-
|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 |
118-
|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 |
119-
|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 |
120-
|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 |
121-
|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 |
122-
|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|
78+
To run the tests, use:
79+
```bash
80+
python -m pytest --pyargs dpnp
81+
```

doc/reference/misc.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Utility
1010
:toctree: generated/
1111
:nosignatures:
1212

13+
dpnp.broadcast_shapes
14+
dpnp.byte_bounds
1315
dpnp.get_include
1416
dpnp.show_config
1517
dpnp.show_runtime
16-
dpnp.broadcast_shapes

dpnp/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@
5454
from dpnp.dpnp_iface_types import *
5555
from dpnp.dpnp_iface import *
5656
from dpnp.dpnp_iface import __all__ as _iface__all__
57+
from dpnp.dpnp_iface_utils import *
58+
from dpnp.dpnp_iface_utils import __all__ as _ifaceutils__all__
5759
from dpnp._version import get_versions
5860

5961
__all__ = _iface__all__
62+
__all__ += _ifaceutils__all__
63+
6064

6165
__version__ = get_versions()["version"]
6266
del get_versions

0 commit comments

Comments
 (0)