Skip to content

Commit 21f7ca2

Browse files
Disable mmap on s390x
Usually downloaded models are little-endian and byteswapping is needed. Byteswapping is not implemented for mmap model loading.
1 parent 0682209 commit 21f7ca2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llama-mmap.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ void * llama_mmap::addr() const { return pimpl->addr; }
441441

442442
void llama_mmap::unmap_fragment(size_t first, size_t last) { pimpl->unmap_fragment(first, last); }
443443

444-
#if defined(_POSIX_MEMLOCK_RANGE) || defined(_WIN32)
444+
// disable mmap on s390x while it usually loads little-endian models
445+
#if (defined(_POSIX_MEMLOCK_RANGE) && !defined(__s390x__)) || defined(_WIN32)
445446
const bool llama_mmap::SUPPORTED = true;
446447
#else
447448
const bool llama_mmap::SUPPORTED = false;

0 commit comments

Comments
 (0)