Skip to content

Commit

Permalink
Merge branch 'main' into remove_opencl_assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
lbushi25 authored Jun 14, 2024
2 parents 8a90ad7 + a53f89d commit 1f99873
Show file tree
Hide file tree
Showing 163 changed files with 6,294 additions and 1,565 deletions.
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: Compute Benchmarks

on:
# this workflow can by only triggered by other workflows
# for example by: e2e_cuda.yml or e2e_opencl.yml
workflow_call:
# acceptable input from adapter-specific workflows
# Can be triggered via manual "dispatch" (from workflow view in GitHub Actions tab)
workflow_dispatch:
# acceptable input for adapter-specific runs
inputs:
name:
description: Adapter name
type: string
required: true
str_name:
description: Formatted adapter name
type: string
required: true
config:
description: Params for sycl configuration
type: string
type: choice
required: true
default: 'level_zero'
options:
- level_zero
unit:
description: Test unit (cpu/gpu)
type: string
type: choice
required: true
runner_tag:
description: Tag defined for the runner
type: string
default: 'gpu'
options:
- cpu
- gpu
pr_no:
description: PR number (if 0, it'll run on the main)
type: number
required: true
trigger:
description: Type of workflow trigger
bench_script_params:
description: Parameters passed to script executing benchmark
type: string
required: true
comment:
description: Text if triggered by a comment
required: false
default: ''
sycl_config_params:
description: Extra params for SYCL configuration
type: string
required: false
default: ''

permissions:
contents: read
pull-requests: write

jobs:
e2e-build-hw:
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
# Run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-runtime'
name: Build SYCL, UR, run Compute Benchmarks
strategy:
matrix:
adapter: [
{name: "${{inputs.name}}",
str_name: "${{inputs.str_name}}",
config: "${{inputs.config}}",
{str_name: "${{inputs.str_name}}",
sycl_config: "${{inputs.sycl_config_params}}",
unit: "${{inputs.unit}}"}
]
build_type: [Release]
compiler: [{c: clang, cxx: clang++}]

runs-on: ${{inputs.runner_tag}}
runs-on: "${{inputs.str_name}}_PERF"

steps:
# Workspace on self-hosted runners is not cleaned automatically.
Expand All @@ -67,15 +67,17 @@ jobs:
- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.trigger != 'schedule' }}
if: ${{ always() && inputs.pr_no != 0 }}
with:
script: |
const adapter = '${{ matrix.adapter.name }}';
const pr_no = '${{ inputs.pr_no }}';
const adapter = '${{ matrix.adapter.str_name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const body = `Compute Benchmarks ${adapter} run: \n${url}`;
const params = '${{ inputs.bench_script_params }}';
const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
issue_number: pr_no,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
Expand All @@ -86,13 +88,12 @@ jobs:
with:
path: ur-repo

# On issue_comment trigger (for PRs) we need to fetch special ref for
# proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
# We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
- name: Fetch PR's merge commit
if: ${{ inputs.trigger != 'schedule' }}
if: ${{ inputs.pr_no != 0 }}
working-directory: ${{github.workspace}}/ur-repo
env:
PR_NO: ${{github.event.issue.number}}
PR_NO: ${{ inputs.pr_no }}
run: |
git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
git checkout origin/pr/${PR_NO}/merge
Expand All @@ -108,7 +109,7 @@ jobs:
fetch-tags: false

- name: Set CUDA env vars
if: matrix.adapter.name == 'CUDA'
if: matrix.adapter.str_name == 'cuda'
run: |
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
Expand All @@ -119,7 +120,7 @@ jobs:
-t ${{matrix.build_type}}
-o ${{github.workspace}}/sycl_build
--cmake-gen "Ninja"
--ci-defaults ${{matrix.adapter.config}}
--ci-defaults ${{matrix.adapter.sycl_config}}
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
--cmake-opt="-DSYCL_PI_TESTS=OFF"
--cmake-opt="-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF"
Expand Down Expand Up @@ -165,17 +166,13 @@ jobs:
run: |
echo "ONEAPI_DEVICE_SELECTOR=${{ matrix.adapter.str_name }}:${{ matrix.adapter.unit }}" >> $GITHUB_ENV
- name: Extract arguments from comment
id: args
run: echo "ARGS=$(echo '${{ inputs.comment }}' | sed -n 's/.*\/benchmarks-[^ ]* \(.*\)/\1/p')" >> $GITHUB_ENV

- name: Run SYCL API Overhead benchmark
id: benchmarks
run: ${{github.workspace}}/ur-repo/.github/scripts/compute_benchmarks.py ${{github.workspace}}/compute-benchmarks-build/bin/ $ARGS
run: ${{ github.workspace }}/ur-repo/.github/scripts/compute_benchmarks.py ${{ github.workspace }}/compute-benchmarks-build/bin/ ${{ inputs.bench_script_params }}

- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.trigger != 'schedule' }}
if: ${{ always() && inputs.pr_no != 0 }}
with:
script: |
let markdown = ""
Expand All @@ -185,14 +182,16 @@ jobs:
} catch(err) {
}
const adapter = '${{ matrix.adapter.name }}';
const pr_no = '${{ inputs.pr_no }}';
const adapter = '${{ matrix.adapter.str_name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const test_status = '${{ steps.benchmarks.outcome }}';
const job_status = '${{ job.status }}';
const body = `Compute Benchmarks ${adapter} run:\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
const params = '${{ inputs.bench_script_params }}';
const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
issue_number: pr_no,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/benchmarks_level_zero.yml

This file was deleted.

34 changes: 28 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ concurrency:

permissions:
contents: read
pull-requests: write

jobs:
ubuntu-build:
Expand Down Expand Up @@ -161,41 +162,60 @@ jobs:
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose

level-zero:
if: github.repository == 'oneapi-src/unified-runtime'
name: Level Zero
uses: ./.github/workflows/build-hw-reusable.yml
with:
name: L0

opencl:
if: github.repository == 'oneapi-src/unified-runtime'
name: OpenCL
uses: ./.github/workflows/build-hw-reusable.yml
with:
name: OPENCL
platform: "Intel(R) OpenCL"

cuda:
if: github.repository == 'oneapi-src/unified-runtime'
name: CUDA
uses: ./.github/workflows/build-hw-reusable.yml
with:
name: CUDA

hip:
if: github.repository == 'oneapi-src/unified-runtime'
name: HIP
uses: ./.github/workflows/build-hw-reusable.yml
with:
name: HIP

native-cpu:
if: github.repository == 'oneapi-src/unified-runtime'
name: Native CPU
uses: ./.github/workflows/build-hw-reusable.yml
with:
name: NATIVE_CPU

e2e-level-zero:
name: E2E L0
permissions:
contents: read
pull-requests: write
needs: [ubuntu-build, level-zero]
uses: ./.github/workflows/e2e_level_zero.yml

e2e-opencl:
name: E2E OpenCL
permissions:
contents: read
pull-requests: write
needs: [ubuntu-build, opencl]
uses: ./.github/workflows/e2e_opencl.yml

e2e-cuda:
name: E2E CUDA
permissions:
contents: read
pull-requests: write
needs: [ubuntu-build, cuda]
uses: ./.github/workflows/e2e_cuda.yml

windows-build:
name: Build - Windows
strategy:
Expand All @@ -211,6 +231,9 @@ jobs:
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}
# TODO: testing is flaky on windows-2022 in Release mode
- os: 'windows-2022'
build_type: Release

build_type: [Debug, Release]
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
Expand Down Expand Up @@ -262,7 +285,6 @@ jobs:
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"


macos-build:
name: Build - MacOS
strategy:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CodeQL"

on: [push, pull_request]
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Initialize CodeQL
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
with:
languages: cpp, python

Expand All @@ -38,7 +38,7 @@ jobs:
run: cmake --build ${{github.workspace}}/build -j $(nproc)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7

analyze-windows:
name: Analyze on Windows
Expand All @@ -54,7 +54,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Initialize CodeQL
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
with:
languages: cpp, python

Expand All @@ -68,4 +68,4 @@ jobs:
run: cmake --build ${{github.workspace}}/build -j $(nproc) --config Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
Loading

0 comments on commit 1f99873

Please sign in to comment.