Skip to content

Add versioneer

Add versioneer #1200

Workflow file for this run

# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
name: build and run
on:
pull_request:
push:
branches: [main]
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
jobs:
build:
name: Build and run
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python: ["3.9", "3.10", "3.11"]
sycl: ["sycl","no-sycl"]
install: ["pip", "setup.py"]
include:
- 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
runs-on: ${{matrix.os}}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout dpbench
uses: actions/checkout@v3
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:
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: "build"
channel-priority: "disabled"
environment-file: environments/${{ matrix.environment }}
run-post: false
- name: Conda info
run: |
conda info
conda list
- 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'
shell: pwsh
run: |
$env:PATCHED_CMAKE_VERSION="3.26"
$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}"
- name: Remove vs env
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
run: |
conda remove --force vs2017_win-64
- name: Configure MSBuild
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.35
- name: Configure Sycl
if: matrix.sycl == 'sycl'
shell: bash -el {0}
run: |
sycl-ls
echo "CC=${{matrix.cc}}" >> "$GITHUB_ENV"
echo "CXX=${{matrix.cxx}}" >> "$GITHUB_ENV"
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
- name: Configure compiler
run: |
echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
- name: Configure OneAPI
run: |
echo "ONEAPI_DEVICE_SELECTOR=opencl:cpu" >> "$GITHUB_ENV"
- name: Compiler config
if: runner.os == 'Linux' && matrix.sycl == 'sycl'
run: |
echo "LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"
echo "--gcc-toolchain=${CONDA_PREFIX} --sysroot=${CONDA_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
echo "ICPXCFG=$(pwd)/icpx_for_conda.cfg" >> "$GITHUB_ENV"
echo "ICXCFG=$(pwd)/icpx_for_conda.cfg" >> "$GITHUB_ENV"
- name: Populate conda environment paths
shell: pwsh
if: runner.os == 'Windows'
run: |
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
# echo "LIB=$CONDA_PREFIX/Library/lib;$CONDA_PREFIX/compiler/lib;$LIB" >> "$GITHUB_ENV"
# echo "INCLUDE=$CONDA_PREFIX/include;$INCLUDE" >> "$GITHUB_ENV"
- name: Build dpbench
if: matrix.install == 'pip'
run: pip install --no-index --no-deps --no-build-isolation -e . -v
- name: Build dpbench
if: matrix.install == 'setup.py'
run: python setup.py develop
- 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
- 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: Show auto acitvates
shell: bash -el {0}
run: ls -al $CONDA_PREFIX/etc/conda/activate.d
- name: Show OCL_ICD bash
shell: bash -el {0}
run: echo $OCL_ICD_FILENAMES
- name: Show OCL_ICD
run: echo %OCL_ICD_FILENAMES%
# - name: List Sycl
# run: sycl-ls
# - name: List Sycl Bash
# shell: bash -el {0}
# run: sycl-ls
- name: Run benchmarks
run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results || exit 1
- name: Generate report
run: dpbench -i ${{env.WORKLOADS}} report || exit 1