Skip to content
Draft
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
133 changes: 68 additions & 65 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,87 +17,90 @@ permissions:
packages: read

jobs:
CodeChecks:
uses: ./.github/workflows/reusable_checks.yml
FastBuild:
name: Fast builds
needs: [CodeChecks]
uses: ./.github/workflows/reusable_fast.yml
Build:
name: Basic builds
needs: [FastBuild]
uses: ./.github/workflows/reusable_basic.yml
DevDax:
needs: [FastBuild]
uses: ./.github/workflows/reusable_dax.yml
MultiNuma:
needs: [FastBuild]
uses: ./.github/workflows/reusable_multi_numa.yml
# CodeChecks:
# uses: ./.github/workflows/reusable_checks.yml
# FastBuild:
# name: Fast builds
# needs: [CodeChecks]
# uses: ./.github/workflows/reusable_fast.yml
# Build:
# name: Basic builds
# needs: [FastBuild]
# uses: ./.github/workflows/reusable_basic.yml
# DevDax:
# needs: [FastBuild]
# uses: ./.github/workflows/reusable_dax.yml
# MultiNuma:
# needs: [FastBuild]
# uses: ./.github/workflows/reusable_multi_numa.yml
L0:
needs: [Build]
# needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
provider: "LEVEL_ZERO"
runner: "L0"
shared_lib: "['ON']"
secrets: inherit
L0-BMG:
needs: [Build]
# needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
provider: "LEVEL_ZERO"
runner: "L0-BMG"
shared_lib: "['ON']"
secrets: inherit
CUDA:
needs: [Build]
# needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
provider: "CUDA"
runner: "CUDA"
shared_lib: "['ON']"
Sanitizers:
needs: [FastBuild]
uses: ./.github/workflows/reusable_sanitizers.yml
QEMU:
needs: [FastBuild]
uses: ./.github/workflows/reusable_qemu.yml
with:
short_run: true
ProxyLib:
needs: [Build]
uses: ./.github/workflows/reusable_proxy_lib.yml
Valgrind:
needs: [Build]
uses: ./.github/workflows/reusable_valgrind.yml
Coverage:
# total coverage (on upstream only)
if: github.repository == 'oneapi-src/unified-memory-framework'
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]
uses: ./.github/workflows/reusable_coverage.yml
CodeQL:
needs: [Build]
permissions:
contents: read
security-events: write
uses: ./.github/workflows/reusable_codeql.yml
Trivy:
needs: [Build]
permissions:
contents: read
security-events: write
uses: ./.github/workflows/reusable_trivy.yml
Compatibility:
needs: [Build]
uses: ./.github/workflows/reusable_compatibility.yml
strategy:
matrix:
tag: ["v1.0.1"]
with:
tag: ${{matrix.tag}}
# Sanitizers:
# needs: [FastBuild]
# uses: ./.github/workflows/reusable_sanitizers.yml
# QEMU:
# needs: [FastBuild]
# uses: ./.github/workflows/reusable_qemu.yml
# with:
# short_run: true
# ProxyLib:
# needs: [Build]
# uses: ./.github/workflows/reusable_proxy_lib.yml
# Valgrind:
# needs: [Build]
# uses: ./.github/workflows/reusable_valgrind.yml
# Coverage:
# # total coverage (on upstream only)
# if: github.repository == 'oneapi-src/unified-memory-framework'
# 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]
# uses: ./.github/workflows/reusable_coverage.yml
# CodeQL:
# needs: [Build]
# permissions:
# contents: read
# security-events: write
# uses: ./.github/workflows/reusable_codeql.yml
# Trivy:
# needs: [Build]
# permissions:
# contents: read
# security-events: write
# uses: ./.github/workflows/reusable_trivy.yml
# Compatibility:
# needs: [Build]
# uses: ./.github/workflows/reusable_compatibility.yml
# strategy:
# matrix:
# tag: ["v1.0.1"]
# with:
# tag: ${{matrix.tag}}
200 changes: 21 additions & 179 deletions .github/workflows/reusable_gpu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# This workflow builds and tests providers using GPU memory. It requires properly
# labelled self-hosted runners on systems with the correct GPU and drivers.
#
# It starts jobs for both Windows and Linux runners - it's only a thin wrapper for
# the OS-specific workflows. It's better to call them twice here, instead of
# duplicating two workflow calls in the PR/push workflow, for each tested device.
#
name: GPU

on:
Expand All @@ -13,10 +18,6 @@
description: Runner name (without 'DSS-' prefix)
type: string
required: true
os:
description: A list of OSes
type: string
default: "['Ubuntu', 'Windows']"
shared_lib:
description: A list of options for building shared library
type: string
Expand All @@ -25,181 +26,22 @@
permissions:
contents: read

env:
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"

jobs:
gpu:
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-${{inputs.provider}}-${{inputs.runner}}"
win:
# run only on upstream; forks will not have the HW
# if: github.repository == 'oneapi-src/unified-memory-framework'
if: false
uses: ./.github/workflows/reusable_gpu_win.yml
with:
provider: ${{ inputs.provider }}
runner: ${{ inputs.runner }}
shared_lib: ${{ inputs.shared_lib }}
lin:
# 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: ${{ fromJSON(inputs.shared_lib)}}
os: ${{ fromJSON(inputs.os)}}
name: GPU (${{matrix.os}}, shared=${{matrix.shared_library}})
runs-on: ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]

steps:
# Set various build params based on OS
- name: "[Win] Establish build params"
if : ${{ matrix.os == 'Windows' }}
run: |
echo "C_COMPILER=cl" >> $env:GITHUB_ENV
echo "CXX_COMPILER=cl" >> $env:GITHUB_ENV
echo "PROCS=$Env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV
echo "EXTRA_CMAKE_PATH=$Env:CUDA_PATH" >> $env:GITHUB_ENV

- name: "[Lin] Establish build params"
if : ${{ matrix.os == 'Ubuntu' }}
run: |
echo "C_COMPILER=gcc" >> $GITHUB_ENV
echo "CXX_COMPILER=g++" >> $GITHUB_ENV
echo "PROCS=$(nproc)" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

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

- name: "[Win] Restore vcpkg cache"
if: matrix.os == 'Windows'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache
with:
path: vcpkg_pkgs_cache.zip
key: vcpkg-gpu-${{inputs.runner}}-windows-${{ hashFiles('vcpkg.json') }}

- name: "[Win] Unpack vcpkg cache"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: |
Expand-Archive -Path ${{github.workspace}}/vcpkg_pkgs_cache.zip -DestinationPath ${{github.workspace}}/vcpkg -Force

- name: "[Win] Initialize vcpkg"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{github.workspace}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: "[Win] Install dependencies"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
env:
VCPKG_BINARY_SOURCES: clear
run: vcpkg install --triplet x64-windows

# note: disable all providers except the one being tested
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
- name: Configure build (Debug)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_DEBUG_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Ubuntu' && '-DUMF_USE_COVERAGE=ON' || '' }}
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}

- name: Build UMF (Debug)
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}

- name: Run tests (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest -C Debug --output-on-failure --test-dir test

- name: Run examples (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest --output-on-failure --test-dir examples -C Debug

- name: Configure build (Release)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_RELEASE_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}

- name: Build UMF (Release)
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}

- name: Run tests (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest -C Release --output-on-failure --test-dir test

- name: Run examples (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir examples -C Release

- name: Run benchmarks (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded

- name: "[Lin] Check coverage (Debug)"
if: ${{ matrix.os == 'Ubuntu' }}
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
mkdir -p ${{env.COVERAGE_DIR}}
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}

- name: "[Lin] Upload coverage"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ matrix.os == 'Ubuntu' }}
with:
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}

- name: "[Win] Prepare vcpkg cache"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
run: |
Compress-Archive -Path ${{github.workspace}}/vcpkg/packages -DestinationPath ${{github.workspace}}/vcpkg_pkgs_cache.zip -Force -CompressionLevel Fastest

- name: "[Win] Save vcpkg cache"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{github.workspace}}/vcpkg_pkgs_cache.zip
key: ${{ steps.cache.outputs.cache-primary-key }}
uses: ./.github/workflows/reusable_gpu_lin.yml

Check warning

Code scanning / zizmor

secrets unconditionally inherited by called workflow: this reusable workflow Warning

secrets unconditionally inherited by called workflow: this reusable workflow
with:
provider: ${{ inputs.provider }}
runner: ${{ inputs.runner }}
shared_lib: ${{ inputs.shared_lib }}
secrets: inherit
Loading
Loading