Skip to content

Commit

Permalink
Update the ock_demo workflow to use separate jobs and artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryaSharf committed Feb 23, 2024
1 parent f728550 commit 5c50143
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 54 deletions.
36 changes: 30 additions & 6 deletions .github/actions/build_portBLAS_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,41 @@ runs:
shell: bash
run: git clone --recursive https://github.com/codeplaysoftware/portBLAS

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup ubuntu
uses: ./.github/actions/setup_ubuntu_build

- name: Get Intel OneAPI BaseToolkit
shell: bash
run: |
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: 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=$(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 OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
export CXX=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CXX=$(pwd)/intel/oneapi/compiler/2024.0/bin/compiler/clang++
export PATH=$(pwd)/intel/oneapi/compiler/2024.0/bin:$(pwd)/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.
cmake -B portBLAS_build_dir portBLAS -GNinja -DSYCL_COMPILER=dpcpp -DBLAS_ENABLE_COMPLEX=OFF
ninja -C $(pwd)/portBLAS_build_dir
ninja -C $(pwd)/portBLAS_build_dir
- name: Package artifacts
shell: bash
run: |
tar -cvzf portBLAS_build.tar.gz portBLAS_build_dir
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: portBLAS_build
path: portBLAS_build.tar.gz
58 changes: 51 additions & 7 deletions .github/actions/build_portDNN_action/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-portDNN
name: build_portDNN
description: Action to clone and build portDNN using oneAPI

inputs:
Expand All @@ -14,14 +14,58 @@ runs:
shell: bash
run: git clone --recursive https://github.com/codeplaysoftware/portDNN.git

- name: Install prerequisites
shell: bash
run: |
sudo apt-get install -y spirv-tools
- name: Install Ninja
uses: llvm/actions/install-ninja@main

- name: Get Intel OneAPI BaseToolkit
shell: bash
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-02-12/sycl_linux.tar.gz"
# mkdir linux_nightly_release
# tar -xzf sycl_linux.tar.gz -C linux_nightly_release
df .
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/bb99984f-370f-413d-bbec-38928d2458f2/l_dpcpp-cpp-compiler_p_2024.0.2.29.sh
export TERMINFO=/usr/lib/terminfo
sh $(pwd)/l_dpcpp-cpp-compiler_p_2024.0.2.29.sh -a --silent --eula accept
du -h /home/runner/intel/oneapi
mv /home/runner/intel $(pwd)
df .
- 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 }}/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 OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
# 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 -DSNN_BUILD_TESTS=OFF
# ninja -C portDNN_build_dir
export LD_LIBRARY_PATH=:$(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 OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
export DPCPP_INCLUDE_DIR=$(pwd)/intel/oneapi/compiler/2024.0/include/sycl
export PATH=$(pwd)/intel/oneapi/compiler/2024.0/include/sycl:$(pwd)/intel/oneapi/compiler/2024.0/bin:$(pwd)/intel/oneapi/compiler/2024.0/lib:$PATH
cmake -B portDNN_build_dir portDNN -GNinja -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DSNN_BUILD_BENCHMARKS=OFF -DSNN_BENCH_SYCLBLAS=OFF -DSNN_BUILD_DOCUMENTATION=OFF -DSNN_BUILD_TESTS=OFF
ninja -C portDNN_build_dir
- name: Package artifacts
shell: bash
run: |
tar -cvzf portDNN_build.tar.gz portDNN_build_dir
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
ninja -C portDNN_build_dir
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: portDNN_build
path: portDNN_build.tar.gz
64 changes: 64 additions & 0 deletions .github/actions/build_sycl_nbody_action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup ubuntu
uses: ./.github/actions/setup_ubuntu_build

- name: Get Intel OneAPI BaseToolkit
shell: bash
run: |
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: Set up Environment and build
shell: bash
run: |
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(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
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=$(pwd)/intel/oneapi/compiler/2024.0/bin/icpx:$(pwd)/intel/oneapi/compiler/2024.0/bin:$(pwd)/intel/oneapi/compiler/2024.0/lib:$PATH
export OCL_ICD_VENDORS=/dev/null
export dpct_INCLUDE_DIR=$(pwd)/intel/oneapi/compiler/2024.0/include
export dpct_LOCATION=$(pwd)/intel/oneapi/2024.0/
export CXX=icpx
export CC=icpx
cmake cuda-to-sycl-nbody -GNinja -B sycl_nbody_build_dir -DRENDER=off -DGLEW_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLEW.so -DBACKEND=DPCPP -DDPCPP_CUDA_SUPPORT=off
ninja -C sycl_nbody_build_dir
#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
- name: Package artifacts
shell: bash
run: |
tar -cvzf sycl_nbody_build.tar.gz sycl_nbody_build_dir
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sycl_nbody_build
path: sycl_nbody_build.tar.gz
22 changes: 13 additions & 9 deletions .github/actions/build_vgg_resnet_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ 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-2024-02-08/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/bb99984f-370f-413d-bbec-38928d2458f2/l_dpcpp-cpp-compiler_p_2024.0.2.29.sh
export TERMINFO=/usr/lib/terminfo
sh $(pwd)/l_dpcpp-cpp-compiler_p_2024.0.2.29.sh -a --silent --eula accept --action install
du -h /home/runner/intel/oneapi
mv /home/runner/intel $(pwd)
- name: Download Image for testing
shell: bash
Expand All @@ -42,9 +44,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 All @@ -55,6 +57,8 @@ runs:
export SYCL_CONFIG_FILE_NAME=""
export portDNN_source=$(pwd)/portDNN
export OCL_ICD_VENDORS=/dev/null
export CXX=icpx
export CC=icpx
# VGG16
mkdir vdata
Expand All @@ -76,9 +80,9 @@ runs:
python $portDNN_source/samples/networks/img2bin.py $(pwd)/Labrador_Retriever_Molly.jpg
# Testing on image for VGG16
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/ock_install_dir/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:fpga SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/vgg/vgg vdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${OCL_ICD_FILENAMES} ONEAPI_DEVICE_SELECTOR=opencl:fpga SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/vgg/vgg vdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
# Testing on image for Resnet50
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/ock_install_dir/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:fpga SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/resnet50/resnet50 rdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${OCL_ICD_FILENAMES} ONEAPI_DEVICE_SELECTOR=opencl:fpga SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/resnet50/resnet50 rdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
- name: Package artifacts
shell: bash
Expand Down
Loading

0 comments on commit 5c50143

Please sign in to comment.