Passing in a empty vector (instead of null) to tensor_split into the model parameters causes it to segfault. Passing a nullptr is fine and will cause llama.cpp use some default settings for tensor_split. Passing a empty vector by Vec::new() doesn't allocate any memory but also isn't a nullptr, it goes to 0x04 for some reason, then the c++ code in llama.cpp only check is == nullptr which 0x04 passes and then causes llama.cpp to segfault.
Make the tensor_split an Option<Vec<32>> works better since then you can just pass in a null for the None case.
This only affects if using CUDA with llama.cpp.
Passing in a empty vector (instead of null) to
tensor_split
into the model parameters causes it to segfault. Passing a nullptr is fine and will cause llama.cpp use some default settings fortensor_split
. Passing a empty vector byVec::new()
doesn't allocate any memory but also isn't a nullptr, it goes to0x04
for some reason, then the c++ code in llama.cpp only check is== nullptr
which0x04
passes and then causes llama.cpp to segfault.Make the tensor_split an
Option<Vec<32>>
works better since then you can just pass in anull
for theNone
case.