Feat: Handle ggml compute failures without crashing the program#1003
Conversation
|
Would this prevent ggml aborts? I'm using this project as a library in a C# application, and the thing that crashes the entire application is often ggml aborts, so I had to patch them out |
Hopefully it avoids some of them by not trying to continue further once something goes wrong. I can't guarentee it prevents all cases of hitting a GGML_ABORT. |
|
this is how i approached avoiding crashes and ggml aborts in my application, if it's of any use |
|
Maybe the best approach to avoid the ggml's abort() call is to don't avoid the abort() call. In my SD project i just start an external process and capture the error output when it happens and warn about the user in the UI. Then the app just restart a new and fresh process. Better than let to kill the entire app. |
|
@SkutteOleg you solution seems pretty good too. |
this sounds like it requires quite a bit of platform-specific work |
|
Yes, but worth it. Maybe the hardest part the protocol which used to communicate the 2 process. And at least, the main app is fast and responsive. |
|
|
||
| GGMLRunner::compute(get_graph, n_threads, false, output, output_ctx); | ||
| return GGMLRunner::compute(get_graph, n_threads, false, output, output_ctx); | ||
| guided_hint_cached = true; |
Co-authored-by: idostyle <idostyl3@googlemail.com>
|
Thank you for your contribution. |
…et#1003) * Feat: handle compute failures more gracefully * fix Unreachable code after return Co-authored-by: idostyle <idostyl3@googlemail.com> * adjust z_image.hpp --------- Co-authored-by: idostyle <idostyl3@googlemail.com> Co-authored-by: leejet <leejet714@gmail.com>
It's annoying when the library crashes the whole program when something goes wrong.
For example, when the user asks for an image with insane resolution (on hip backend), we get something like this:
With these changes:
When using the CLI, it doesn't matter too much, but when using the API for a server for example, avoiding these kinds of crashes is important.