Add assert to make sure we only allocate temp buffer for non-CPU backend tensor
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
This commit is contained in:
parent
34ca572e84
commit
61726bd942
1 changed files with 1 additions and 0 deletions
|
@ -762,6 +762,7 @@ struct llama_model_loader {
|
||||||
|
|
||||||
// allocate temp buffer if not using mmap
|
// allocate temp buffer if not using mmap
|
||||||
if (!use_mmap && lt.data == NULL) {
|
if (!use_mmap && lt.data == NULL) {
|
||||||
|
GGML_ASSERT(lt.ggml_tensor->backend != GGML_BACKEND_CPU);
|
||||||
lt.data = (uint8_t*)malloc(ggml_nbytes(lt.ggml_tensor));
|
lt.data = (uint8_t*)malloc(ggml_nbytes(lt.ggml_tensor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue