Skip to content

Commit 276f872

Browse files
committed
Try one action
1 parent a01122a commit 276f872

File tree

4 files changed

+133
-99
lines changed

4 files changed

+133
-99
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# SPDX-FileCopyrightText: 2000 - 2023 Kitware, Inc. and Contributors
2+
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
7+
# This module is shared by multiple languages; use include blocker.
8+
if(__WINDOWS_INTEL_LLVM)
9+
return()
10+
endif()
11+
set(__WINDOWS_INTEL_LLVM 1)
12+
13+
# Platform/Windows-MSVC adds some linking options icx/ifx do not understand,
14+
# but that need to be passed to the linker. Wrap all the linking options from
15+
# Platform/Windows-MSVC so that the compiler will hand them off to the linker
16+
# without interpreting them.
17+
18+
# Save original CMAKE_${t}_LINKER_FLAGS_INIT
19+
foreach(t EXE SHARED MODULE STATIC)
20+
set(_saved_cmake_${t}_linker_flags_init ${CMAKE_${t}_LINKER_FLAGS_INIT})
21+
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
22+
endforeach()
23+
include(Platform/Windows-MSVC)
24+
# Wrap linker flags from Windows-MSVC
25+
set(_IntelLLVM_LINKER_WRAPPER_FLAG "/Qoption,link,")
26+
set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP ",")
27+
foreach(t EXE SHARED MODULE STATIC)
28+
set(_wrapped_linker_flags "")
29+
foreach(flag ${CMAKE_${t}_LINKER_FLAGS_INIT})
30+
string(STRIP ${flag} flag)
31+
list(APPEND _wrapped_linker_flags "${_IntelLLVM_LINKER_WRAPPER_FLAG}${flag}")
32+
endforeach()
33+
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
34+
list(APPEND CMAKE_${t}_LINKER_FLAGS_INIT
35+
${_saved_cmake_${t}_linker_flags_init} ${_wrapped_linker_flags})
36+
endforeach()
37+
38+
macro(__windows_compiler_intel lang)
39+
__windows_compiler_msvc(${lang})
40+
41+
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "${_IntelLLVM_LINKER_WRAPPER_FLAG}")
42+
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP "${_IntelLLVM_LINKER_WRAPPER_FLAG_SEP}")
43+
set(CMAKE_${lang}_CREATE_WIN32_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:windows")
44+
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:console")
45+
set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:")
46+
set(CMAKE_LIBRARY_PATH_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/LIBPATH:")
47+
48+
# Features for LINK_LIBRARY generator expression
49+
if(MSVC_VERSION GREATER "1900")
50+
## WHOLE_ARCHIVE: Force loading all members of an archive
51+
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:<LIBRARY>")
52+
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
53+
endif()
54+
55+
set(CMAKE_${lang}_LINK_EXECUTABLE
56+
"${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> <LINK_LIBRARIES> /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
57+
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
58+
"${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD <LINK_FLAGS> <LINK_LIBRARIES> -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
59+
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
60+
if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1)
61+
# The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1
62+
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
63+
"<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
64+
endif()
65+
66+
set(CMAKE_DEPFILE_FLAGS_${lang} "-QMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
67+
set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
68+
endmacro()

.github/workflows/build_and_run.yml

Lines changed: 52 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,31 @@ env:
1515

1616
jobs:
1717
build_linux:
18-
name: Build and run linux
19-
runs-on: ubuntu-latest
18+
name: Build and run
2019

2120
strategy:
2221
fail-fast: false
2322
matrix:
23+
os: ["ubuntu-latest", "windows-latest"]
2424
python: ["3.9", "3.10"]
2525
sycl: ["sycl","no-sycl"]
26+
install: ["pip", "setup.py"]
2627
include:
2728
- sycl: sycl
29+
os: ubuntu-latest
30+
cc: icx
31+
cxx: icpx
2832
environment: conda-linux-sycl.yml
33+
- sycl: sycl
34+
os: windows-latest
35+
cc: icx
36+
cxx: icx
37+
environment: conda-win-sycl.yml
2938
- sycl: no-sycl
3039
environment: conda.yml
3140

41+
runs-on: ${{matrix.os}}
42+
3243
steps:
3344
- name: Cancel Previous Runs
3445
uses: styfle/[email protected]
@@ -55,75 +66,8 @@ jobs:
5566
conda info
5667
conda list
5768
58-
- name: Sycl
59-
if: matrix.sycl == 'sycl'
60-
shell: bash -el {0}
61-
run: |
62-
sycl-ls
63-
echo "CC=icx" >> "$GITHUB_ENV"
64-
echo "CXX=icpx" >> "$GITHUB_ENV"
65-
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
66-
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
67-
68-
- name: Build dpbench
69-
shell: bash -el {0}
70-
run: |
71-
pip install \
72-
--no-index --no-deps --no-build-isolation -e . -v
73-
74-
- name: Run benchmarks
75-
shell: bash -el {0}
76-
run: |
77-
export OCL_ICD_FILENAMES=libintelocl.so
78-
export NUMBA_MLIR_GPU_RUNTIME=sycl
79-
# Turn off numba-dpex autofall back
80-
export NUMBA_DPEX_FALLBACK_ON_CPU=0
81-
# Make sure numba-dpex is using native atomics in github CI
82-
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
83-
84-
dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1
85-
86-
- name: Generate report
87-
shell: bash -el {0}
88-
run: |
89-
dpbench -i ${WORKLOADS} report || exit 1
90-
91-
build-windows:
92-
name: Build and run windows
93-
runs-on: windows-latest
94-
95-
strategy:
96-
fail-fast: false
97-
matrix:
98-
python: ["3.9", "3.10"]
99-
sycl: ["sycl","no-sycl"]
100-
include:
101-
- sycl: sycl
102-
environment: conda-win-sycl.yml
103-
- sycl: no-sycl
104-
environment: conda.yml
105-
106-
steps:
107-
- name: Checkout dpbench
108-
uses: actions/checkout@v3
109-
with:
110-
fetch-depth: 0
111-
112-
- name: Setup conda
113-
uses: conda-incubator/setup-miniconda@v2
114-
with:
115-
auto-update-conda: true
116-
python-version: ${{ matrix.python }}
117-
activate-environment: dpbench-dev
118-
environment-file: environments/${{ matrix.environment }}
119-
120-
- name: Conda info
121-
shell: pwsh
122-
run: |
123-
conda info
124-
conda list
125-
12669
- name: Configure Intel OpenCL CPU RT
70+
if: matrix.os == 'windows-latest'
12771
shell: pwsh
12872
run: |
12973
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
@@ -135,38 +79,57 @@ jobs:
13579
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
13680
Get-Content -Tail 5 -Path $cl_cfg
13781
138-
- name: Sycl
139-
if: matrix.sycl == 'sycl'
82+
- name: Configure Python
83+
if: matrix.os == 'windows-latest'
14084
shell: pwsh
85+
run: |
86+
# Set python encoding to support utf-8 symblos like ms.
87+
echo "PYTHONIOENCODING=utf-8" >> $env:GITHUB_ENV
88+
89+
- name: Patch IntelLLVM cmake
90+
if: matrix.os == 'windows-latest' && matrix.sycl == 'sycl'
91+
shell: pwsh
92+
run: |
93+
$env:PATCHED_CMAKE_VERSION="3.26"
94+
$env:PLATFORM_DIR="${env:CONDA_PREFIX}\Library\share\cmake-${env:PATCHED_CMAKE_VERSION}\Modules\Platform"
95+
$env:FN="Windows-IntelLLVM.cmake"
96+
Copy-Item ".github\workflows\Windows-IntelLLVM_${env:PATCHED_CMAKE_VERSION}.cmake" "${env:PLATFORM_DIR}\${env:FN}"
97+
98+
- name: Configure Sycl
99+
if: matrix.sycl == 'sycl'
100+
shell: bash -el {0}
141101
run: |
142102
sycl-ls
143-
echo "CC=icx" >> $env:GITHUB_ENV
144-
echo "CXX=icx" >> $env:GITHUB_ENV
145-
echo "DPBENCH_SYCL=1" >> $env:GITHUB_ENV
146-
echo "WORKLOADS=$env:WORKLOADS,sycl" >> $env:GITHUB_ENV
103+
echo "CC=${{matrix.cc}}" >> "$GITHUB_ENV"
104+
echo "CXX=${{matrix.cxx}}" >> "$GITHUB_ENV"
105+
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
106+
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
147107
148108
- name: Build dpbench
149-
shell: pwsh
109+
if: matrix.install == 'pip'
110+
shell: bash -el {0}
111+
run: |
112+
pip install \
113+
--no-index --no-deps --no-build-isolation -e . -v
114+
115+
- name: Build dpbench
116+
if: matrix.install == 'setup.py'
117+
shell: bash -el {0}
150118
run: |
151119
python setup.py develop
152-
# pip install `
153-
# --no-index --no-deps --no-build-isolation -e . -v
154120
155121
- name: Run benchmarks
156-
shell: pwsh
122+
shell: bash -el {0}
157123
run: |
158-
$env:NUMBA_MLIR_GPU_RUNTIME="sycl"
124+
export NUMBA_MLIR_GPU_RUNTIME=sycl
159125
# Turn off numba-dpex autofall back
160-
$env:NUMBA_DPEX_FALLBACK_ON_CPU=0
126+
export NUMBA_DPEX_FALLBACK_ON_CPU=0
161127
# Make sure numba-dpex is using native atomics in github CI
162-
$env:NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
163-
164-
$env:PYTHONIOENCODING="utf-8"
165-
# $env:PYTHONLEGACYWINDOWSSTDIO=utf-8
128+
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
166129
167-
dpbench -i $env:WORKLOADS run -r2 --no-print-results
130+
dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1
168131
169132
- name: Generate report
170-
shell: pwsh
133+
shell: bash -el {0}
171134
run: |
172-
dpbench -i $env:WORKLOADS report
135+
dpbench -i ${WORKLOADS} report || exit 1

dpbench/configs/bench_info/knn.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ array_args = [
3232
output_args = [
3333
"predictions",
3434
]
35-
expected_failure_implementations = ["numba_dpex_p"]
35+
36+
# `sycl` fails just on Windows
37+
expected_failure_implementations = ["numba_dpex_p", "sycl"]
3638

3739
[benchmark.parameters.S]
3840
test_size = 1024

environments/conda-win-sycl.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,25 @@
55
name: dpbench-dev
66
channels:
77
- dppy/label/dev
8-
- intel
98
- conda-forge
9+
- intel
1010
- nodefaults
1111
dependencies:
12-
- conda-forge::pip
13-
- conda-forge::tomli
14-
- conda-forge::alembic>=1.11.0
15-
- conda-forge::sqlalchemy>=2.0.0
16-
- conda-forge::scipy
17-
- conda-forge::scikit-learn
18-
- conda-forge::pandas
19-
- numpy
12+
- pip
13+
- tomli
14+
- alembic
15+
- sqlalchemy
16+
- scipy
17+
- scikit-learn
18+
- pandas
19+
- intel::numpy
2020
- numba
2121
- dpctl
2222
- dpnp
2323
- numba-dpex
2424
- numba-mlir
2525
- dpcpp_win-64
26+
- cmake
2627
- cython
2728
- scikit-build
2829
# https://github.com/scikit-build/scikit-build/issues/981

0 commit comments

Comments
 (0)