mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-08 10:09:03 +00:00
assume 10% of active pages can be compressed on macOS UMA
This commit is contained in:
parent
261c88f058
commit
24974a488c
1 changed files with 2 additions and 2 deletions
|
@ -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
|
// 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
|
// some of the active pages can be compressed to save memory for our mmap-ed model weights
|
||||||
if (is_uma_arch()) {
|
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
|
// 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 {
|
} else {
|
||||||
// assume 50% of active pages can be compressed on macOS NUMA (an empirical value)
|
// assume 50% of active pages can be compressed on macOS NUMA (an empirical value)
|
||||||
memory += vm_stats.active_count * 0.5 * page_size;
|
memory += vm_stats.active_count * 0.5 * page_size;
|
||||||
|
|
Loading…
Add table
Reference in a new issue