Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whisper : adapt to latest ggml changes #1959

Closed
ggerganov opened this issue Mar 15, 2024 · 2 comments
Closed

whisper : adapt to latest ggml changes #1959

ggerganov opened this issue Mar 15, 2024 · 2 comments

Comments

@ggerganov
Copy link
Owner

This view in the "encoder" graph of a tensor from the "conv" graph is triggering an assert with the latest build:

struct ggml_tensor * cur = ggml_view_tensor(ctx0, wstate.embd_conv);

The assert is:

whisper.cpp/ggml-alloc.c

Lines 737 to 745 in de4d067

if (tensor->view_src != NULL) {
if (tensor->buffer == NULL) {
assert(tensor_alloc->offset == SIZE_MAX);
if (tensor->view_src->buffer == NULL) {
// this tensor was allocated without ggml-backend
return;
}
ggml_backend_view_init(galloc->buffers[buffer_id], tensor);
}

Is this a valid use case and we simply have to remove the assert, or a proper fix is necessary?

cc @slaren

@slaren
Copy link
Collaborator

slaren commented Mar 15, 2024

It should still work if the assert is removed, but generally this indicates a failure to detect a change in the topology of the graph. It could probably be fixed by changing ggml_gallocr_node_needs_realloc to detect this case.

However this may indicate an issue with the graph used to reserve the buffers. What may be happening is that wstate.embd_conv was not allocated when reserving the buffers, causing it to be allocated in the graph, and then this changed to become a pre-allocated tensor. It would be better to fix that.

@ggerganov
Copy link
Owner Author

Fixed via 906c73b

jiahansu pushed a commit to OOPRY/whisper.cpp that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants