From 24974a488c9ef98f0551d6fbacb197a8f7e33b76 Mon Sep 17 00:00:00 2001 From: Lizonghang <870644199@qq.com> Date: Tue, 11 Feb 2025 11:06:33 +0400 Subject: [PATCH] assume 10% of active pages can be compressed on macOS UMA --- common/profiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/profiler.cpp b/common/profiler.cpp index 96a1c701..550092b8 100644 --- a/common/profiler.cpp +++ b/common/profiler.cpp @@ -521,9 +521,9 @@ static uint64_t device_host_physical_memory(bool available) { // active pages compression has higher priority than releasing the clean mmap-ed pages // some of the active pages can be compressed to save memory for our mmap-ed model weights if (is_uma_arch()) { - // assume 30% of active pages can be compressed on macOS UMA (an empirical value) + // assume 10% of active pages can be compressed on macOS UMA (an empirical value) // because GPU is more likely to use the inactive memory - memory += vm_stats.active_count * 0.3 * page_size; + memory += vm_stats.active_count * 0.1 * page_size; } else { // assume 50% of active pages can be compressed on macOS NUMA (an empirical value) memory += vm_stats.active_count * 0.5 * page_size;