Skip to content

Commit c37e360

Browse files
author
Diptorup Deb
authored
Merge pull request #1077 from IntelPython/release0.21
Release0.21
2 parents efff029 + a33c03f commit c37e360

File tree

13 files changed

+107
-26
lines changed

13 files changed

+107
-26
lines changed

.github/actions/setup-numba-dpex/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ runs:
1616
run: conda env update -n base -f ${{ inputs.environment }} --prune
1717
shell: bash
1818

19+
- name: Test conda environment
20+
run: conda list
21+
shell: bash
22+
1923
- name: Build numba-dpex
2024
run: |
2125
export PATH=$CONDA/bin-llvm:$PATH

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,40 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.21.0] - 2023-06-17
8+
9+
### Added
10+
* Support addition and multiplication-based prange reduction loops (#999)
11+
* Proper boxing, unboxing of dpctl.SyclQueue objects inside dpjit decorated functions (#963, #1064)
12+
* Support for `queue` keyword arguments inside dpnp array constructors in dpjit (#1032)
13+
* Overloads for dpnp array constructors: dpnp.full (#991), dpnp.full_like (#997)
14+
* Support for complex64 and complex128 types as kernel arguments and in parfors (#1033, #1035)
15+
* New config to run the ConstantSizeStaticLocalMemoryPass optionally (#999)
16+
* Support for Numba 0.57 (#1030, #1003, #1002)
17+
* Support for Python 3.11 (#1054)
18+
* Support for SPIRV 1.4 (#1056, #1060)
19+
20+
### Changed
21+
* Parfor lowering happens using the kernel pipeline (#996)
22+
* Minimum required Numba version is now 0.57 (#1030)
23+
* Numba monkey patches are moved to numba_dpex.numba_patches (#1030)
24+
* Redesigned unit test suite (#1018, #1017, #1015, #1036, #1037, #1072)
25+
26+
### Fixed
27+
* Fix stride computation when unboxing a dpnp array (#1023)
28+
* Using cached queue instead of creating new one on type inference (#946)
29+
* Fixed bug in reduction mul operation for dpjit (#1048)
30+
* Offload of parfor nodes to OpenCL UHD GPU devices (#1074)
31+
32+
### Removed
33+
* Support for offloading NumPy-based parfor nodes to SYCL devices (#1041)
34+
* Removed rename_numpy_functions_pass (#1041)
35+
* Dpnp overloads using stubs (#1041, #1025)
36+
* Support for `like` keyword argument in dpnp array constructor overloads (#1043)
37+
* Support for NumPy arrays as kernel arguments (#1049)
38+
* Kernel argument access specifiers (#1049)
39+
* Support for dpctl.device_context to launch kernels and njit offloading (#1041)
40+
741
## [0.20.1] - 2023-04-07
842

943
### Added

conda-recipe/run_test.bat

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
pytest -q -ra --disable-warnings --pyargs numba_dpex -vv
2-
IF %ERRORLEVEL% NEQ 0 exit /B 1
1+
set "ONEAPI_DEVICE_SELECTOR="
2+
3+
for /F "USEBACKQ tokens=* delims=" %%F in (
4+
`python -c "import dpctl; print(\"\n\".join([dev.backend.name+\":\"+dev.device_type.name for dev in dpctl.get_devices() if dev.device_type.name in [\"cpu\",\"gpu\"]]))"`
5+
) do (
6+
set "ONEAPI_DEVICE_SELECTOR=%%F"
7+
8+
pytest -q -ra --disable-warnings --pyargs numba_dpex -vv
9+
IF %ERRORLEVEL% NEQ 0 exit /B 1
10+
)
311

412
exit /B 0

conda-recipe/run_test.sh

100644100755
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#!/bin/bash
22

33
set -euxo pipefail
4+
unset ONEAPI_DEVICE_SELECTOR
45

5-
pytest -q -ra --disable-warnings --pyargs numba_dpex -vv
6+
for selector in $(python -c "import dpctl; print(\" \".join([dev.backend.name+\":\"+dev.device_type.name for dev in dpctl.get_devices() if dev.device_type.name in [\"cpu\",\"gpu\"]]))")
7+
do
8+
export "ONEAPI_DEVICE_SELECTOR=$selector"
9+
unset NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
610

7-
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
11+
pytest -q -ra --disable-warnings --pyargs numba_dpex -vv
812

9-
pytest -q -ra --disable-warnings -vv \
10-
--pyargs numba_dpex.tests.kernel_tests.test_atomic_op::test_atomic_fp_native
13+
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
14+
15+
pytest -q -ra --disable-warnings -vv \
16+
--pyargs numba_dpex.tests.kernel_tests.test_atomic_op::test_atomic_fp_native
17+
done
1118

1219
exit 0

docs/user_guides/debugging/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ work.
2525
`Intel® Distribution for GDB*` is part of `Intel oneAPI`. For relevant
2626
documentation, refer to the `Intel® Distribution for GDB* product page`_.
2727

28-
.. _`Intel® Distribution for GDB* product page`: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/distribution-for-gdb.html
28+
.. _`Intel® Distribution for GDB* product page`: https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-gdb.html
2929

3030
.. toctree::
3131
:maxdepth: 2

docs/user_guides/debugging/set_up_machine.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install drivers using the following guides:
1111

1212
.. _Intel® GPGPU driver installation guide: https://dgpu-docs.intel.com/installation-guides/index.html
1313
.. _Intel® oneAPI GPU driver installation guide:
14-
https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/prerequisites/install-intel-gpu-drivers.html
14+
https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/current/install-intel-gpu-drivers.html
1515

1616
The user should be in the "video" group (on Ubuntu* 18, Fedora* 30, and SLES* 15
1717
SP1) or "render" group (on Ubuntu* 19 and higher, CentOS* 8, and Fedora* 31). An
@@ -93,5 +93,5 @@ If you are installing DCD for the first time, create keys. For details, see the
9393

9494
See also:
9595

96-
- `Get Started with Intel® Distribution for GDB* on Linux* OS Host <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-debugging-dpcpp-linux/top.html>`_
97-
- `Public signature key <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-debugging-dpcpp-linux/top.html#:~:text=sudo%20modprobe%20igfxdcd-,The%20host%20system%20does%20not%20recognize%20the%20igfxdcd%20signature%20if,gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB,-If%20you%20have>`_
96+
- `Get Started with Intel® Distribution for GDB* on Linux* OS Host <https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html>`_
97+
- `Public signature key <https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html#:~:text=sudo%20modprobe%20igfxdcd-,The%20host%20system%20does%20not%20recognize%20the%20igfxdcd%20signature%20if,gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB,-If%20you%20have>`_

docs/user_guides/debugging/stepping.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,4 @@ a single line without interference, set the scheduler-locking setting to `on` or
7272

7373
See also:
7474

75-
- `Single Stepping <https://software.intel.com/content/www/us/en/develop/documentation/debugging-dpcpp-linux/top/debug-a-dpc-application-on-a-cpu/single-stepping.html>`_
7675
- `Continuing and Stepping in GDB* <https://sourceware.org/gdb/current/onlinedocs/gdb/Continuing-and-Stepping.html#Continuing-and-Stepping>`_

docs/user_guides/getting_started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,6 @@ Refer to :ref:`Docker <docker>` section for more options.
154154
.. _`packaging`: https://packaging.pypa.io/
155155
.. _`scipy`: https://anaconda.org/intel/scipy
156156
.. _`pytest`: https://docs.pytest.org
157-
.. _`Intel Distribution for Python`: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/distribution-for-python.html
157+
.. _`Intel Distribution for Python`: https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html
158158
.. _`anaconda.org/intel`: https://anaconda.org/intel
159-
.. _`Intel oneAPI`: https://software.intel.com/content/www/us/en/develop/tools/oneapi.html
159+
.. _`Intel oneAPI`: https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html

environment/docs.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: dev
1+
name: dpex-docs-dev
22
channels:
3-
- defaults
43
- dppy/label/dev
54
- numba
65
- intel
7-
- numba/label/dev
6+
- conda-forge
87
- nodefaults
98
dependencies:
10-
- python=3.9
9+
- python=3.10
1110
- gxx_linux-64
1211
- dpcpp_linux-64
1312
- numba 0.57*
1413
- dpctl 0.14*
15-
- dpnp >=0.10.2
14+
- dpnp >=0.12*
1615
- spirv-tools
1716
- dpcpp-llvm-spirv
1817
- packaging
@@ -23,15 +22,10 @@ dependencies:
2322
- pre-commit
2423
- flake8
2524
- black==20.8b1
26-
- pytest-cov
27-
- pytest-xdist
2825
- pexpect
2926
- sphinx
3027
- autodoc
3128
- recommonmark
3229
- sphinx-rtd-theme
3330
- sphinxcontrib-apidoc
3431
- sphinxcontrib-googleanalytics
35-
variables:
36-
CHANNELS: -c defaults -c numba -c intel -c numba/label/dev -c dppy/label/dev --override-channels
37-
CHANNELS_DEV: -c dppy/label/dev -c defaults -c numba -c intel -c numba/label/dev --override-channels

numba_dpex/core/parfors/kernel_builder.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from numba_dpex import config
2929

3030
from ..descriptor import dpex_kernel_target
31-
from ..types.dpnp_ndarray_type import DpnpNdArray
31+
from ..types import DpnpNdArray, USMNdArray
3232
from ..utils.kernel_templates import RangeKernelTemplate
3333

3434

@@ -70,6 +70,30 @@ def _compile_kernel_parfor(
7070
func_ir, kernel_name
7171
)
7272

73+
# A cast from DpnpNdArray type to USMNdArray is needed for all arguments of
74+
# DpnpNdArray type. Although, DpnpNdArray derives from USMNdArray the two
75+
# types use different data models. USMNdArray uses the
76+
# numba_dpex.core.datamodel.models.ArrayModel data model that defines all
77+
# CPointer type members in the GLOBAL address space. The DpnpNdArray uses
78+
# Numba's default ArrayModel that does not define pointers in any specific
79+
# address space. For OpenCL HD Graphics devices, defining a kernel function
80+
# (spir_kernel calling convention) with pointer arguments that have no
81+
# address space qualifier causes a run time crash. By casting the argument
82+
# type for parfor arguments from DpnpNdArray type to the USMNdArray type the
83+
# generated kernel always has an address space qualifier, avoiding the issue
84+
# on OpenCL HD graphics devices.
85+
86+
for i, argty in enumerate(argtypes):
87+
if isinstance(argty, DpnpNdArray):
88+
new_argty = USMNdArray(
89+
ndim=argty.ndim,
90+
layout=argty.layout,
91+
dtype=argty.dtype,
92+
usm_type=argty.usm_type,
93+
queue=argty.queue,
94+
)
95+
argtypes[i] = new_argty
96+
7397
# compile the kernel
7498
kernel.compile(
7599
args=argtypes,

numba_dpex/core/types/dpnp_ndarray_type.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
5858
else:
5959
return
6060

61+
def __str__(self):
62+
return self.name.replace("USMNdArray", "DpnpNdarray")
63+
64+
def __repr__(self):
65+
return self.__str__()
66+
6167
def __allocate__(
6268
self,
6369
typingctx,

numba_dpex/core/types/usm_ndarray_type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
self.dtype = dtype
8888

8989
if name is None:
90-
type_name = "usm_ndarray"
90+
type_name = "USMNdArray"
9191
if readonly:
9292
type_name = "readonly " + type_name
9393
if not aligned:
@@ -116,6 +116,9 @@ def __init__(
116116
aligned=aligned,
117117
)
118118

119+
def __repr__(self):
120+
return self.name
121+
119122
def copy(
120123
self,
121124
dtype=None,

numba_dpex/tests/core/passes/test_parfor_legalize_cfd_pass.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from numba_dpex import dpjit
1616
from numba_dpex.core.exceptions import ExecutionQueueInferenceError
17-
from numba_dpex.tests._helper import skip_no_opencl_gpu
17+
from numba_dpex.tests._helper import skip_no_opencl_cpu, skip_no_opencl_gpu
1818

1919
shapes = [10, (2, 5)]
2020
dtypes = [dpnp.int32, dpnp.int64, dpnp.float32, dpnp.float64]
@@ -58,6 +58,7 @@ def test_parfor_legalize_cfd_pass(shape, dtype, usm_type, device):
5858

5959

6060
@skip_no_opencl_gpu
61+
@skip_no_opencl_cpu
6162
def test_parfor_legalize_cfd_pass_raise():
6263
a = dpnp.zeros(shape=10, device="cpu")
6364
b = dpnp.ones(shape=10, device="gpu")
@@ -67,6 +68,7 @@ def test_parfor_legalize_cfd_pass_raise():
6768

6869

6970
@skip_no_opencl_gpu
71+
@skip_no_opencl_cpu
7072
def test_cfd_error_due_to_lhs():
7173
a = dpnp.zeros(shape=10, device="cpu")
7274
b = dpnp.ones(shape=10, device="cpu")

0 commit comments

Comments
 (0)