Skip to content

Workflows clean up (part 2) #871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,19 @@ jobs:
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat"
ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

L0:
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "LEVEL_ZERO"
CUDA:
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "CUDA"

# Full exeuction of QEMU tests
QEMU:
uses: ./.github/workflows/reusable_qemu.yml
with:
short_run: false
os: "['ubuntu-23.04', 'ubuntu-24.04']"
29 changes: 20 additions & 9 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,50 @@ jobs:
DevDax:
needs: [FastBuild]
uses: ./.github/workflows/reusable_dax.yml
MultiNuma:
needs: [FastBuild]
uses: ./.github/workflows/reusable_multi_numa.yml
L0:
needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "LEVEL_ZERO"
shared_lib: "['ON']"
CUDA:
needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "CUDA"
shared_lib: "['ON']"
Sanitizers:
needs: [FastBuild]
uses: ./.github/workflows/reusable_sanitizers.yml
Qemu:
QEMU:
needs: [FastBuild]
uses: ./.github/workflows/reusable_qemu.yml
with:
short_run: true
Benchmarks:
needs: [Build]
uses: ./.github/workflows/reusable_benchmarks.yml
ProxyLib:
needs: [Build]
uses: ./.github/workflows/reusable_proxy_lib.yml
GPU:
needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
Valgrind:
needs: [Build]
uses: ./.github/workflows/reusable_valgrind.yml
MultiNuma:
needs: [Build]
uses: ./.github/workflows/reusable_multi_numa.yml
Coverage:
# total coverage (on upstream only)
if: github.repository == 'oneapi-src/unified-memory-framework'
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
uses: ./.github/workflows/reusable_coverage.yml
secrets: inherit
with:
trigger: "${{github.event_name}}"
Coverage_partial:
# partial coverage (on forks)
if: github.repository != 'oneapi-src/unified-memory-framework'
needs: [Build, Qemu, ProxyLib]
needs: [Build, QEMU, ProxyLib]
uses: ./.github/workflows/reusable_coverage.yml
CodeQL:
needs: [Build]
Expand Down
223 changes: 51 additions & 172 deletions .github/workflows/reusable_gpu.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# This workflow builds and tests providers using GPU memory. It requires
# appropriately labelled self-hosted runners installed on systems with the
# correct GPU and drivers

# This workflow builds and tests providers using GPU memory. It requires properly
# labelled self-hosted runners on systems with the correct GPU and drivers.
name: GPU

on: [workflow_call]
on:
workflow_call:
inputs:
name:
description: Provider name
type: string
required: true
os:
description: A list of OSes
type: string
default: "['Ubuntu', 'Windows']"
build_type:
description: A list of build types
type: string
default: "['Debug', 'Release']"
shared_lib:
description: A list of options for building shared library
type: string
default: "['ON', 'OFF']"

permissions:
contents: read
Expand All @@ -15,30 +31,29 @@ env:
COVERAGE_DIR : "${{github.workspace}}/coverage"

jobs:
gpu-Level-Zero:
name: Level-Zero
gpu:
name: "${{matrix.os}}, ${{matrix.build_type}}, shared=${{matrix.shared_library}}"
env:
VCPKG_PATH: "${{github.workspace}}/../../../../vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/tbb_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/jemalloc_x64-windows"
COVERAGE_NAME : "exports-coverage-gpu-L0"
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows;"
CUDA_PATH: "C:/cuda"
COVERAGE_NAME : "exports-coverage-${{inputs.name}}"
# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'
strategy:
fail-fast: false
matrix:
shared_library: ['ON', 'OFF']
os: ['Ubuntu', 'Windows']
build_type: ['Debug', 'Release']
shared_library: ${{ fromJSON(inputs.shared_lib)}}
os: ${{ fromJSON(inputs.os)}}
build_type: ${{ fromJSON(inputs.build_type)}}
include:
- os: 'Ubuntu'
compiler: {c: gcc, cxx: g++}
number_of_processors: '$(nproc)'
- os: 'Windows'
compiler: {c: cl, cxx: cl}
number_of_processors: '$Env:NUMBER_OF_PROCESSORS'
exclude:
- os: 'Windows'
build_type: 'Debug'

runs-on: ["DSS-LEVEL_ZERO", "DSS-${{matrix.os}}"]
runs-on: ["DSS-${{inputs.name}}", "DSS-${{matrix.os}}"]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -49,33 +64,23 @@ jobs:
if: matrix.os == 'Ubuntu'
run: .github/scripts/get_system_info.sh

- name: Configure build for Win
- name: "[Win] Initialize vcpkg"
if: matrix.os == 'Windows'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: "[Win] Install dependencies"
if: matrix.os == 'Windows'
run: vcpkg install

# note: disable all providers except the one being tested
- name: Configure build
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_TESTS_FAIL_ON_SKIP=ON

- name: Configure build for Ubuntu
if: matrix.os == 'Ubuntu'
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}${{env.CUDA_PATH}}"
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
Expand All @@ -86,14 +91,14 @@ jobs:
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.name}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
${{ matrix.os == 'Ubuntu' && matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}

- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
Expand All @@ -111,7 +116,7 @@ jobs:
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded

- name: Check coverage
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
working-directory: ${{env.BUILD_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
Expand All @@ -121,133 +126,7 @@ jobs:
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
with:
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-${{matrix.build_type}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}

gpu-CUDA:
name: CUDA
env:
COVERAGE_NAME : "exports-coverage-gpu-CUDA"
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows;"
CUDA_PATH: "c:/cuda"

# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'
strategy:
matrix:
shared_library: ['ON', 'OFF']
build_type: ['Debug', 'Release']
os: ['Ubuntu', 'Windows']
include:
- os: 'Windows'
compiler: {c: cl, cxx: cl}
number_of_processors: '$Env:NUMBER_OF_PROCESSORS'
- os: 'Ubuntu'
compiler: {c: gcc, cxx: g++}
number_of_processors: '$(nproc)'
exclude:
- os: 'Windows'
build_type: 'Debug'

runs-on: ["DSS-CUDA", "DSS-${{matrix.os}}"]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Get information about platform
if: matrix.os == 'Ubuntu'
run: .github/scripts/get_system_info.sh

- name: Initialize vcpkg
if: matrix.os == 'Windows'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: Install dependencies (windows-latest)
if: matrix.os == 'Windows'
run: vcpkg install
shell: pwsh # Specifies PowerShell as the shell for running the script.

- name: Configure build for Win
if: matrix.os == 'Windows'
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}${{env.CUDA_PATH}}"
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON

- name: Configure build for Ubuntu
if: matrix.os == 'Ubuntu'
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}

- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}

- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

- name: Run examples
working-directory: ${{env.BUILD_DIR}}
run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}

- name: Run benchmarks
working-directory: ${{env.BUILD_DIR}}
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded

- name: Check coverage
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
working-directory: ${{env.BUILD_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
mkdir -p ${{env.COVERAGE_DIR}}
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
with:
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}
Loading
Loading