Skip to content

[SYCL] Change USM pooling parameters. #5457

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
Feb 22, 2022
Merged
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
19 changes: 9 additions & 10 deletions sycl/plugins/level_zero/usm_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ static class SetLimits {
size_t SlabMinSize[3] = {64 * 1024, 64 * 1024, 2 * 1024 * 1024};

// Allocations up to this limit will be subject to chunking/pooling
size_t MaxPoolableSize[3] = {0, 32 * 1024, 0};
size_t MaxPoolableSize[3] = {2 * 1024 * 1024, 4 * 1024 * 1024, 0};

// When pooling, each bucket will hold a max of 4 unfreed slabs
size_t Capacity[3] = {0, 0, 0};
size_t Capacity[3] = {4, 4, 0};

// Maximum memory left unfreed in pool
size_t MaxPoolSize = 0;
size_t MaxPoolSize = 16 * 1024 * 1024;

size_t CurPoolSize = 0;
size_t CurPoolSizes[3] = {0, 0, 0};

bool EnableBuffers = false;
bool EnableBuffers = true;

// Whether to print pool usage statistics
int PoolTrace = 0;
Expand All @@ -134,17 +134,16 @@ static class SetLimits {
// pool size for all contexts.
// Duplicate specifications will result in the right-most taking effect.
//
// Current defaults are to match pre-2021.3 pooling.
// EnableBuffers: Apply chunking/pooling to SYCL buffers.
// Default 0 (false).
// Default true.
// MaxPoolSize: Limit on overall unfreed memory.
// Default 0MB.
// Default 16MB.
// MaxPoolableSize: Maximum allocation size subject to chunking/pooling.
// Default 32KB.
// Default 2MB host, 4MB device and 0 shared.
// Capacity: Maximum number of unfreed allocations in each bucket.
// Default 0.
// Default 4.
// SlabMinSize: Minimum allocation size requested from USM.
// Default 64KB.
// Default 64KB host and device, 2MB shared.
//
// Example of usage:
// SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=1;32M;host:1M,4,64K;device:1M,4,64K;shared:0,0,2M
Expand Down