bert.cpp icon indicating copy to clipboard operation
bert.cpp copied to clipboard

Segfault on large inputs?

Open corani opened this issue 2 years ago • 2 comments

When I run the the build/bin/main example with a larger input I get a segfault:

ggml_new_tensor_impl: not enough space in the context's memory pool (needed 271388624, available 260703040)
Segmentation fault

I can work around this by doing an N *= 2; near the bottom of bert_load_from_file, but obviously that isn't the right solution. It seems somewhere a calculation is off (probably with mem_per_token).

corani avatar Sep 22 '23 02:09 corani

@corani is this issue solved by N *= 2, can you please let me know at what file and line need to change this. Thank you in advance.

ztkg257 avatar Mar 06 '24 11:03 ztkg257

I believe here: https://github.com/skeskinen/bert.cpp/blob/master/bert.cpp#L687

corani avatar Mar 06 '24 15:03 corani