llm
llm copied to clipboard
Perplexity can/will segfault over large input sizes
The newly-added perplexity will segfault with large enough input. This is likely because the current implementation of the LLaMA model isn't really set up to handle going over context, and updating it (#210) should fix this.
The other models segfault too (from a quick test), but perplexity is primarily useful for comparing against llama.cpp, so I'm not as fussed. It would be nice to figure this out at some point, though.
Just a heads-up: updating LLaMA did not in fact fix this. We have other bugs we need to fix here, but the segfault is within ggml, so it's harder to track down.
Note: https://github.com/rustformers/llm/pull/362 (context size change) affects this issue due to this line:
https://github.com/rustformers/llm/blob/16522344477a0f8d4140a5f6a80fe446d6fc7795/crates/llm-base/src/inference_session.rs#L504
Good catch! That almost certainly fixes this. Need to retest...