Skip to content

Commit

Permalink
Merge pull request #1457 from IntelPython/main
Browse files Browse the repository at this point in the history
Merge 0.23 into gold/2021
  • Loading branch information
Diptorup Deb authored May 28, 2024
2 parents fc1b1df + 46e90f6 commit 715371d
Show file tree
Hide file tree
Showing 32 changed files with 261 additions and 973 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-2019]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# Ignoring test due to opencl driver optimization bug
- name: Run tests with coverage
run: |
pytest -q --cov --cov-report xml --pyargs numba_dpex \
pytest -q --cov=./ --cov-report xml --pyargs numba_dpex \
-k 'not test_1d_strided_dpnp_array_in_kernel[2]'
- name: Coveralls
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cpp_style_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.11.0
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '14'
check-path: 'numba_dpex/dpctl_iface'
4 changes: 2 additions & 2 deletions .github/workflows/openssf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
Expand Down Expand Up @@ -71,6 +71,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
if: ${{ github.event_name == 'push' }}
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
sarif_file: results.sarif
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ _skbuild

docs/source/developer/autogen*

# Ignore versioneer generated files
numba_dpex/_version.py

# Ignore generated cpp files
numba_dpex/dpnp_iface/*.cpp
numba_dpex/dpnp_iface/*.h
Expand Down
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.23.0] - 2024-04-XX
## [0.23.0] - 2024-05-28

### Fixed
* Array alignment problem for stack arrays allocated for kernel arguments. (#1357)
* Issue #892, #906 caused by incorrect code generation for indexing (#1377)
* Fix `KernelHasReturnValueError` inside `KernelDispatcher`. (#1394)
* Generation of `KernelHasReturnValueError` error inside `KernelDispatcher`. (#1394)
* Issue #1390: broken support for slicing into `dpctl.tensor.usm_ndarray` in kernels (#1425)
* Support for Wheels package on Windows (#1430)
* Incorrect mangled name for kernel function arguments (#1443)
* Remove artifacts from conda/wheel packages residing in root level (#1450)
* GDB tests to work properly on Intel Max GPU (#1451)
* Improper wheels installation on unsupported platforms (#1452)
* Ref-counting of Python object temporaries in unboxing code (#1454)
* Segfault caused by using `malloc` to allocate `NRT_MemInfo`. Replaced with Numba's NRT `alloc` (#1458)
* Incorrect package name in README.md (#1463)

### Added
* A new overloaded `dimensions` attribute for all index-space id classes (#1359)
Expand All @@ -24,18 +32,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* A `sycl::local_accessor`-like API (`kernel_api.LocalAccessor`) for numba-dpex kernel (#1331)
* Specialization support for `device_func` decorator (#1398)
* Support for all `kernel_api` functions inside the `numba_dpex.kernel` decorator. (#1400)
* Support for dpnp 0.15 (#1434, #1464)
* Improvements to pyproject.toml configs to build numba-dpex from source. (#1449)
* Load the `SPV_INTEL_variable_length_array` SPIR-V extension to supporting arrays in private address-space on Intel Max GPU. (#1451)

### Changed
* Default inline threshold value set to `2` from `None`. (#1385)
* Port parfor kernel templates to `kernel_api` (#1416), (#1424)
* Use `SPIRVKernelDispatcher` for parfor kernel dispatch (#1435, #1448)
* All examples use the latest dpctl API (#1431)
* Minimum required dpctl version is now 0.16.1
* Minimum required numba version is now 0.59.0
* Minimum required numba version is now 0.59.0 (#1462)

### Removed
* OpenCL-like kernel API functions (#1420)
* `func` decorator (replaced by `device_func`) (#1400)
* `numba_dpex.experimental.kernel` and `numba_dpex.experimental.device_func` (#1400)


## [0.22.0] - 2024-02-19

### Fixed
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@



Data-parallel Extension for Numba* (numba-dpex) is an open-source standalone
Data Parallel Extension for Numba* (numba-dpex) is an open-source standalone
extension for the [Numba](http://numba.pydata.org) Python JIT compiler.
Numba-dpex provides a [SYCL*](https://sycl.tech/)-like API for kernel
programming Python. SYCL* is an open standard developed by the [Unified
Expand Down
8 changes: 7 additions & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ for /f %%f in ('dir /b /S .\dist') do (

:: wheel file was renamed
for /f %%f in ('dir /b /S .\dist') do (
%PYTHON% -m pip install %%f
%PYTHON% -m pip install %%f ^
--no-build-isolation ^
--no-deps ^
--only-binary :all: ^
--no-index ^
--prefix %PREFIX% ^
-vv
if %ERRORLEVEL% neq 0 exit 1
)

Expand Down
14 changes: 12 additions & 2 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot
ICPXCFG="$(pwd)/icpx_for_conda.cfg"
ICXCFG="$(pwd)/icpx_for_conda.cfg"

read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"

export ICXCFG
export ICPXCFG

Expand All @@ -26,8 +29,15 @@ export PATH=$CONDA_PREFIX/bin-llvm:$PATH
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
${PYTHON} -m build -w -n -x
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
--platform-tag manylinux2014_x86_64 dist/numba_dpex*.whl
${PYTHON} -m pip install dist/numba_dpex*.whl
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
dist/numba_dpex*.whl
${PYTHON} -m pip install dist/numba_dpex*.whl \
--no-build-isolation \
--no-deps \
--only-binary :all: \
--no-index \
--prefix "${PREFIX}" \
-vv

# Copy wheel package
if [[ -v WHEELS_OUTPUT_FOLDER ]]; then
Expand Down
48 changes: 26 additions & 22 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{% set excluded_compiler_version2 = "2024.0.2" %}
{% set excluded_compiler_version3 = "2024.0.3" %}

{% set pyproject = load_file_data('pyproject.toml') %}
{% set py_build_deps = pyproject.get('build-system', {}).get('requires', []) %}

package:
name: numba-dpex
version: {{ GIT_DESCRIBE_TAG }}
Expand All @@ -21,38 +24,39 @@ requirements:
- {{ compiler('cxx') }}
- {{ compiler('dpcpp') }} >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }},!={{ excluded_compiler_version3 }} # [win]
- {{ compiler('dpcpp') }} >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [linux]
# specific version of sysroot required by dpcpp, but 2024.0.0 package
# does not have it in meta data
- sysroot_linux-64 >=2.28 # [linux]
# Minimal supported version of sysroot (which is version of glibc) to
# have compatibility with wider range of linux distributions.
# 2.28 is the minimal supported version by dpcpp
- sysroot_linux-64 =2.28 # [linux]
host:
- python
- pip >=24.0
- dpcpp-cpp-rt >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }},!={{ excluded_compiler_version3 }} # [win]
- dpcpp-cpp-rt >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [linux]
- python
# ensure we are using latest version of setuptools, since we don't need
# editable environments for release.
- setuptools >=69
- scikit-build >=0.17
- ninja >=1.11.1 # [not win]
- cmake >=3.29
- numba >=0.59
- llvmlite >=0.42.0
- dpctl >=0.16.1
- dpnp >=0.14
- numpy >=1.24
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- dpcpp-llvm-spirv >={{ required_compiler_version }} # [not win]
- dpcpp-llvm-spirv >={{ required_compiler_version }},<2024.1 # [win]
- wheel >=0.43
- pip >=24.0
- python-build >=1.1
- versioneer==0.29
{% for dep in py_build_deps %}
{% if dep.startswith('ninja') %}
- {{ dep.split(';')[0] }} # [not win]
{% elif dep.startswith('cmake') %}
- {{ dep }}
{% elif dep.startswith('build>=') %}
- {{ 'python-' ~ dep }}
{% else %}
- {{ dep|replace('_','-') }}
{% endif %}
{% endfor %}
# versioneer dependency
- tomli # [py<311]
# While we don't need it for build, but install it here, so we can
# pin_compatible at run section.
- dpcpp-llvm-spirv >={{ required_compiler_version }}
run:
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
# TODO: pick up min version from dep
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }}
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }} # [not win]
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x', upper_bound='2024.1') }} # [win]
- {{ pin_compatible('dpnp', min_pin='x.x.x', max_pin='x.x') }}
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin='x.x') }}
- {{ pin_compatible('numba', min_pin='x.x.x', max_pin='x.x') }}
Expand Down
4 changes: 2 additions & 2 deletions numba_dpex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from numba import __version__ as numba_version

from .kernel_api_impl.spirv import target as spirv_kernel_target
from .numba_patches import patch_is_ufunc
from .numba_patches import patch_ufuncs
from .register_kernel_api_overloads import init_kernel_api_spirv_overloads


Expand Down Expand Up @@ -70,7 +70,7 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:
dpctl_sem_version = parse_sem_version(dpctl.__version__)

# Monkey patches
patch_is_ufunc.patch()
patch_ufuncs.patch()

from numba import prange # noqa E402

Expand Down
Loading

0 comments on commit 715371d

Please sign in to comment.