File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1132,9 +1132,18 @@ bool llama_model_loader::load_all_data(
11321132 for (uint32_t idx = 0 ; idx < mappings.size (); idx++) {
11331133 const auto & mmap_used = mmaps_used.at (idx);
11341134 auto & mapping = mappings.at (idx);
1135- mapping->unmap_fragment (0 , mmap_used.first );
1136- if (mmap_used.second != 0 ) {
1137- mapping->unmap_fragment (mmap_used.second , mapping->size ());
1135+
1136+ // Check if this mapping uses NUMA mirroring
1137+ // If so, skip the unmap_fragment calls as cleanup is handled in the destructor
1138+ bool is_numa_mirrored = false ;
1139+ #ifdef GGML_NUMA_MIRROR
1140+ is_numa_mirrored = true ;
1141+ #endif
1142+ if (!is_numa_mirrored) {
1143+ mapping->unmap_fragment (0 , mmap_used.first );
1144+ if (mmap_used.second != 0 ) {
1145+ mapping->unmap_fragment (mmap_used.second , mapping->size ());
1146+ }
11381147 }
11391148 }
11401149 }
You can’t perform that action at this time.
0 commit comments