Skip to content

Commit c587b63

Browse files
Run SYCL workflows with both nightly and release version of DPC++ (#246)
This will create a job for each version of the compiler (nightly and release), on both Intel PVC Test and Intel PVC Python Interface Test. The workflow is still callable with a custom tag of the compiler nightly build using the `workflow_dispatch` form. Running Intel PVC tests for the release compiler only works with `icpx` (not with `clang++`) --------- Co-authored-by: Alejandro Acosta <[email protected]>
1 parent 88f291c commit c587b63

File tree

4 files changed

+67
-41
lines changed

4 files changed

+67
-41
lines changed
Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,65 @@
11
name: install-dpcpp
22
description: Download and unpack DPC++ nightly release
33
inputs:
4+
DPCPP_RELEASE:
5+
description: "Use RELEASE or NIGHTLY DPC++ release"
6+
type: string
7+
default: NIGHTLY
48
DPCPP_VERSION:
59
description: "DPC++ version to use"
610
type: string
711
DPCPP_PATH:
812
description: Path to DPC++
913
type: string
14+
default: ~/dpcpp
1015
runs:
1116
using: "composite"
1217
steps:
1318
- name: Install DPCPP
14-
id: install_dpcpp
19+
if: inputs.DPCPP_RELEASE == 'NIGHTLY'
1520
shell: bash
1621
run: |
1722
export DPCPP_PATH=${{ inputs.DPCPP_PATH }}
18-
mkdir $DPCPP_PATH
23+
mkdir -p $DPCPP_PATH
1924
pushd $DPCPP_PATH
20-
if [[ "${{ inputs.DPCPP_VERSION }}" != "" ]]; then \
21-
echo "Will use DPCPP ${{ inputs.DPCPP_VERSION }}."; \
22-
echo "Downloading DPCPP from https://github.com/intel/llvm/releases/download/${{ inputs.DPCPP_VERSION }}/sycl_linux.tar.gz"; \
23-
wget -q https://github.com/intel/llvm/releases/download/${{ inputs.DPCPP_VERSION }}/sycl_linux.tar.gz; \
25+
if [[ "${{ inputs.DPCPP_VERSION }}" != "" ]]; then
26+
echo "Will use DPCPP ${{ inputs.DPCPP_VERSION }}"
27+
URL=https://github.com/intel/llvm/releases/download/${{ inputs.DPCPP_VERSION }}/sycl_linux.tar.gz;
2428
else
25-
echo "Will use latest DPCPP version."; \
26-
latest=$(curl -sS https://api.github.com/repos/intel/llvm/releases | jq -r '[.[].tag_name|select(match("nightly-[0-9]{4}-[0-9]{2}-[0-9]{2}"))][0]') && \
27-
echo "Downloading DPCPP from https://github.com/intel/llvm/releases/download/${latest}/sycl_linux.tar.gz"; \
28-
wget -q https://github.com/intel/llvm/releases/download/${latest}/sycl_linux.tar.gz; \
29+
echo "Will use latest DPCPP version"
30+
latest=$(curl -sS https://api.github.com/repos/intel/llvm/releases | jq -r '[.[].tag_name|select(match("nightly-[0-9]{4}-[0-9]{2}-[0-9]{2}"))][0]')
31+
URL=https://github.com/intel/llvm/releases/download/${latest}/sycl_linux.tar.gz;
2932
fi
30-
tar -xf sycl_linux.tar.gz
31-
rm sycl_linux.tar.gz
33+
echo "Downloading DPCPP from ${URL}"
34+
sudo wget -q $URL
35+
sudo tar -xf sycl_linux.tar.gz
36+
sudo rm sycl_linux.tar.gz
3237
popd
33-
38+
cat <<EOF | tee setvars.sh
39+
export PATH=$DPCPP_PATH/bin:$PATH
40+
export C_INCLUDE_PATH=$DPCPP_PATH/include:$C_INCLUDE_PATH
41+
export CPLUS_INCLUDE_PATH=$DPCPP_PATH/include:$CPLUS_INCLUDE_PATH
42+
export LD_LIBRARY_PATH=$DPCPP_PATH/lib:$LD_LIBRARY_PATH
43+
export CC=$DPCPP_PATH/bin/clang
44+
export CXX=$DPCPP_PATH/bin/clang++
45+
EOF
46+
- name: Install DPCPP
47+
if: inputs.DPCPP_RELEASE == 'RELEASE'
48+
shell: bash
49+
run: |
50+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
51+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
52+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
53+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
54+
sudo apt update
55+
sudo apt install -y intel-oneapi-runtime-libs intel-oneapi-compiler-dpcpp-cpp
56+
. /opt/intel/oneapi/setvars.sh
57+
cat <<EOF | tee setvars.sh
58+
. /opt/intel/oneapi/setvars.sh
59+
export CC=icx
60+
export CXX=icpx
61+
export C_INCLUDE_PATH=$CMPLR_ROOT/include:$C_INCLUDE_PATH
62+
export CPLUS_INCLUDE_PATH=$CMPLR_ROOT/include:$CPLUS_INCLUDE_PATH
63+
export LD_LIBRARY_PATH=$CMPLR_ROOT/lib:$LD_LIBRARY_PATH
64+
EOF
3465

.github/actions/install-dpctl/action.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ inputs:
77
description: Name of the DPCTL branch to use.
88
DPCTL_PATH:
99
description: Path where to put DPCTL
10-
DPCPP_PATH:
11-
description: Path to DPC++
1210
VENV_PATH:
1311
description: Path to virtualenv
1412

@@ -22,11 +20,8 @@ runs:
2220
git clone --depth=1 --branch ${{ inputs.DPCTL_BRANCH }} ${{ inputs.DPCTL_URL }} $DPCTL_PATH
2321
pushd $DPCTL_PATH
2422
source ${{ inputs.VENV_PATH }}/bin/activate
25-
export DPCPP_PATH=${{ inputs.DPCPP_PATH }}
26-
export PATH=$DPCPP_PATH/bin:$PATH
27-
export LD_LIBRARY_PATH=$DPCPP_PATH/lib:$LD_LIBRARY_PATH
2823
pip install --no-cache-dir numpy cython scikit-build cmake ninja pytest versioneer
29-
python scripts/build_locally.py --c-compiler=$DPCPP_PATH/bin/clang \
30-
--cxx-compiler=$DPCPP_PATH/bin/clang++ \
31-
--compiler-root=$DPCPP_PATH/bin \
24+
python scripts/build_locally.py --c-compiler=$(which $CC) \
25+
--cxx-compiler=$(which $CXX) \
26+
--compiler-root=$(dirname `which $CXX`) \
3227
--cmake-opts="-DCMAKE_INCLUDE_PATH=/lib/x86_64-linux-gnu -DLIBZE_LOADER_FILENAME=libze_loader.so.1"

.github/workflows/intel_pvc_test.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ concurrency:
2121

2222
jobs:
2323
run-tests:
24+
strategy:
25+
matrix:
26+
compiler: [ NIGHTLY, RELEASE ]
2427
name: Run Intel PVC tests
2528
runs-on: cp-gpumax-1100-gpu
2629
timeout-minutes: 30
@@ -31,22 +34,18 @@ jobs:
3134
# For a specific DPC++ nightly build define the repository variable DPCPP_VERSION
3235
# for example using the tag: 'nightly-2024-04-22'
3336
- name: Install DPC++
34-
id: install_dpcpp
3537
uses: ./.github/actions/install-dpcpp
3638
with:
39+
DPCPP_RELEASE: ${{ matrix.compiler }}
3740
DPCPP_VERSION: ${{ inputs.DPCPP_VERSION }}
38-
DPCPP_PATH: ~/dpcpp
3941
- name: Build
4042
shell: bash
4143
run: |
42-
export DPCPP_PATH=~/dpcpp
43-
export PATH=$DPCPP_PATH/bin/:$PATH
44-
export C_INCLUDE_PATH=$DPCPP_PATH/include/:$C_INCLUDE_PATH
45-
export CPLUS_INCLUDE_PATH=$DPCPP_PATH/include/:$CPLUS_INCLUDE_PATH
46-
export LD_LIBRARY_PATH=$DPCPP_PATH/lib/:$LD_LIBRARY_PATH
47-
export CC=clang
48-
export CXX=clang++
49-
clang++ --version
44+
. setvars.sh
45+
# Persist environment variables to following steps
46+
env >> $GITHUB_ENV
47+
which $CXX
48+
$CXX --version
5049
cmake -G Ninja \
5150
-DCUTLASS_ENABLE_SYCL=ON \
5251
-DDPCPP_SYCL_TARGET=intel_gpu_pvc
@@ -55,13 +54,9 @@ jobs:
5554
- name: Unit test
5655
shell: bash
5756
run: |
58-
export DPCPP_PATH=~/dpcpp
59-
export LD_LIBRARY_PATH=$DPCPP_PATH/lib/:$LD_LIBRARY_PATH
6057
cmake --build . --target test_unit -j 24
6158
6259
- name: Examples
6360
shell: bash
6461
run: |
65-
export DPCPP_PATH=~/dpcpp
66-
export LD_LIBRARY_PATH=$DPCPP_PATH/lib/:$LD_LIBRARY_PATH
6762
cmake --build . --target test_examples -j 24

.github/workflows/intel_pvc_python_test.yml renamed to .github/workflows/sycl_python_test.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "SYCL Intel PVC Python Interface Test"
1+
name: "SYCL Python Interface Test"
22

33
on:
44
push:
@@ -21,7 +21,10 @@ concurrency:
2121

2222
jobs:
2323
run-tests:
24-
name: Run Intel PVC tests
24+
name: Run Python Interface tests on Intel PVC
25+
# strategy:
26+
# matrix:
27+
# compiler: [ NIGHTLY, RELEASE ]
2528
runs-on: cp-gpumax-1100-gpu
2629
timeout-minutes: 60
2730

@@ -36,20 +39,25 @@ jobs:
3639
id: install_dpcpp
3740
uses: ./.github/actions/install-dpcpp
3841
with:
42+
# DPCPP_RELEASE: ${{ matrix.compiler }}
3943
DPCPP_VERSION: ${{ inputs.DPCPP_VERSION }}
4044
DPCPP_PATH: ~/dpcpp
4145
- name: Setup virtual environment
4246
shell: bash
4347
run: |
4448
python3 -m venv ~/.venv
49+
source ~/.venv/bin/activate
50+
. setvars.sh
51+
# Persist environment variables to following steps
52+
env >> $GITHUB_ENV
53+
4554
- name: Install DPCTL
4655
id: install_dpctl
4756
uses: ./.github/actions/install-dpctl
4857
with:
4958
DPCTL_URL: https://github.com/sommerlukas/dpctl.git
5059
DPCTL_BRANCH: rebase-kernel-param
5160
DPCTL_PATH: ~/dpctl
52-
DPCPP_PATH: ~/dpcpp
5361
VENV_PATH: ~/.venv
5462
- name: Install Torch XPU
5563
shell: bash
@@ -60,9 +68,6 @@ jobs:
6068
- name: Run Python Interface GEMM Tests
6169
shell: bash
6270
run: |
63-
export DPCPP_PATH=~/dpcpp
64-
export PATH=$DPCPP_PATH/bin:$PATH
65-
export LD_LIBRARY_PATH=$DPCPP_PATH/lib:$LD_LIBRARY_PATH
6671
source ~/.venv/bin/activate
6772
pip install -e .
6873
export CUTLASS_USE_SYCL=1

0 commit comments

Comments
 (0)