ggerganov / ggml

Tensor library for machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about ggml-alloc assert in CPU ggml-backend version of Sam.cpp

YavorGIvanov opened this issue · comments

I started using the the ggml-backend API in Sam.cpp.
After this commit - 25ce18a I hit an assert in Debug. The reason is that the view in init_view(..) doesn't have a valid buffer as the view_src also doesn't. I disabled the assert in this case here -> YavorGIvanov@94a4c07 and everything works fine.

Does that point to an underlying problem in the Sam implementation or not ? (I know that potentially the CUDA version won't work, but currently SAM.cpp doesn't support CUDA)

It is a bug, it also affects llama.cpp. Your fix looks good.

The reason I didn't catch it is that it only affects debug builds, and I didn't test that.

@ggerganov I think we never run llama.cpp with a debug build in the ggml-ci, beyond the basic tests. That would have caught this issue.

Ok. Should I make a simple PR or you would address it as part of some other changes ?

We should fix this as soon as possible, a PR would be great.