Skip to content

Commit 13cb406

Browse files
authored
Merge 632abce into cc58db0
2 parents cc58db0 + 632abce commit 13cb406

File tree

7 files changed

+79
-96
lines changed

7 files changed

+79
-96
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ jobs:
104104
- name: Setup miniconda
105105
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
106106
with:
107-
miniforge-variant: Mambaforge
108107
miniforge-version: latest
109108
use-mamba: true
110109
channels: conda-forge

.github/workflows/conda-package.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ jobs:
103103
- name: Setup miniconda
104104
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
105105
with:
106-
miniforge-variant: Mambaforge
107106
miniforge-version: latest
108107
use-mamba: true
109108
channels: conda-forge
@@ -197,7 +196,6 @@ jobs:
197196
- name: Setup miniconda
198197
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
199198
with:
200-
miniforge-variant: Mambaforge
201199
miniforge-version: latest
202200
use-mamba: true
203201
channels: conda-forge
@@ -327,7 +325,6 @@ jobs:
327325
- name: Setup miniconda
328326
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
329327
with:
330-
miniforge-variant: Mambaforge
331328
miniforge-version: latest
332329
use-mamba: true
333330
channels: conda-forge
@@ -469,7 +466,6 @@ jobs:
469466
- name: Setup miniconda
470467
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
471468
with:
472-
miniforge-variant: Mambaforge
473469
miniforge-version: latest
474470
use-mamba: true
475471
channels: conda-forge
@@ -505,7 +501,6 @@ jobs:
505501
steps:
506502
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
507503
with:
508-
miniforge-variant: Mambaforge
509504
miniforge-version: latest
510505
use-mamba: true
511506
channels: conda-forge

.github/workflows/generate_coverage.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
- name: Setup miniconda
6363
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
6464
with:
65-
miniforge-variant: Mambaforge
6665
miniforge-version: latest
6766
use-mamba: true
6867
channels: conda-forge

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.16.1] - 12/XX/2024
8+
9+
This is a bug-fix release.
10+
11+
### Changed
12+
13+
* Changed to use `Miniforge` installer in GutHub actions [#2057](https://github.com/IntelPython/dpnp/pull/2057)
14+
* Updated `README.md` to reflect current installation requirements and available options [#2166](https://github.com/IntelPython/dpnp/pull/2166)
15+
16+
### Fixed
17+
18+
* Resolved a compilation error when building with DPC++ 2025.1 compiler [#2211](https://github.com/IntelPython/dpnp/pull/2211)
19+
20+
721
## [0.16.0] - 10/14/2024
822

923
This release reaches an important milestone by making offloading fully asynchronous. Calls to `dpnp` submit tasks for execution to DPC++ runtime and return without waiting for execution of these tasks to finish. The sequential semantics a user comes to expect from execution of Python script is preserved though.

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+
```

dpnp/backend/kernels/dpnp_krnl_common.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,23 @@
3333
#include "queue_sycl.hpp"
3434
#include <dpnp_iface.hpp>
3535

36+
/**
37+
* Version of SYCL DPC++ 2025.1 compiler where support of
38+
* sycl::ext::oneapi::experimental::properties was added.
39+
*/
40+
#ifndef __SYCL_COMPILER_REDUCTION_PROPERTIES_SUPPORT
41+
#define __SYCL_COMPILER_REDUCTION_PROPERTIES_SUPPORT 20241129
42+
#endif
43+
3644
namespace mkl_blas = oneapi::mkl::blas;
3745
namespace mkl_blas_cm = oneapi::mkl::blas::column_major;
3846
namespace mkl_blas_rm = oneapi::mkl::blas::row_major;
3947
namespace mkl_lapack = oneapi::mkl::lapack;
4048

49+
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_REDUCTION_PROPERTIES_SUPPORT
50+
namespace syclex = sycl::ext::oneapi::experimental;
51+
#endif
52+
4153
template <typename _KernelNameSpecialization1,
4254
typename _KernelNameSpecialization2,
4355
typename _KernelNameSpecialization3>
@@ -76,8 +88,13 @@ sycl::event dot(sycl::queue &queue,
7688
cgh.parallel_for(
7789
sycl::range<1>{size},
7890
sycl::reduction(
79-
result_out, std::plus<_DataType_output>(),
80-
sycl::property::reduction::initialize_to_identity{}),
91+
result_out, sycl::plus<_DataType_output>(),
92+
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_REDUCTION_PROPERTIES_SUPPORT
93+
syclex::properties(syclex::initialize_to_identity)
94+
#else
95+
sycl::property::reduction::initialize_to_identity {}
96+
#endif
97+
),
8198
[=](sycl::id<1> idx, auto &sum) {
8299
sum += static_cast<_DataType_output>(
83100
input1_in[idx * input1_strides]) *

tests/third_party/cupy/creation_tests/test_ranges.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_linspace_float_overflow(self, xp):
172172
dtype = cupy.default_float_type()
173173
return xp.linspace(0.0, xp.finfo(dtype).max / 5, 10, dtype=dtype)
174174

175-
@testing.numpy_cupy_allclose()
175+
@testing.numpy_cupy_allclose(rtol={numpy.float32: 1e-6, "default": 1e-7})
176176
def test_linspace_float_underflow(self, xp):
177177
# find minimum subnormal number
178178
dtype = cupy.default_float_type()

0 commit comments

Comments
 (0)