Skip to content

Commit

Permalink
Update the ock_demo workflow to use oneapi base toolkit's components.…
Browse files Browse the repository at this point in the history
… Also add sycl-nbody support with dpc++
  • Loading branch information
MaryaSharf committed Feb 14, 2024
1 parent 9b0922b commit 3c0abb4
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 28 deletions.
11 changes: 6 additions & 5 deletions .github/actions/build_portBLAS_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ runs:
- name: Set up Environment and Build portBLAS
shell: bash
run: |
ls
export LD_LIBRARY_PATH=${{ inputs.workspace }}/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang
export LD_LIBRARY_PATH=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib/libsycl.so:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang
export OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
export CXX=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CXX=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export PATH=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$PATH
# Note: With default options enabled, portBLAS supports complex math using
# <ext/oneapi/experimental/sycl_complex.hpp>. It was removed in DPC++ in 0b5757bf.
# To disable this -DBLAS_ENABLE_COMPLEX=OFF needs to added to cmake command line.
Expand Down
11 changes: 6 additions & 5 deletions .github/actions/build_portDNN_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ runs:
- name: Set up Environment and build portDNN
shell: bash
run: |
ls
export LD_LIBRARY_PATH=${{ inputs.workspace }}/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang
export LD_LIBRARY_PATH=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib/libsycl.so:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang
export OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
export DPCPP_INCLUDE_DIR=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/include/sycl
export PATH=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/include/sycl:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$PATH
cmake -B portDNN_build_dir portDNN -GNinja -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DSNN_BUILD_BENCHMARKS=OFF -DSNN_BENCH_SYCLBLAS=OFF -DSNN_BUILD_DOCUMENTATION=OFF
cmake -B portDNN_build_dir portDNN -GNinja -DCMAKE_CXX_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang++ -DSNN_BUILD_BENCHMARKS=OFF -DSNN_BENCH_SYCLBLAS=OFF -DSNN_BUILD_DOCUMENTATION=OFF
ninja -C portDNN_build_dir
41 changes: 41 additions & 0 deletions .github/actions/build_sycl_nbody_action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build_sycl_nbody
description: Action to clone and build sycl_nbody using oneAPI

inputs:
workspace:
description: 'Main workflow workspace'
default: ${{ github.workspace }}

runs:
# We don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: Clone sycl_nbody
shell: bash
run: git clone --recursive --depth 1 --single-branch https://github.com/codeplaysoftware/cuda-to-sycl-nbody.git

- name: Set up Environment and build
shell: bash
run: |
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib/libsycl.so:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/compiler/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:fpga
export OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so
# As the oneAPI basetoolkit release has a whitelist of devices, it filters out RefSi.
# To override it, as a temporary solution we can point SYCL_CONFIG_FILE_NAME to ``.
# This way it doesn't set the default sycl.conf.
export SYCL_CONFIG_FILE_NAME=""
export PATH=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin/icpx:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/bin:${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/lib:$PATH
export OCL_ICD_VENDORS=/dev/null
export dpct_INCLUDE_DIR=${{ inputs.workspace }}/intel/oneapi/compiler/2024.0/include
export dpct_LOCATION=${{ inputs.workspace }}/intel/oneapi/2024.0/
export CXX=icpx
export CC=icpx
cmake cuda-to-sycl-nbody -GNinja -B sycl_nbody_build -DRENDER=off -DGLEW_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLEW.so -DBACKEND=DPCPP -DDPCPP_CUDA_SUPPORT=off
ninja -C sycl_nbody_build
#CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/build/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:fpga SYCL_CONFIG_FILE_NAME= cuda-to-sycl-nbody/nbody_dpcpp 1
15 changes: 8 additions & 7 deletions .github/actions/build_vgg_resnet_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ runs:
shell: bash
run: git clone --recursive --depth 1 --single-branch https://github.com/codeplaysoftware/portDNN.git

- name: Download Daily Release
- name: Get Intel OneAPI BaseToolkit
shell: bash
run: |
wget "https://github.com/intel/llvm/releases/download/nightly-2023-12-18/sycl_linux.tar.gz"
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/163da6e4-56eb-4948-aba3-debcec61c064/l_BaseKit_p_2024.0.1.46.sh
export TERMINFO=/usr/lib/terminfo
sh $(pwd)/l_BaseKit_p_2024.0.1.46.sh -a --silent --eula accept --action install --components 'intel.oneapi.lin.dpcpp-cpp-compiler':'intel.oneapi.lin.dpcpp-ct'
mv /home/runner/intel $(pwd)
- name: Download Image for testing
shell: bash
Expand All @@ -42,9 +43,9 @@ runs:
- name: Set up environment and build networks
shell: bash
run: |
export LD_LIBRARY_PATH=${{ inputs.workspace }}/ock_install_dir/lib:${{ inputs.workspace }}/linux_nightly_release/lib/libsycl.so:${{ inputs.workspace }}/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang
export LD_LIBRARY_PATH=${{ inputs.workspace }}/ock_install_dir/lib:$(pwd)/intel/oneapi/compiler/2024.0/lib/libsycl.so:$(pwd)/intel/oneapi/compiler/2024.0/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export CMAKE_C_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:fpga
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/run_ock_demo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Build, Run and Test OCK Demo EcoSystem
name: Build and Run OCK Demo
on:
pull_request:
paths:
- '.github/workflows/run_ock_demo.yml'
schedule:
- cron: '59 23 * * 5' # Run every Friday at 11:59 PM
# Allows you to run this workflow manually from the Actions tab
Expand Down Expand Up @@ -49,20 +52,19 @@ jobs:
run: |
ninja -C $(pwd)/build install
- name: Download Daily Release
- name: Get Intel OneAPI BaseToolkit
run: |
# Update the nightly release from intel/llvm from 2024-01-30 to daily once
# everything has stablised
wget "https://github.com/intel/llvm/releases/download/nightly-2024-01-30/sycl_linux.tar.gz"
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/163da6e4-56eb-4948-aba3-debcec61c064/l_BaseKit_p_2024.0.1.46.sh
export TERMINFO=/usr/lib/terminfo
sh $(pwd)/l_BaseKit_p_2024.0.1.46.sh -a --silent --eula accept --action install --components 'intel.oneapi.lin.dpcpp-cpp-compiler':'intel.oneapi.lin.dpcpp-ct'
mv /home/runner/intel $(pwd)
- name: Test RSICV examples
run: |
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/linux_nightly_release/lib/libsycl.so:$(pwd)/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/intel/oneapi/compiler/2024.0/lib/libsycl.so:$(pwd)/intel/oneapi/compiler/2024.0/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export CMAKE_C_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:fpga
Expand All @@ -73,14 +75,19 @@ jobs:
export SYCL_CONFIG_FILE_NAME=""
mkdir ock_example_tests
cmake -GNinja -Bock_example_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/linux_nightly_release/include/sycl $(pwd)/examples/applications
cmake -GNinja -Bock_example_tests -DCMAKE_CXX_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang++ -DCMAKE_C_COMPILER=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/intel/oneapi/compiler/2024.0/include/sycl $(pwd)/examples/applications
ninja -C ock_example_tests
# Run tests
cd ock_example_tests
ctest bin/ --verbose
cd ..
- name: Build sycl_nbody
uses: ./.github/actions/build_sycl_nbody_action
with:
workspace: ${{ github.workspace }}

- name: Build portBLAS
uses: ./.github/actions/build_portBLAS_action
with:
Expand All @@ -94,7 +101,7 @@ jobs:
- name: Package Build Artifacts
run: |
mv install ock_install_dir
tar -cvzf ock_demo_artifacts.tar.gz ock_install_dir portDNN_build_dir portBLAS_build_dir ock_example_tests examples/technical_blogs/ock_demo_blog/getting_started.md examples/technical_blogs/ock_demo_blog/envvars
tar -cvzf ock_demo_artifacts.tar.gz ock_install_dir sycl_nbody_build portDNN_build_dir portBLAS_build_dir ock_example_tests examples/technical_blogs/ock_demo_blog/getting_started.md examples/technical_blogs/ock_demo_blog/envvars
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 3c0abb4

Please sign in to comment.