-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
986 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ exclude = | |
__pycache__ | ||
./dist | ||
./setup.py | ||
./dpbench/_version.py | ||
max-complexity = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
dpbench/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,35 +11,44 @@ on: | |
|
||
env: | ||
# sycl is not included. Add it manually if you need | ||
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 | ||
# 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 | ||
WORKLOADS: python,numpy,dpnp,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p | ||
|
||
jobs: | ||
build_linux: | ||
build: | ||
name: Build and run | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
python: ["3.9", "3.10"] | ||
sycl: ["sycl","no-sycl"] | ||
install: ["pip", "setup.py"] | ||
# os: ["ubuntu-latest", "windows-latest"] | ||
# python: ["3.9", "3.10", "3.11"] | ||
# sycl: ["sycl","no-sycl"] | ||
# install: ["pip", "setup.py"] | ||
os: ["windows-latest"] | ||
python: ["3.9"] | ||
sycl: ["sycl"] | ||
install: ["setup.py"] | ||
include: | ||
- sycl: sycl | ||
os: ubuntu-latest | ||
cc: icx | ||
cxx: icpx | ||
environment: conda-linux-sycl.yml | ||
# - sycl: sycl | ||
# os: ubuntu-latest | ||
# cc: icx | ||
# cxx: icpx | ||
# environment: conda-linux-sycl.yml | ||
- sycl: sycl | ||
os: windows-latest | ||
cc: icx | ||
cxx: icx | ||
environment: conda-win-sycl.yml | ||
- sycl: no-sycl | ||
environment: conda.yml | ||
# - sycl: no-sycl | ||
# environment: conda.yml | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
@@ -51,6 +60,14 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
# intel:numpy for python 3.11 is not upstreamed yet | ||
# - name: Patch numpy dependency for Python 3.11 | ||
# if: matrix.python == '3.11' | ||
# shell: bash -l {0} | ||
# run: | | ||
# find ./environments -type f | xargs sed -i 's/intel::numpy/numpy/' | ||
# find ./environments -type f | xargs sed -i '/numba-mlir/d' | ||
|
||
- name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
|
@@ -63,31 +80,17 @@ jobs: | |
run-post: false | ||
|
||
- name: Conda info | ||
shell: bash -el {0} | ||
run: | | ||
conda info | ||
conda list | ||
run: conda info | ||
|
||
- name: Conda list | ||
run: conda list | ||
|
||
- name: Setup OpenCL CPU device | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1" | ||
&$script_path | ||
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV | ||
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV | ||
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV | ||
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default | ||
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg" | ||
Get-Content -Tail 5 -Path $cl_cfg | ||
- name: Configure Python | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
# Set python encoding to support utf-8 symblos like ms. | ||
echo "PYTHONIOENCODING=utf-8" >> $env:GITHUB_ENV | ||
# - name: Configure Python | ||
# if: runner.os == 'Windows' | ||
# shell: pwsh | ||
# run: | | ||
# # Set python encoding to support utf-8 symblos like ms. | ||
# echo "PYTHONIOENCODING=utf-8" >> $env:GITHUB_ENV | ||
|
||
- name: Patch IntelLLVM cmake | ||
if: runner.os == 'Windows' && matrix.sycl == 'sycl' | ||
|
@@ -97,6 +100,18 @@ jobs: | |
$env:PLATFORM_DIR="${env:CONDA_PREFIX}\Library\share\cmake-${env:PATCHED_CMAKE_VERSION}\Modules\Platform" | ||
$env:FN="Windows-IntelLLVM.cmake" | ||
Copy-Item ".github\workflows\Windows-IntelLLVM_${env:PATCHED_CMAKE_VERSION}.cmake" "${env:PLATFORM_DIR}\${env:FN}" | ||
# - uses: ilammy/msvc-dev-cmd@v1 | ||
# with: | ||
# toolset: 14.35 | ||
|
||
# - name: Set VC environment | ||
# if: runner.os == 'Windows' && matrix.sycl == 'sycl' | ||
# run: | | ||
# set PATH="%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\" | ||
# call vcvarsall.bat -vcvars_ver=14.35 | ||
# set "LIB=%CONDA_PREFIX%\Library\lib;%CONDA_PREFIX%\compiler\lib;%LIB%" | ||
# set "INCLUDE=%CONDA_PREFIX%\include;%INCLUDE%" | ||
|
||
- name: Configure Sycl | ||
if: matrix.sycl == 'sycl' | ||
|
@@ -107,32 +122,58 @@ jobs: | |
echo "CXX=${{matrix.cxx}}" >> "$GITHUB_ENV" | ||
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV" | ||
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV" | ||
echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" | ||
- name: LIST Environment variables | ||
shell: SET | ||
|
||
# - name: Configure MSBuild | ||
# if: runner.os == 'Windows' | ||
# uses: microsoft/[email protected] | ||
# with: | ||
# # https://www.intel.com/content/www/us/en/developer/articles/reference-implementation/intel-compilers-compatibility-with-microsoft-visual-studio-and-xcode.html | ||
# # https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md | ||
# vs-version: '[17.0,17.6.4]' | ||
|
||
- name: Build dpbench | ||
if: matrix.install == 'pip' | ||
shell: bash -el {0} | ||
run: | | ||
pip install \ | ||
--no-index --no-deps --no-build-isolation -e . -v | ||
run: pip install --no-index --no-deps --no-build-isolation -e . -v | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
toolset: 14.35 | ||
|
||
# CALL "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.35 | ||
# SET | ||
- name: Build dpbench | ||
if: matrix.install == 'setup.py' | ||
shell: bash -el {0} | ||
run: | | ||
python setup.py develop | ||
- name: Run benchmarks | ||
- name: Configure dpbench | ||
shell: bash -el {0} | ||
run: | | ||
export NUMBA_MLIR_GPU_RUNTIME=sycl | ||
# Turn off numba-dpex autofall back | ||
export NUMBA_DPEX_FALLBACK_ON_CPU=0 | ||
# Make sure numba-dpex is using native atomics in github CI | ||
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1 | ||
dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1 | ||
- name: Setup OpenCL CPU device | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1" | ||
&$script_path | ||
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV | ||
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV | ||
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV | ||
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default | ||
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg" | ||
Get-Content -Tail 5 -Path $cl_cfg | ||
- name: Run benchmarks | ||
shell: bash -el {0} | ||
run: dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1 | ||
|
||
- name: Generate report | ||
shell: bash -el {0} | ||
run: | | ||
dpbench -i ${WORKLOADS} report || exit 1 | ||
run: dpbench -i ${WORKLOADS} report || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
#!/bin/bash | ||
#!/bin/bash -x | ||
|
||
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Intel LLVM must cooperate with compiler and sysroot from conda | ||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${BUILD_PREFIX}/lib" | ||
|
||
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg | ||
export ICPXCFG="$(pwd)/icpx_for_conda.cfg" | ||
export ICXCFG="$(pwd)/icpx_for_conda.cfg" | ||
|
||
export CMAKE_GENERATOR="Ninja" | ||
export DPBENCH_SYCL=1 | ||
export CMAKE_GENERATOR="Ninja" | ||
export CC=icx | ||
export CXX=icpx | ||
|
||
if [ -e "_skbuild" ]; then | ||
${PYTHON} setup.py clean --all | ||
fi | ||
|
||
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" | ||
# declare -a ARGS=(install --single-version-externally-managed --record=record.txt) | ||
|
||
# Build wheel package | ||
if [ "$CONDA_PY" == "36" ]; then | ||
WHEELS_BUILD_ARGS="-p manylinux1_x86_64" | ||
else | ||
WHEELS_BUILD_ARGS="-p manylinux2014_x86_64" | ||
fi | ||
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then | ||
$PYTHON setup.py install bdist_wheel ${WHEELS_BUILD_ARGS} ${SKBUILD_ARGS} | ||
cp dist/dpnp*.whl ${WHEELS_OUTPUT_FOLDER} | ||
else | ||
$PYTHON setup.py install ${SKBUILD_ARGS} | ||
fi | ||
# if [[ -v WHEELS_OUTPUT_FOLDER ]]; then | ||
# ARGS+=(bdist_wheel -p manylinux2014_x86_64) | ||
# fi | ||
|
||
# ARGS+=(-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON) | ||
|
||
# echo "${ARGS[*]}" | ||
|
||
# $PYTHON setup.py ${ARGS[@]} | ||
$PYTHON -m pip install --no-index --no-deps --no-build-isolation . -v | ||
|
||
# if [[ -v WHEELS_OUTPUT_FOLDER ]]; then | ||
# cp dist/numba_dpex*.whl "${WHEELS_OUTPUT_FOLDER[@]}" | ||
# fi |
Oops, something went wrong.