mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-11 09:24:33 +00:00
use disk.read_rnd.bw in termux
This commit is contained in:
parent
dfb37671d3
commit
28ebc6478a
1 changed files with 8 additions and 4 deletions
|
@ -1397,11 +1397,15 @@ static float device_disk_access_delay(struct device_info & dev_info, struct llam
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
// POSIX_FADV_SEQUENTIAL is set on linux
|
if (getenv("TERMUX_VERSION") == NULL) {
|
||||||
float disk_read_bw = dev_info.disk.read_seq_bw * 1e9 / 1024.0 / 1024.0 / 1024.0;
|
// if this linux not in termux env, use sequantial read bandwidth
|
||||||
#else
|
// POSIX_FADV_SEQUENTIAL is set on linux
|
||||||
float disk_read_bw = dev_info.disk.read_rnd_bw * 1e9 / 1024.0 / 1024.0 / 1024.0;
|
float disk_read_bw = dev_info.disk.read_seq_bw * 1e9 / 1024.0 / 1024.0 / 1024.0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// non-linux and linux in termux
|
||||||
|
float disk_read_bw = dev_info.disk.read_rnd_bw * 1e9 / 1024.0 / 1024.0 / 1024.0;
|
||||||
|
|
||||||
// only part of the mapped tensors needs to be re-loaded
|
// only part of the mapped tensors needs to be re-loaded
|
||||||
float gbytes_to_load = cpu_total_bytes_gib - (cpu_mem_avail - cpu_kv_size_gib - cpu_compute_buf_gib);
|
float gbytes_to_load = cpu_total_bytes_gib - (cpu_mem_avail - cpu_kv_size_gib - cpu_compute_buf_gib);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue