File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1599,7 +1599,7 @@ struct llama_model {
1599
1599
std::unique_ptr<llama_mmap> mapping;
1600
1600
1601
1601
// objects representing data potentially being locked in memory
1602
- llama_mlock mlock_buf ;
1602
+ std::vector<std::unique_ptr< llama_mlock>> mlock_bufs ;
1603
1603
llama_mlock mlock_mmap;
1604
1604
1605
1605
// for quantize-stats only
@@ -3815,8 +3815,10 @@ static bool llm_load_tensors(
3815
3815
else {
3816
3816
buf = ggml_backend_alloc_ctx_tensors_from_buft (ctx, buft);
3817
3817
if (buf != nullptr && use_mlock && ggml_backend_buffer_is_host (buf)) {
3818
- model.mlock_buf .init (ggml_backend_buffer_get_base (buf));
3819
- model.mlock_buf .grow_to (ggml_backend_buffer_get_size (buf));
3818
+ model.mlock_bufs .emplace_back (new llama_mlock);
3819
+ auto & mlock_buf = model.mlock_bufs .back ();
3820
+ mlock_buf->init (ggml_backend_buffer_get_base (buf));
3821
+ mlock_buf->grow_to (ggml_backend_buffer_get_size (buf));
3820
3822
}
3821
3823
}
3822
3824
if (buf == nullptr ) {
You can’t perform that action at this time.
0 commit comments