Skip to content

Commit cf60eb3

Browse files
committed
fit: clear use_direct_io on dry-run model load for params fitting
O_DIRECT on a 100GB model file during the metadata-only scan hangs. The dry-run only needs metadata so normal buffered IO is fine.
1 parent 0b1bbc1 commit cf60eb3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

common/fit.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ static std::vector<llama_device_memory_data> common_get_device_memory_data(
5353
}, &ud);
5454

5555
llama_model_params mparams_copy = *mparams;
56-
mparams_copy.no_alloc = true;
57-
mparams_copy.use_mmap = false;
58-
mparams_copy.use_mlock = false;
56+
mparams_copy.no_alloc = true;
57+
mparams_copy.use_mmap = false;
58+
mparams_copy.use_mlock = false;
59+
mparams_copy.use_direct_io = false;
5960

6061
llama_model * model = llama_model_load_from_file(path_model, mparams_copy);
6162
if (model == nullptr) {

0 commit comments

Comments
 (0)