Fix another Vulkan CPY buffer size bug
This commit is contained in:
parent
e76d0013a8
commit
23e35e9066
1 changed files with 12 additions and 5 deletions
|
@ -2876,6 +2876,9 @@ static void ggml_vk_op_f32(vk_context * ctx, const ggml_tensor * src0, const ggm
|
||||||
x_sz = ggml_nbytes(src0);
|
x_sz = ggml_nbytes(src0);
|
||||||
d_sz = ggml_nbytes(dst);
|
d_sz = ggml_nbytes(dst);
|
||||||
|
|
||||||
|
if (extra_src0->offset + x_sz >= d_X->size) {
|
||||||
|
x_sz = VK_WHOLE_SIZE;
|
||||||
|
}
|
||||||
if (extra->offset + d_sz >= d_D->size) {
|
if (extra->offset + d_sz >= d_D->size) {
|
||||||
d_sz = VK_WHOLE_SIZE;
|
d_sz = VK_WHOLE_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -2911,13 +2914,17 @@ static void ggml_vk_op_f32(vk_context * ctx, const ggml_tensor * src0, const ggm
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (op != GGML_OP_CPY) {
|
||||||
|
if (x_sz != VK_WHOLE_SIZE) {
|
||||||
x_sz *= ne02 * ne03;
|
x_sz *= ne02 * ne03;
|
||||||
|
}
|
||||||
if (y_sz != VK_WHOLE_SIZE) {
|
if (y_sz != VK_WHOLE_SIZE) {
|
||||||
y_sz *= ne12 * ne13;
|
y_sz *= ne12 * ne13;
|
||||||
}
|
}
|
||||||
if (op != GGML_OP_CPY) {
|
if (d_sz != VK_WHOLE_SIZE) {
|
||||||
d_sz *= ne02 * ne03;
|
d_sz *= ne02 * ne03;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!use_src1 && op == GGML_OP_SOFT_MAX) {
|
if (!use_src1 && op == GGML_OP_SOFT_MAX) {
|
||||||
// Empty src1 is possible on soft_max, but the shader needs a buffer
|
// Empty src1 is possible on soft_max, but the shader needs a buffer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue