-
Notifications
You must be signed in to change notification settings - Fork 11.9k
metal : bug with ggml_cont #3012
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
Changes from all commits
ad80e5a
7704db2
ebd3467
60c2ef6
f3a84b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4285,7 +4285,7 @@ int64_t ggml_nrows(const struct ggml_tensor * tensor) { | |
} | ||
|
||
size_t ggml_nbytes(const struct ggml_tensor * tensor) { | ||
size_t nbytes = tensor->ne[0]*tensor->nb[0]/ggml_blck_size(tensor->type); | ||
size_t nbytes = (tensor->ne[0]*tensor->nb[0])/ggml_blck_size(tensor->type); | ||
for (int i = 1; i < GGML_MAX_DIMS; ++i) { | ||
nbytes += (tensor->ne[i] - 1)*tensor->nb[i]; | ||
} | ||
|
@@ -5213,6 +5213,8 @@ struct ggml_tensor * ggml_view_tensor( | |
result->nb[i] = src->nb[i]; | ||
} | ||
|
||
result->op = GGML_OP_VIEW; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added your proposal since it better expresses the KV cache dependency, until we figure out a better solution. For this to work though, we need to set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, we should also set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah good points. I guess I'll come back to this later and make a better solution. |
||
|
||
return result; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need confirmation if this is correct.
Btw, I see that
check_mem
is always set tofalse
.Are there cases where we would still need it?
If it's not needed, should we remove it?