Skip to content

Commit 7b04098

Browse files
committed
Merge branch 'master' into feature/enable-amd-builds
2 parents 8ebb04e + 9403f76 commit 7b04098

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1198
-2624
lines changed

.github/workflows/array-api-skips.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,17 @@ array_api_tests/test_has_names.py::test_has_names[linalg-trace]
2525
array_api_tests/test_has_names.py::test_has_names[linalg-vecdot]
2626
array_api_tests/test_has_names.py::test_has_names[linalg-vector_norm]
2727
array_api_tests/test_has_names.py::test_has_names[linalg-pinv]
28+
array_api_tests/test_has_names.py::test_has_names[fft-fft]
29+
array_api_tests/test_has_names.py::test_has_names[fft-fftn]
30+
array_api_tests/test_has_names.py::test_has_names[fft-rfft]
31+
array_api_tests/test_has_names.py::test_has_names[fft-rfftn]
32+
array_api_tests/test_has_names.py::test_has_names[fft-hfft]
33+
array_api_tests/test_has_names.py::test_has_names[fft-ifft]
34+
array_api_tests/test_has_names.py::test_has_names[fft-ifftn]
35+
array_api_tests/test_has_names.py::test_has_names[fft-irfft]
36+
array_api_tests/test_has_names.py::test_has_names[fft-irfftn]
37+
array_api_tests/test_has_names.py::test_has_names[fft-ihfft]
38+
array_api_tests/test_has_names.py::test_has_names[fft-fftshift]
39+
array_api_tests/test_has_names.py::test_has_names[fft-ifftshift]
40+
array_api_tests/test_has_names.py::test_has_names[fft-fftfreq]
41+
array_api_tests/test_has_names.py::test_has_names[fft-rfftfreq]

.github/workflows/conda-package.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818

1919
jobs:
2020
build_linux:
21-
runs-on: ubuntu-20.04
21+
runs-on: ubuntu-22.04
2222

2323
strategy:
2424
matrix:
@@ -109,7 +109,7 @@ jobs:
109109
- name: Build conda package
110110
env:
111111
OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides
112-
run: conda build --no-test --python ${{ matrix.python }} -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
112+
run: conda build --no-test --python ${{ matrix.python }} -c dppy/label/bootstrap -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
113113
- name: Upload artifact
114114
uses: actions/upload-artifact@v4.3.4
115115
with:
@@ -129,7 +129,7 @@ jobs:
129129
matrix:
130130
python: ['3.9', '3.10', '3.11']
131131
experimental: [false]
132-
runner: [ubuntu-20.04]
132+
runner: [ubuntu-22.04]
133133
continue-on-error: ${{ matrix.experimental }}
134134

135135
steps:
@@ -347,7 +347,7 @@ jobs:
347347
upload_linux:
348348
needs: test_linux
349349
if: ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
350-
runs-on: ubuntu-20.04
350+
runs-on: ubuntu-22.04
351351
strategy:
352352
matrix:
353353
python: ['3.9', '3.10', '3.11']
@@ -428,7 +428,7 @@ jobs:
428428
matrix:
429429
python: ['3.10']
430430
experimental: [false]
431-
runner: [ubuntu-20.04]
431+
runner: [ubuntu-22.04]
432432
continue-on-error: ${{ matrix.experimental }}
433433
env:
434434
EXAMPLES_ENV_NAME: examples
@@ -486,7 +486,7 @@ jobs:
486486
- name: Install example requirements
487487
shell: bash -l {0}
488488
env:
489-
DPCPP_CMPLR: dpcpp_linux-64">=2024.1"
489+
DPCPP_CMPLR: dpcpp_linux-64">=2024.2"
490490
run: |
491491
CHANNELS="${{ env.CHANNELS }}"
492492
. $CONDA/etc/profile.d/conda.sh
@@ -584,7 +584,7 @@ jobs:
584584
matrix:
585585
python: ['3.10']
586586
experimental: [false]
587-
runner: [ubuntu-20.04]
587+
runner: [ubuntu-22.04]
588588
continue-on-error: ${{ matrix.experimental }}
589589
steps:
590590
- name: Construct channels line

.github/workflows/generate-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install dpctl dependencies
9393
shell: bash -l {0}
9494
run: |
95-
pip install numpy"<1.26.0" cython setuptools pytest pytest-cov scikit-build cmake coverage[toml]
95+
pip install numpy"<1.26.0" cython setuptools pytest pytest-cov scikit-build cmake coverage[toml] versioneer[toml]==0.29
9696
9797
- name: Build dpctl with coverage
9898
shell: bash -l {0}

.github/workflows/generate-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jobs:
5656
run: |
5757
pip install numpy cython setuptools scikit-build cmake sphinx"<7.2" pydot graphviz furo \
5858
sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx-design \
59-
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling
59+
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling \
60+
versioneer[toml]==0.29
6061
- name: Checkout repo
6162
uses: actions/checkout@v4.1.7
6263
with:

.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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
71+
uses: github/codeql-action/upload-sarif@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
7272
with:
7373
sarif_file: results.sarif

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- name: Install dpctl dependencies
111111
shell: bash -l {0}
112112
run: |
113-
pip install numpy"<1.26.0" cython setuptools pytest scikit-build cmake ninja
113+
pip install numpy"<1.26.0" cython setuptools pytest scikit-build cmake ninja versioneer[toml]==0.29
114114
115115
- name: Checkout repo
116116
uses: actions/checkout@v4.1.7
@@ -164,4 +164,6 @@ jobs:
164164
SYCL_CACHE_PERSISTENT: 1
165165
run: |
166166
source set_allvars.sh
167-
python -m pytest -v dpctl/tests
167+
# Skip the test that checks if there is only one hard
168+
# copy of DPCTLSyclInterface library
169+
python -m pytest -v dpctl/tests --no-sycl-interface-test

.pre-commit-config.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/PyCQA/bandit
5-
rev: '1.7.4'
5+
rev: '1.7.9'
66
hooks:
77
- id: bandit
88
pass_filenames: false
99
args: ["-r", "dpctl", "-lll"]
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.3.0
11+
rev: v4.6.0
1212
hooks:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace
1515
- repo: https://github.com/psf/black
16-
rev: 22.12.0
16+
rev: 24.4.2
1717
hooks:
1818
- id: black
1919
exclude: "versioneer.py|dpctl/_version.py"
2020
- repo: https://github.com/pycqa/isort
21-
rev: 5.12.0
21+
rev: 5.13.2
2222
hooks:
2323
- id: isort
2424
name: isort (python)
@@ -29,11 +29,16 @@ repos:
2929
name: isort (pyi)
3030
types: [pyi]
3131
- repo: https://github.com/pycqa/flake8
32-
rev: 5.0.4
32+
rev: 7.1.0
3333
hooks:
3434
- id: flake8
3535
- repo: https://github.com/pocc/pre-commit-hooks
3636
rev: v1.3.5
3737
hooks:
3838
- id: clang-format
3939
args: ["-i"]
40+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
41+
rev: v2.12.0
42+
hooks:
43+
- id: pretty-format-toml
44+
args: [--autofix]

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Fixed
1414

15-
## [0.17.0] - May. XX, 2024
15+
## [0.17.0] - May. 23, 2024
1616

1717
This release features updated documentation web-page https://intelpython.github.io/dpctl/latest/index.html, adds cumulative reductions,
1818
and complies with revision [2023.12](https://data-apis.org/array-api/2023.12/) of Python Array API specification.
@@ -45,6 +45,7 @@ and complies with revision [2023.12](https://data-apis.org/array-api/2023.12/) o
4545
* Fixed bug in basic slicing of empty arrays: [gh-1680](https://github.com/IntelPython/dpctl/pull/1680)
4646
* Fixed bug in `tensor.bitwise_invert` for boolean input array: [gh-1681](https://github.com/IntelPython/dpctl/pull/1681)
4747
* Fixed bug in `tensor.repeat` on zero-size input arrays: [gh-1682](https://github.com/IntelPython/dpctl/pull/1682)
48+
* Fixed bug in `tensor.searchsorted` for 0d needle vector and strided hay: [gh-1694](https://github.com/IntelPython/dpctl/pull/1694)
4849

4950

5051
## [0.16.1] - Apr. 10, 2024

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ include(FetchContent)
108108

109109
FetchContent_Declare(
110110
pybind11
111-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.12.0.tar.gz
112-
URL_HASH SHA256=bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7
111+
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.1.tar.gz
112+
URL_HASH SHA256=51631e88960a8856f9c497027f55c9f2f9115cafb08c0005439838a05ba17bfc
113+
FIND_PACKAGE_ARGS NAMES pybind11
113114
)
114115
FetchContent_MakeAvailable(pybind11)
115116

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ guide](https://www.intel.com/content/www/us/en/developer/articles/guide/installa
6464

6565
## Conda
6666

67-
To install `dpctl` from the Intel(R) channel on Anaconda
68-
cloud, use the following command:
67+
To install `dpctl` from the Intel(R) conda channel, use the following command:
6968

7069
```bash
71-
conda install dpctl -c intel
70+
conda install dpctl -c https://software.repos.intel.com/python/conda/ -c conda-forge
7271
```
7372

7473
## Pip
@@ -87,7 +86,7 @@ To try out the latest features, install `dpctl` from our
8786
development channel on Anaconda cloud:
8887

8988
```bash
90-
conda install dpctl -c dppy/label/dev
89+
conda install dpctl -c dppy/label/dev -c conda-forge
9190
```
9291

9392
# Building
@@ -117,7 +116,8 @@ To run the tests, use:
117116
pytest --pyargs dpctl
118117
```
119118

120-
Running full test suite requires working C/C++ compiler. To run the test suite without one, use:
119+
Running full test suite requires working C/C++ compiler and installed Cython package.
120+
To run the test suite without these, use:
121121

122122
```bash
123123
pytest --pyargs dpctl -k "not test_cython_api and not test_c_headers"

conda-recipe/bld.bat

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
44
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
55

66
"%PYTHON%" setup.py clean --all
7-
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
87

98
REM Overriding IPO is useful for building in resources constrained VMs (public CI)
109
if DEFINED OVERRIDE_INTEL_IPO (
11-
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
10+
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
1211
)
1312

1413
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
@@ -32,20 +31,39 @@ if EXIST "%PLATFORM_DIR%" (
3231
if errorlevel 1 exit 1
3332
)
3433

34+
set "CC=icx"
35+
set "CXX=icx"
36+
37+
set "CMAKE_GENERATOR=Ninja"
38+
:: Make CMake verbose
39+
set "VERBOSE=1"
40+
41+
set "CMAKE_ARGS=%CMAKE_ARGS% -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=%PREFIX:\=/%/Library/include/level_zero"
42+
43+
%PYTHON% -m build -w -n -x
44+
if %ERRORLEVEL% neq 0 exit 1
45+
46+
:: `pip install dist\numpy*.whl` does not work on windows,
47+
:: so use a loop; there's only one wheel in dist/ anyway
48+
for /f %%f in ('dir /b /S .\dist') do (
49+
%PYTHON% -m wheel tags --remove --build %GIT_DESCRIBE_NUMBER% %%f
50+
if %ERRORLEVEL% neq 0 exit 1
51+
)
52+
53+
:: wheel file was renamed
54+
for /f %%f in ('dir /b /S .\dist') do (
55+
%PYTHON% -m pip install %%f ^
56+
--no-build-isolation ^
57+
--no-deps ^
58+
--only-binary :all: ^
59+
--no-index ^
60+
--prefix %PREFIX% ^
61+
-vv
62+
if %ERRORLEVEL% neq 0 exit 1
63+
)
64+
65+
:: Copy wheel package
3566
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
36-
rem Install and assemble wheel package from the build bits
37-
"%PYTHON%" setup.py install bdist_wheel --build-number %GIT_DESCRIBE_NUMBER% %SKBUILD_ARGS%
38-
if errorlevel 1 exit 1
3967
copy dist\dpctl*.whl %WHEELS_OUTPUT_FOLDER%
4068
if errorlevel 1 exit 1
41-
) ELSE (
42-
rem Only install
43-
"%PYTHON%" setup.py install %SKBUILD_ARGS%
44-
if errorlevel 1 exit 1
45-
)
46-
47-
if EXIST "%PLATFORM_DIR%" (
48-
rem copy back
49-
copy /Y "%FN%" "%PLATFORM_DIR%\%FN%"
50-
if errorlevel 1 exit 1
5169
)

conda-recipe/build.sh

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,69 @@ echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot
88
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"
99
export ICXCFG="$(pwd)/icpx_for_conda.cfg"
1010

11+
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
12+
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
13+
1114
if [ -e "_skbuild" ]; then
1215
${PYTHON} setup.py clean --all
1316
fi
14-
export CMAKE_GENERATOR="Ninja"
15-
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
16-
echo "${PYTHON} setup.py install ${SKBUILD_ARGS}"
17-
18-
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
19-
# Install packages and assemble wheel package from built bits
20-
WHEELS_BUILD_ARGS="-p manylinux_2_28_x86_64 --build-number ${GIT_DESCRIBE_NUMBER}"
21-
${PYTHON} setup.py install bdist_wheel ${WHEELS_BUILD_ARGS} ${SKBUILD_ARGS}
22-
cp dist/dpctl*.whl ${WHEELS_OUTPUT_FOLDER}
23-
else
24-
# Perform regular install
25-
${PYTHON} setup.py install ${SKBUILD_ARGS}
17+
18+
export CC=icx
19+
export CXX=icpx
20+
21+
export CMAKE_GENERATOR=Ninja
22+
# Make CMake verbose
23+
export VERBOSE=1
24+
25+
CMAKE_ARGS="${CMAKE_ARGS} -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=${PREFIX}/include/level_zero"
26+
27+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
28+
${PYTHON} -m build -w -n -x
29+
30+
pushd dist
31+
${PYTHON} -m wheel unpack -d dpctl_wheel dpctl*.whl
32+
export lib_name=libDPCTLSyclInterface
33+
export so_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so")
34+
export sox_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so\.[0-9]*$")
35+
export soxxx_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so\.[0-9]*\.[0-9]*$")
36+
37+
rm -rf ${so_full_path} ${soxxx_full_path}
38+
39+
export so_name=$(basename ${so_full_path})
40+
export sox_name=$(basename ${sox_full_path})
41+
export soxxx_name=$(basename ${soxxx_full_path})
42+
export wheel_path=$(dirname $(dirname ${so_full_path}))
43+
44+
# deal with hard copies
45+
${PYTHON} -m wheel pack ${wheel_path}
46+
47+
rm -rf dpctl_wheel
48+
popd
49+
50+
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
51+
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
52+
dist/dpctl*.whl
53+
54+
${PYTHON} -m pip install dist/dpctl*.whl \
55+
--no-build-isolation \
56+
--no-deps \
57+
--only-binary :all: \
58+
--no-index \
59+
--prefix "${PREFIX}" \
60+
-vv
61+
62+
export libdir=$(find $PREFIX -name 'libDPCTLSyclInterface*' -exec dirname \{\} \;)
63+
64+
# Recover symbolic links
65+
# libDPCTLSyclInterface.so.0 -> libDPCTLSyclInterface.so.0.17
66+
# libDPCTLSyclInterface.so -> libDPCTLSyclInterface.so.0
67+
mv ${libdir}/${sox_name} ${libdir}/${soxxx_name}
68+
ln -s ${libdir}/${soxxx_name} ${libdir}/${sox_name}
69+
ln -s ${libdir}/${sox_name} ${libdir}/${so_name}
70+
71+
# Copy wheel package
72+
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
73+
cp dist/dpctl*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
2674
fi
2775

2876
# need to create this folder so ensure that .dpctl-post-link.sh can work correctly

0 commit comments

Comments
 (0)