Skip to content

Commit ddc367c

Browse files
committed
Remove alignment_prevents_mmap which is not more needed.
1 parent d27a489 commit ddc367c

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

llama.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,9 @@ struct llama_model_loader {
576576
if (!llama_mmap::SUPPORTED) {
577577
use_mmap = false;
578578
}
579-
if (use_mmap && alignment_prevents_mmap()) {
580-
fprintf(stderr, "llama.cpp: can't use mmap because tensors are not aligned; convert to new format to avoid this\n");
581-
use_mmap = false;
582-
}
583579
this->use_mmap = use_mmap;
584580
}
585581

586-
bool alignment_prevents_mmap() {
587-
for (const llama_load_tensor & lt : tensors_map.tensors) {
588-
if (lt.file_off & 3) {
589-
return true;
590-
}
591-
}
592-
return false;
593-
}
594-
595582
void calc_sizes(size_t * ctx_size_p, size_t * mmapped_size_p) const {
596583
*ctx_size_p = *mmapped_size_p = 0;
597584
for (const llama_load_tensor & lt : tensors_map.tensors) {

0 commit comments

Comments
 (0)