|
| 1 | +name: UR - Compute Benchmarks |
| 2 | + |
| 3 | +permissions: read-all |
| 4 | + |
| 5 | +# TODO: Pull request only for testing |
| 6 | +on: [ workflow_dispatch, pull_request ] |
| 7 | +jobs: |
| 8 | + offload_build: |
| 9 | + name: Compute Benchmarks with Offload Adapter |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + build_type: [Release] |
| 14 | + compiler: [{c: gcc, cxx: g++}] |
| 15 | + |
| 16 | + runs-on: [ UR_CUDA ] |
| 17 | + container: |
| 18 | + image: 'ghcr.io/intel/llvm/ubuntu2404_base' |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout LLVM |
| 22 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 23 | + with: |
| 24 | + path: dpcpp |
| 25 | + |
| 26 | + - name: Checkout benchmark scripts |
| 27 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 28 | + with: |
| 29 | + repository: intel/llvm |
| 30 | + ref: sycl |
| 31 | + path: sc |
| 32 | + sparse-checkout: | |
| 33 | + devops/scripts/Benchmarks |
| 34 | +
|
| 35 | + - name: Install Python requirements in venv |
| 36 | + run: | |
| 37 | + python -m venv .venv |
| 38 | + . .venv/bin/activate |
| 39 | + echo "$PATH" >> $GITHUB_PATH |
| 40 | + pip install -r sc/devops/scripts/benchmarks/requirements.txt |
| 41 | +
|
| 42 | + - name: Install liboffload |
| 43 | + run: sudo apt-get update -qq && sudo apt-get install --no-install-recommends -yqq liboffload-21 liboffload-21-dev |
| 44 | + |
| 45 | + - name: Configure UR |
| 46 | + # ">" is used to avoid adding "\" at the end of each line; this command is quite long |
| 47 | + run: > |
| 48 | + cmake |
| 49 | + -S dpcpp/unified-runtime |
| 50 | + -B ${{github.workspace}}/ur_build |
| 51 | + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} |
| 52 | + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} |
| 53 | + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} |
| 54 | + -DUR_ENABLE_TRACING=ON |
| 55 | + -DUR_DEVELOPER_MODE=ON |
| 56 | + -DUR_BUILD_TESTS=OFF |
| 57 | + -DUR_BUILD_ADAPTER_OFFLOAD=ON |
| 58 | + -DUR_OFFLOAD_INSTALL_DIR="/usr/lib/llvm-21" |
| 59 | + -DUR_OFFLOAD_INCLUDE_DIR="/usr/lib/llvm-21/include" |
| 60 | + -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install |
| 61 | +
|
| 62 | + - name: Build UR |
| 63 | + # This is so that device binaries can find the sycl runtime library |
| 64 | + run: cmake --install ur_build -j $(nproc) |
| 65 | + |
| 66 | + - name: Configure SYCL |
| 67 | + run: > |
| 68 | + python3 dpcpp/buildbot/configure.py |
| 69 | + -t ${{matrix.build_type}} |
| 70 | + -o ${{github.workspace}}/sycl_build |
| 71 | + --cmake-gen "Ninja" ${{matrix.adapter.sycl_config}} |
| 72 | + --cmake-opt="-DLLVM_INSTALL_UTILS=ON" |
| 73 | + --cmake-opt="-DSYCL_PI_TESTS=OFF" |
| 74 | + --cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache |
| 75 | + --cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 76 | +
|
| 77 | + - name: Build SYCL |
| 78 | + run: cmake --install ${{github.workspace}}/sycl_build -j |
| 79 | + |
| 80 | + - name: Compute core range |
| 81 | + run: | |
| 82 | + # Compute the core range for the first NUMA node; second node is for UMF jobs. |
| 83 | + # Skip the first 4 cores - the kernel is likely to schedule more work on these. |
| 84 | + CORES=$(lscpu | awk ' |
| 85 | + /NUMA node0 CPU|On-line CPU/ {line=$0} |
| 86 | + END { |
| 87 | + split(line, a, " ") |
| 88 | + split(a[4], b, ",") |
| 89 | + sub(/^0/, "4", b[1]) |
| 90 | + print b[1] |
| 91 | + }') |
| 92 | + echo "Selected core: $CORES" |
| 93 | + echo "CORES=$CORES" >> $GITHUB_ENV |
| 94 | +
|
| 95 | + ZE_AFFINITY_MASK=0 |
| 96 | + echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV |
| 97 | +
|
| 98 | + - name: Get information about platform |
| 99 | + if: ${{ always() }} |
| 100 | + run: dpcpp/unified-runtime/.github/scripts/get_system_info.sh |
0 commit comments