Skip to content
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
60 changes: 60 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,66 @@ jobs:
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

Windows-NMake:
name: Windows-NMake
env:
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
BUILD_DIR : "${{github.workspace}}/build"
strategy:
matrix:
os: ['windows-2019', 'windows-2022']
build_type: [Debug, Release]
compiler: [{c: cl, cxx: cl}]
shared_library: ['ON', 'OFF']

runs-on: ${{matrix.os}}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

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

- name: Install dependencies
run: vcpkg install

- name: Configure MSVC environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-G "NMake Makefiles"
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_LINK_HWLOC_STATICALLY=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON

- name: Build UMF
shell: cmd
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%

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


icx:
name: ICX
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/reusable_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: intel/llvm
ref: nightly-2025-02-19
# add preloaded UMF benchmarks
# https://github.com/intel/llvm/pull/17278
ref: b2f9dab5266d227cc9eb19af1b54c5bdc50221d1
path: sycl-repo
fetch-depth: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_dax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
INSTL_DIR : "${{github.workspace}}/../install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-dax"
DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory"
DAX_TESTS: "./test/test_provider_file_memory ./test/test_provider_devdax_memory"

jobs:
dax:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reusable_multi_numa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
BUILD_DIR : "${{github.workspace}}/build"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-multinuma"
NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes"
NUMA_TESTS: "./test/test_memspace_numa ./test/test_provider_os_memory_multiple_numa_nodes"

jobs:
multi_numa:
Expand Down Expand Up @@ -60,13 +60,13 @@ jobs:
# On RHEL, hwloc version is just a little too low.
# Skip some tests until we upgrade hwloc and update CMake to properly handle local hwloc installation.
# TODO: fix issue #560
# TODO: add issue for -E umf-init_teardown - it is not clear why it fails
# TODO: add issue for -E test_init_teardown - it is not clear why it fails
- name: Run tests (on RHEL)
if: matrix.os == 'rhel-9.1'
working-directory: ${{github.workspace}}/build
run: |
ctest --output-on-failure --test-dir test -E "umf-provider_os_memory_multiple_numa_nodes|umf-init_teardown"
./test/umf_test-provider_os_memory_multiple_numa_nodes \
ctest --output-on-failure --test-dir test -E "test_provider_os_memory_multiple_numa_nodes|test_init_teardown"
./test/test_provider_os_memory_multiple_numa_nodes \
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"

- name: Run NUMA tests under valgrind
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_proxy_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
working-directory: ${{env.BUILD_DIR}}
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure

- name: Run "./test/umf_test-memoryPool" with proxy library
- name: Run "./test/test_memoryPool" with proxy library
working-directory: ${{env.BUILD_DIR}}
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/test_memoryPool

- name: Run "/usr/bin/ls" with proxy library
working-directory: ${{env.BUILD_DIR}}
Expand Down
79 changes: 76 additions & 3 deletions benchmark/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
pool_allocator<disjoint_pool<os_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, disjoint_pool_uniform)
->Apply(&default_multiple_alloc_uniform_size)
->Apply(&singlethreaded);
// TODO: change to multithreaded
//->Apply(&multithreaded);
->Apply(&multithreaded);

#ifdef UMF_POOL_JEMALLOC_ENABLED
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, jemalloc_pool_fix,
Expand Down Expand Up @@ -136,6 +134,81 @@ UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, scalable_pool_uniform)

#endif

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
proxy_pool_fixedprovider, fixed_alloc_size,
pool_allocator<proxy_pool<fixed_provider>>);

UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
proxy_pool_fixedprovider)
->Apply(&default_multiple_alloc_fix_size)
->Apply(&singlethreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, fixed_provider,
fixed_alloc_size,
provider_allocator<fixed_provider>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, fixed_provider)
->Apply(&default_multiple_alloc_fix_size)
->Apply(&singlethreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
disjoint_pool_fix_fixedprovider, fixed_alloc_size,
pool_allocator<disjoint_pool<fixed_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
disjoint_pool_fix_fixedprovider)
->Apply(&default_multiple_alloc_fix_size)
->Apply(&multithreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
disjoint_pool_uniform_fixedprovider,
uniform_alloc_size,
pool_allocator<disjoint_pool<fixed_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
disjoint_pool_uniform_fixedprovider)
->Apply(&default_multiple_alloc_uniform_size)
->Apply(&singlethreaded);
// TODO: change to multithreaded
//->Apply(&multithreaded);

#ifdef UMF_POOL_JEMALLOC_ENABLED
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
jemalloc_pool_fixedprovider, fixed_alloc_size,
pool_allocator<jemalloc_pool<fixed_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, jemalloc_pool_fix)
->Apply(&default_multiple_alloc_fix_size)
->Apply(&multithreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
jemalloc_pool_uniform_fixedprovider,
uniform_alloc_size,
pool_allocator<jemalloc_pool<fixed_provider>>);
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, jemalloc_pool_uniform)
->Apply(&default_multiple_alloc_uniform_size)
->Apply(&multithreaded);

#endif

#ifdef UMF_POOL_SCALABLE_ENABLED
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
scalable_pool_fix_fixedprovider, fixed_alloc_size,
pool_allocator<scalable_pool<fixed_provider>>);

UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
scalable_pool_fix_fixedprovider)
->Apply(&default_multiple_alloc_fix_size)
->Apply(&multithreaded);

UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
scalable_pool_uniform_fixedprovider,
uniform_alloc_size,
pool_allocator<scalable_pool<fixed_provider>>);

UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
scalable_pool_uniform_fixedprovider)
->Apply(&default_multiple_alloc_uniform_size)
->Apply(&multithreaded);

#endif

//BENCHMARK_MAIN();
int main(int argc, char **argv) {
if (initAffinityMask()) {
Expand Down
61 changes: 60 additions & 1 deletion benchmark/benchmark_umf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifdef UMF_POOL_SCALABLE_ENABLED
#include <umf/pools/pool_scalable.h>
#endif
#include <umf/providers/provider_fixed_memory.h>
#include <umf/providers/provider_os_memory.h>

#ifdef UMF_POOL_JEMALLOC_ENABLED
Expand Down Expand Up @@ -145,7 +146,9 @@ struct os_provider : public provider_interface {
umfOsMemoryProviderParamsDestroy(handle);
};

return {static_cast<void *>(raw_params), deleter};
return {static_cast<provider_interface::params_ptr::element_type *>(
raw_params),
deleter};
}

umf_memory_provider_ops_t *
Expand All @@ -155,6 +158,62 @@ struct os_provider : public provider_interface {
static std::string name() { return "os_provider"; }
};

struct fixed_provider : public provider_interface {
private:
char *mem = NULL;
const size_t size = 1024 * 1024 * 1024; // 1GB
public:
virtual void SetUp(::benchmark::State &state) override {
if (state.thread_index() != 0) {
return;
}

if (!mem) {
mem = new char[size];
}

provider_interface::SetUp(state);
}

virtual void TearDown(::benchmark::State &state) override {
if (state.thread_index() != 0) {
return;
}

delete[] mem;
mem = nullptr;

provider_interface::TearDown(state);
}

provider_interface::params_ptr
getParams(::benchmark::State &state) override {
umf_fixed_memory_provider_params_handle_t raw_params = nullptr;
umfFixedMemoryProviderParamsCreate(&raw_params, mem, size);
if (!raw_params) {
state.SkipWithError("Failed to create fixed provider params");
return {nullptr, [](void *) {}};
}

// Use a lambda as the custom deleter
auto deleter = [](void *p) {
auto handle =
static_cast<umf_fixed_memory_provider_params_handle_t>(p);
umfFixedMemoryProviderParamsDestroy(handle);
};

return {static_cast<provider_interface::params_ptr::element_type *>(
raw_params),
deleter};
}

umf_memory_provider_ops_t *
getOps([[maybe_unused]] ::benchmark::State &state) override {
return umfFixedMemoryProviderOps();
}
static std::string name() { return "fixed_provider"; }
};

template <typename Provider>
struct proxy_pool : public pool_interface<Provider> {
umf_memory_pool_ops_t *
Expand Down
Loading
Loading