llama : disable Direct IO by default (#19109)

* llama : disable Direct IO by default

* cont : override mmap if supported
This commit is contained in:
Georgi Gerganov
2026-01-28 09:11:13 +02:00
committed by GitHub
parent eef375ce16
commit c5c64f72ac
6 changed files with 10 additions and 13 deletions
+4 -4
View File
@@ -541,15 +541,15 @@ llama_model_loader::llama_model_loader(
if (use_mmap && use_direct_io) {
if (files.back()->has_direct_io()) {
// Disable mmap, as DirectIO is available
use_mmap = false;
LLAMA_LOG_WARN("%s: direct I/O is enabled, disabling mmap\n", __func__);
use_mmap = false;
} else {
// Disable DirectIO and reopen file using std::fopen for mmap
LLAMA_LOG_WARN("%s: direct I/O is not available, using mmap\n", __func__);
use_direct_io = false;
// reopen file using std::fopen for mmap
files.pop_back();
files.emplace_back(new llama_file(fname.c_str(), "rb", false));
LLAMA_LOG_WARN("%s: direct I/O is not available, using mmap\n", __func__);
}
}