Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into georgi/hip_memadvise
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeWeb committed Dec 8, 2023
2 parents c81a6e9 + e69ed21 commit 2f9314d
Show file tree
Hide file tree
Showing 280 changed files with 17,706 additions and 9,147 deletions.
87 changes: 87 additions & 0 deletions .github/scripts/get_system_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env bash

# Copyright (C) 2023 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# get_system_info.sh - Script for printing system info

function check_L0_version {
if command -v dpkg &> /dev/null; then
dpkg -l | grep level-zero && return
fi

if command -v rpm &> /dev/null; then
rpm -qa | grep level-zero && return
fi

if command -v zypper &> /dev/null; then
zypper se level-zero && return
fi

echo "level-zero not installed"
}

function system_info {
echo "**********system_info**********"
cat /etc/os-release | grep -oP "PRETTY_NAME=\K.*"
cat /proc/version
echo "**********SYCL-LS**********"
source /opt/intel/oneapi/setvars.sh
sycl-ls
echo "**********VGA**********"
lspci | grep VGA
echo "**********CUDA Version**********"
if command -v nvidia-smi &> /dev/null; then
nvidia-smi
else
echo "CUDA not installed"
fi
echo "**********L0 Version**********"
check_L0_version
echo "**********ROCm Version**********"
if command -v rocminfo &> /dev/null; then
rocminfo
else
echo "ROCm not installed"
fi
echo "**********/proc/cmdline**********"
cat /proc/cmdline
echo "**********CPU info**********"
lscpu
echo "**********/proc/meminfo**********"
cat /proc/meminfo
echo "**********build/bin/urinfo**********"
$(dirname "$(readlink -f "$0")")/../../build/bin/urinfo || true
echo "******OpenCL*******"
# The driver version of OpenCL Graphics is the compute-runtime version
clinfo || echo "OpenCL not installed"
echo "**********list-environment**********"
echo "PATH=$PATH"
echo
echo "CPATH=$CPATH"
echo
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo
echo "LIBRARY_PATH=$LIBRARY_PATH"
echo
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo
echo "******list-build-system-versions*******"
gcc --version 2>/dev/null || true
echo
clang --version 2>/dev/null || true
echo
make --version 2>/dev/null || true
echo "**********/proc/modules**********"
cat /proc/modules
echo "***************installed-packages***************"
# Instructions below will return some minor errors, as they are dependent on the Linux distribution.
zypper se --installed-only 2>/dev/null || true
apt list --installed 2>/dev/null || true
yum list installed 2>/dev/null || true
}

# Call the function above to print system info.
system_info
37 changes: 30 additions & 7 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ jobs:
strategy:
matrix:
adapter: [
{name: CUDA, triplet: nvptx64-nvidia-cuda},
{name: HIP, triplet: amdgcn-amd-amdhsa},
{name: L0, triplet: spir64}
{name: CUDA, triplet: nvptx64-nvidia-cuda, platform: ""},
{name: HIP, triplet: amdgcn-amd-amdhsa, platform: ""},
{name: L0, triplet: spir64, platform: ""},
{name: OPENCL, triplet: spir64, platform: "Intel(R) OpenCL"}
]
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
Expand Down Expand Up @@ -219,7 +220,11 @@ jobs:
- name: Test adapters
if: matrix.adapter.name != 'L0'
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180

- name: Get information about platform
if: ${{ always() }}
run: .github/scripts/get_system_info.sh

examples-build-hw:
name: Build - examples on HW
Expand Down Expand Up @@ -273,6 +278,10 @@ jobs:
cat ${HOME}/.profile || true
rm ${HOME}/.profile || true
- name: Get information about platform
if: ${{ always() }}
run: .github/scripts/get_system_info.sh

windows-build:
name: Build - Windows
strategy:
Expand All @@ -282,12 +291,18 @@ jobs:
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
]

# TODO: building level zero loader on windows-2019 is currently broken
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
exclude:
- os: 'windows-2019'
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
compiler: {c: clang-cl, cxx: clang-cl}

build_type: [Debug, Release]
compiler: [{c: cl.exe, cxx: cl.exe}, {c: clang-cl.exe, cxx: clang-cl.exe}]
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
include:
- compiler: {c: clang-cl, cxx: clang-cl}
toolset: "-T ClangCL"
runs-on: ${{matrix.os}}

steps:
Expand All @@ -300,10 +315,18 @@ jobs:
- name: Install prerequisites
run: python3 -m pip install -r third_party/requirements.txt

- name: Install doxygen
run: |
$WorkingDir = $PWD.Path
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip"
Expand-Archive -Path "$WorkingDir\doxygen.zip"
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
- name: Configure CMake
run: >
cmake
-B${{github.workspace}}/build
${{matrix.toolset}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
Expand All @@ -319,7 +342,7 @@ jobs:
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}

- name: Build all
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 2
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS

- name: Test
working-directory: ${{github.workspace}}/build
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Coverage

on: [push, pull_request]

jobs:
ubuntu-build:
name: Build - Ubuntu
strategy:
matrix:
os: ['ubuntu-22.04']
build_type: [Debug]
compiler: [{c: gcc, cxx: g++}]
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON']
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON']

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
- name: Install pip packages
run: pip install -r third_party/requirements.txt

- name: Install libbacktrace
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
cd libbacktrace
./configure
make
sudo make install
cd ..
- name: Download DPC++
run: |
sudo apt install libncurses5
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
- name: Configure CMake
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=ON
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
-DCMAKE_CXX_FLAGS="--coverage -fkeep-inline-functions -fkeep-static-functions"
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"
${{matrix.libbacktrace}}
${{matrix.pool_tracking}}
- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc)

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"

- name: Quick Coverage Info
working-directory: ${{github.workspace}}/build
run: ctest -T Coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
gcov: true
gcov_include: source
118 changes: 118 additions & 0 deletions .github/workflows/e2e_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: E2E Nightly

on:
schedule:
# Run every day at 23:00 UTC
- cron: '0 23 * * *'

jobs:
e2e-build-hw:
name: Build SYCL, UR, run E2E
strategy:
matrix:
adapter: [
{name: CUDA}
]
build_type: [Release]
compiler: [{c: clang, cxx: clang++}]

runs-on: ${{matrix.adapter.name}}

steps:
# Workspace on self-hosted runners is not cleaned automatically.
# We have to delete the files created outside of using actions.
- name: Cleanup self-hosted workspace
if: always()
run: |
ls -la ./
rm -rf ./* || true
- name: Checkout UR
uses: actions/checkout@v4
with:
path: ur-repo

- name: Checkout SYCL
uses: actions/checkout@v4
with:
repository: intel/llvm
ref: sycl
path: sycl-repo

- name: Install pip packages
working-directory: ${{github.workspace}}/ur-repo
run: pip install -r third_party/requirements.txt

- name: Configure CMake UR
working-directory: ${{github.workspace}}/ur-repo
run: >
cmake
-B build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
- name: Build UR
run: LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)

- name: Set env vars & pre setup
run: |
echo "SYCL_PREFER_UR=1" >> $GITHUB_ENV
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
source /opt/intel/oneapi/setvars.sh
sycl-ls
- name: Configure SYCL
run: >
python3 sycl-repo/buildbot/configure.py
-t ${{matrix.build_type}}
-o ${{github.workspace}}/sycl_build
--cmake-gen "Unix Makefiles"
--ci-defaults --cuda --hip
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
--cmake-opt="-DSYCL_PI_TESTS=OFF"
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build SYCL
run: cmake --build ${{github.workspace}}/sycl_build

- name: Run check-sycl
# Remove after fixing SYCL test :: abi/layout_handler.cpp
# This issue does not affect further execution of e2e with UR.
continue-on-error: true
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl

- name: Swap UR loader and adapters
run: |
cp ${{github.workspace}}/ur-repo/build/lib/libur_loader.so* ${{github.workspace}}/sycl_build/lib/
cp ${{github.workspace}}/ur-repo/build/lib/libur_adapter_cuda.so* ${{github.workspace}}/sycl_build/lib/
- name: Set additional env. vars
run: |
echo "${{github.workspace}}/sycl_build/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${{github.workspace}}/sycl_build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
# Running (newly built) sycl-ls sets up some extra variables
- name: Setup SYCL variables
run: |
which clang++ sycl-ls
SYCL_PI_TRACE=-1 sycl-ls
- name: Build e2e tests
run: >
cmake
-GNinja
-B ${{github.workspace}}/build-e2e/
-S ${{github.workspace}}/sycl-repo/sycl/test-e2e/
-DSYCL_TEST_E2E_TARGETS="ext_oneapi_cuda:gpu"
-DCMAKE_CXX_COMPILER="$(which clang++)"
-DLLVM_LIT="${{github.workspace}}/sycl-repo/llvm/utils/lit/lit.py"
- name: Run e2e tests
run: ninja -C build-e2e check-sycl-e2e
Loading

0 comments on commit 2f9314d

Please sign in to comment.