Skip to content

Commit 779b6c2

Browse files
committed
Add versioneer
1 parent f56f819 commit 779b6c2

File tree

34 files changed

+992
-148
lines changed

34 files changed

+992
-148
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ exclude =
88
__pycache__
99
./dist
1010
./setup.py
11+
./dpbench/_version.py
1112
max-complexity = 10

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dpbench/_version.py export-subst

.github/workflows/build_and_run.yml

Lines changed: 70 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,27 @@ on:
1111

1212
env:
1313
# sycl is not included. Add it manually if you need
14-
WORKLOADS: python,numpy,dpnp,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p,numba_mlir_k,numba_mlir_n,numba_mlir_p
14+
# WORKLOADS: python,numpy,dpnp,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p,numba_mlir_k,numba_mlir_n,numba_mlir_p
15+
WORKLOADS: python,numpy,dpnp,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p
1516

1617
jobs:
17-
build_linux:
18+
build:
1819
name: Build and run
1920

2021
strategy:
2122
fail-fast: false
2223
matrix:
2324
os: ["ubuntu-latest", "windows-latest"]
24-
python: ["3.9", "3.10"]
25+
python: ["3.9", "3.10", "3.11"]
2526
sycl: ["sycl","no-sycl"]
2627
install: ["pip", "setup.py"]
28+
exclude:
29+
# setuptools<64 + scikit-build produce 'UNKOWN' package name for
30+
# python 3.11. Could not find exact reference for that issue.
31+
# latest setuptools is unable to create editable environment for pip
32+
- python: "3.11"
33+
install: "pip"
34+
sycl: "sycl"
2735
include:
2836
- sycl: sycl
2937
os: ubuntu-latest
@@ -40,6 +48,10 @@ jobs:
4048

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

51+
defaults:
52+
run:
53+
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
54+
4355
steps:
4456
- name: Cancel Previous Runs
4557
uses: styfle/cancel-workflow-action@0.6.0
@@ -51,6 +63,15 @@ jobs:
5163
with:
5264
fetch-depth: 0
5365

66+
# intel:numpy for python 3.11 is not upstreamed yet
67+
- name: Patch numpy dependency for Python 3.11
68+
if: matrix.python == '3.11'
69+
shell: bash -l {0}
70+
run: |
71+
find ./environments -type f | xargs sed -i 's/intel::numpy/numpy/'
72+
find ./environments -type f | xargs sed -i '/numba-mlir/d'
73+
find ./environments -type f | xargs sed -i 's/setuptools>=42,<64/setuptools/'
74+
5475
- name: Setup miniconda
5576
uses: conda-incubator/setup-miniconda@v2
5677
with:
@@ -63,25 +84,10 @@ jobs:
6384
run-post: false
6485

6586
- name: Conda info
66-
shell: bash -el {0}
6787
run: |
6888
conda info
6989
conda list
7090
71-
72-
- name: Setup OpenCL CPU device
73-
if: runner.os == 'Windows'
74-
shell: pwsh
75-
run: |
76-
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
77-
&$script_path
78-
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV
79-
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV
80-
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV
81-
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
82-
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
83-
Get-Content -Tail 5 -Path $cl_cfg
84-
8591
- name: Configure Python
8692
if: runner.os == 'Windows'
8793
shell: pwsh
@@ -98,6 +104,20 @@ jobs:
98104
$env:FN="Windows-IntelLLVM.cmake"
99105
Copy-Item ".github\workflows\Windows-IntelLLVM_${env:PATCHED_CMAKE_VERSION}.cmake" "${env:PLATFORM_DIR}\${env:FN}"
100106
107+
# TODO: remove it once it is removed from hard dependency. Not presented
108+
# in conda-forge version, but there are some blockers before we could use
109+
# it.
110+
- name: Remove vs env
111+
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
112+
run: |
113+
conda remove --force vs2017_win-64
114+
115+
- name: Configure MSBuild
116+
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
117+
uses: ilammy/msvc-dev-cmd@v1
118+
with:
119+
toolset: 14.35
120+
101121
- name: Configure Sycl
102122
if: matrix.sycl == 'sycl'
103123
shell: bash -el {0}
@@ -108,31 +128,47 @@ jobs:
108128
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
109129
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
110130
131+
- name: Configure compiler
132+
run: |
133+
echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
134+
135+
- name: Configure OneAPI
136+
run: |
137+
echo "ONEAPI_DEVICE_SELECTOR=opencl:cpu" >> "$GITHUB_ENV"
138+
139+
- name: Populate conda environment paths
140+
shell: pwsh
141+
if: runner.os == 'Windows'
142+
run: |
143+
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV
144+
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV
145+
111146
- name: Build dpbench
112147
if: matrix.install == 'pip'
113-
shell: bash -el {0}
114-
run: |
115-
pip install \
116-
--no-index --no-deps --no-build-isolation -e . -v
148+
run: pip install --no-index --no-deps --no-build-isolation -e . -v
117149

118150
- name: Build dpbench
119151
if: matrix.install == 'setup.py'
120-
shell: bash -el {0}
121-
run: |
122-
python setup.py develop
152+
run: python setup.py develop
123153

124-
- name: Run benchmarks
154+
- name: Configure dpbench
125155
shell: bash -el {0}
126156
run: |
127-
export NUMBA_MLIR_GPU_RUNTIME=sycl
157+
# TODO: do we need GPU in github acions?
158+
echo "NUMBA_MLIR_GPU_RUNTIME=sycl" >> "GITHUB_ENV"
128159
# Turn off numba-dpex autofall back
129-
export NUMBA_DPEX_FALLBACK_ON_CPU=0
130-
# Make sure numba-dpex is using native atomics in github CI
131-
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
160+
echo "NUMBA_DPEX_FALLBACK_ON_CPU=0" >> "GITHUB_ENV"
132161
133-
dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1
162+
- name: Setup OpenCL CPU device
163+
if: runner.os == 'Windows'
164+
shell: pwsh
165+
run: |
166+
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
167+
&$script_path
168+
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV
169+
170+
- name: Run benchmarks
171+
run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results || exit 1
134172

135173
- name: Generate report
136-
shell: bash -el {0}
137-
run: |
138-
dpbench -i ${WORKLOADS} report || exit 1
174+
run: dpbench -i ${{env.WORKLOADS}} report || exit 1

.github/workflows/conda-package.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
PACKAGE_NAME: dpbench
1515
MODULE_NAME: dpbench
1616
# There is a separate action that removes defaults.
17-
CHANNELS: 'dppy/label/dev,conda-forge,intel'
17+
CHANNELS: 'dppy/label/dev,conda-forge,intel,nodefaults'
1818
VER_JSON_NAME: 'version.json'
1919
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
2020
VER_SCRIPT2: "d = j['dpbench'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
@@ -26,14 +26,14 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python: ['3.9', '3.10']
29+
python: ['3.9', '3.10', '3.11']
3030
os: [ubuntu-latest, windows-latest]
3131

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

3434
defaults:
3535
run:
36-
shell: bash -l {0}
36+
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }}
3737

3838
continue-on-error: false
3939

@@ -63,12 +63,19 @@ jobs:
6363
run: conda config --remove channels defaults
6464

6565
- name: Store conda paths as envs
66+
shell: bash -l {0}
6667
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/${{ runner.os == 'Linux' && 'linux' || 'win' }}-64/" | tr "\\" '/' >> $GITHUB_ENV
6768

6869
# boa is an extention to conda so we can use mamba resolver in conda build
6970
- name: Install conda-build
7071
run: mamba install boa
7172

73+
- name: Configure MSBuild
74+
if: runner.os == 'Windows'
75+
uses: microsoft/setup-msbuild@v1.1
76+
with:
77+
vs-version: '14.35'
78+
7279
- name: Build conda package
7380
run: conda mambabuild --no-test --python ${{ matrix.python }} conda-recipe
7481

@@ -92,7 +99,7 @@ jobs:
9299
strategy:
93100
fail-fast: false
94101
matrix:
95-
python: ['3.9', '3.10']
102+
python: ['3.9', '3.10', '3.11']
96103
os: [ubuntu-20.04, ubuntu-latest, windows-latest]
97104
experimental: [false]
98105

@@ -168,7 +175,7 @@ jobs:
168175

169176
strategy:
170177
matrix:
171-
python: ['3.9', '3.10']
178+
python: ['3.9', '3.10', '3.11']
172179
os: [ubuntu-latest, windows-latest]
173180

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

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Changelog
8+
All notable changes to this project will be documented in this file.
9+
10+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12+
13+
## [0.90.0] - 2023-06-23
14+
15+
### Added
16+
* First release.
17+
* Infrastructure to run benchmarks in independent threads.
18+
* Frameworks
19+
* numpy
20+
* python
21+
* dpnp
22+
* dpcpp
23+
* numba
24+
* numb-dpex
25+
* Benchmarks
26+
* black_scholes
27+
* dbscan
28+
* gpairs
29+
* kmeans
30+
* knn
31+
* l2_norm
32+
* pairwise_distance
33+
* pca
34+
* rambo
35+
* Experimental framework
36+
* numba-mlir
37+
* Experimental benchmarks
38+
* multiple npbench benchmarks
39+
* multiple polybench benchmarks

CMakeLists.txt

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
5+
cmake_minimum_required(VERSION 3.22..3.27 FATAL_ERROR)
66

77
project(dpbench
88
LANGUAGES CXX
@@ -14,10 +14,28 @@ project(dpbench
1414
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
1515
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
1616

17+
find_package(Python 3.9 REQUIRED
18+
COMPONENTS Interpreter Development.Module)
19+
20+
if(NOT DEFINED DPCTL_LIBRARY_PATH)
21+
execute_process(
22+
COMMAND ${Python3_EXECUTABLE} -c "import dpctl,os; print(os.path.dirname(dpctl.__file__));"
23+
OUTPUT_VARIABLE DPCTL_LIBRARY_PATH
24+
RESULT_VARIABLE RET
25+
OUTPUT_STRIP_TRAILING_WHITESPACE
26+
)
27+
28+
if(RET EQUAL "1")
29+
message(FATAL_ERROR "Module \'dpctl\' not found.")
30+
endif()
31+
endif()
32+
33+
cmake_path(APPEND DPCTL_MODULE_PATH ${DPCTL_LIBRARY_PATH} resources cmake)
34+
list(APPEND CMAKE_MODULE_PATH ${DPCTL_MODULE_PATH})
35+
1736
find_package(pybind11 CONFIG REQUIRED)
18-
find_package(IntelDPCPP REQUIRED)
19-
find_package(PythonExtensions REQUIRED)
20-
find_package(Python3 COMPONENTS NumPy Development)
37+
find_package(IntelSYCL REQUIRED)
38+
find_package(Dpctl REQUIRED)
2139

2240
set(CMAKE_CXX_STANDARD 17)
2341
set(CMAKE_CXX_STANDARD_REQUIRED True)

conda-recipe/bld.bat

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ REM @TODO: remove the setting, once transition to build backend on Windows
1313
REM to cmake is complete.
1414
SET "SETUPTOOLS_USE_DISTUTILS=stdlib"
1515

16-
SET "DPBENCH_SYCL=1"
16+
set "DPBENCH_SYCL=1"
17+
set "CMAKE_GENERATOR=Ninja"
18+
set "CC=icx"
19+
set "CXX=icx"
1720

1821
"%PYTHON%" setup.py clean --all
1922

20-
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx"
21-
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
22-
2323
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
2424
REM set DIR_HINT if directory exists
2525
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
@@ -41,18 +41,22 @@ if EXIST "%PLATFORM_DIR%" (
4141
if errorlevel 1 exit 1
4242
)
4343

44+
45+
@REM TODO: switch to pip build. Currently results in broken binary
46+
@REM %PYTHON% -m pip install --no-index --no-deps --no-build-isolation . -v
4447
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
4548
rem Install and assemble wheel package from the build bits
46-
"%PYTHON%" setup.py install bdist_wheel %SKBUILD_ARGS%
49+
"%PYTHON%" setup.py install bdist_wheel
4750
if errorlevel 1 exit 1
4851
copy dist\dpbench*.whl %WHEELS_OUTPUT_FOLDER%
4952
if errorlevel 1 exit 1
5053
) ELSE (
5154
rem Only install
52-
"%PYTHON%" setup.py install %SKBUILD_ARGS%
55+
"%PYTHON%" setup.py install
5356
if errorlevel 1 exit 1
5457
)
5558

59+
5660
rem copy back
5761
if EXIST "%PLATFORM_DIR%" (
5862
copy /Y "%FN%" "%PLATFORM_DIR%\%FN%"

0 commit comments

Comments
 (0)