From a341c5019b9543c0199ff132818ee04b8a4b4342 Mon Sep 17 00:00:00 2001 From: Rafal Rudnicki Date: Wed, 29 Jan 2025 12:16:45 +0000 Subject: [PATCH] todo --- .github/workflows/pr_push.yml | 78 +---------- .github/workflows/reusable_compatibility.yml | 131 +++++++++++++++++++ src/memory_pool.c | 6 +- src/memory_provider.c | 6 +- src/memtarget.c | 7 +- 5 files changed, 154 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/reusable_compatibility.yml diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index 9623b69f1..d250c16cf 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -16,75 +16,11 @@ permissions: contents: read jobs: - CodeChecks: - uses: ./.github/workflows/reusable_checks.yml - DocsBuild: - uses: ./.github/workflows/reusable_docs_build.yml - FastBuild: - name: Fast builds - needs: [CodeChecks, DocsBuild] - 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] - uses: ./.github/workflows/reusable_gpu.yml + Compatibility: + name: Compatibility + uses: ./.github/workflows/reusable_compatibility.yml + strategy: + matrix: + tag: ["v0.10.1"] 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: - 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 - 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 + tag: ${{ matrix.tag }} diff --git a/.github/workflows/reusable_compatibility.yml b/.github/workflows/reusable_compatibility.yml new file mode 100644 index 000000000..ba3beb1de --- /dev/null +++ b/.github/workflows/reusable_compatibility.yml @@ -0,0 +1,131 @@ +# TODO +name: Compatibility + +on: + workflow_call: + inputs: + tag: + description: Check backward compatibility with this tag + type: string + default: "0.10.1" + +permissions: + contents: read + +jobs: + ubuntu-build: + name: Ubuntu + strategy: + matrix: + # TODO other systems? + os: ['ubuntu-22.04'] + build_type: [Debug] + compiler: [{c: gcc, cxx: g++}] + shared_library: ['ON'] + level_zero_provider: ['ON'] + cuda_provider: ['ON'] + install_tbb: ['ON'] + runs-on: ${{matrix.os}} + + steps: + # NOTE: we need jemalloc for older version of UMF + - name: Install apt packages + run: | + sudo apt-get update + sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev + + - name: Install TBB apt package + if: matrix.install_tbb == 'ON' + run: | + sudo apt-get install -y libtbb-dev + + - name: Checkout "tag" UMF version + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + ref: refs/tags/${{inputs.tag}} + path: ${{github.workspace}}/tag_version + + - name: Install libhwloc + working-directory: ${{github.workspace}}/tag_version + run: .github/scripts/install_hwloc.sh + + - name: Get "tag" UMF version + working-directory: ${{github.workspace}}/tag_version + run: | + VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+') + echo "tag version: $VERSION" + + - name: Configure "tag" UMF build + working-directory: ${{github.workspace}}/tag_version + run: > + cmake + -B ${{github.workspace}}/tag_version/build + -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/tag_version/build/install" + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} + -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}} + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}} + -DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}} + -DUMF_FORMAT_CODE_STYLE=OFF + -DUMF_DEVELOPER_MODE=ON + -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON + -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + + - name: Build "tag" UMF + working-directory: ${{github.workspace}}/tag_version + run: | + cmake --build ${{github.workspace}}/tag_version/build -j $(nproc) + + # NOTE: we need jemalloc for older version of UMF + # if: startsWith(github.event.inputs.tag, '0.10.') || startsWith(github.event.inputs.tag, '0.9.') + - name: Set ptrace value for IPC test + run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope" + + - name: Run "tag" UMF tests + working-directory: ${{github.workspace}}/tag_version/build + run: | + LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure + + - name: Checkout latest UMF version + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + path: ${{github.workspace}}/latest_version + + - name: Get latest UMF version + working-directory: ${{github.workspace}}/latest_version + run: | + VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+') + echo "checked version: $VERSION" + + - name: Configure latest UMF build + working-directory: ${{github.workspace}}/latest_version + run: > + cmake + -B ${{github.workspace}}/latest_version/build + -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/latest_version/build/install" + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} + -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}} + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}} + -DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}} + -DUMF_FORMAT_CODE_STYLE=OFF + -DUMF_DEVELOPER_MODE=ON + -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON + -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + + - name: Build latest UMF + working-directory: ${{github.workspace}}/latest_version + run: | + cmake --build ${{github.workspace}}/latest_version/build -j $(nproc) + + - name: Run "tag" UMF tests with latest UMF libs + working-directory: ${{github.workspace}}/tag_version/build + run: | + LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/ ctest --output-on-failure + \ No newline at end of file diff --git a/src/memory_pool.c b/src/memory_pool.c index e739f3f2f..cf306b885 100644 --- a/src/memory_pool.c +++ b/src/memory_pool.c @@ -38,7 +38,11 @@ static umf_result_t umfPoolCreateInternal(const umf_memory_pool_ops_t *ops, return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY; } - assert(ops->version == UMF_VERSION_CURRENT); + if (ops->version == UMF_VERSION_CURRENT) { + LOG_INFO("WARNING: memory pool ops version %d is different than " + "current version %d", + ops->version, UMF_VERSION_CURRENT); + } if (!(flags & UMF_POOL_CREATE_FLAG_DISABLE_TRACKING)) { // Wrap provider with memory tracking provider. diff --git a/src/memory_provider.c b/src/memory_provider.c index 59f3f1259..2428c6f74 100644 --- a/src/memory_provider.c +++ b/src/memory_provider.c @@ -173,7 +173,11 @@ umf_result_t umfMemoryProviderCreate(const umf_memory_provider_ops_t *ops, return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY; } - assert(ops->version == UMF_VERSION_CURRENT); + if (ops->version == UMF_VERSION_CURRENT) { + LOG_INFO("WARNING: memory provider ops version %d is different than " + "current version %d", + ops->version, UMF_VERSION_CURRENT); + } provider->ops = *ops; diff --git a/src/memtarget.c b/src/memtarget.c index a89708460..f4bb4ec66 100644 --- a/src/memtarget.c +++ b/src/memtarget.c @@ -15,6 +15,7 @@ #include "memtarget_internal.h" #include "memtarget_ops.h" #include "utils_concurrency.h" +#include "utils_log.h" umf_result_t umfMemtargetCreate(const umf_memtarget_ops_t *ops, void *params, umf_memtarget_handle_t *memoryTarget) { @@ -29,7 +30,11 @@ umf_result_t umfMemtargetCreate(const umf_memtarget_ops_t *ops, void *params, return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY; } - assert(ops->version == UMF_VERSION_CURRENT); + if (ops->version == UMF_VERSION_CURRENT) { + LOG_INFO("WARNING: memtarget ops version %d is different than " + "current version %d", + ops->version, UMF_VERSION_CURRENT); + } target->ops = ops;