Skip to content

Commit a1de8bd

Browse files
committed
ggml-opencl : fix padding in timestep embedding kernel
This commit fixes the zero padding for odd dimensions in the timestep embedding kernel.
1 parent b55c194 commit a1de8bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-opencl/kernels/tsembd.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ kernel void kernel_timestep_embedding(
2626
local_half_dim = logical_dim / 2;
2727
local_embed_data_ptr = (global float *)((global char *)local_dst_output_base_ptr + local_i * dst_nb1_bytes);
2828

29-
if (logical_dim % 2 != 0 && local_j == ((logical_dim + 1) / 2)) {
30-
local_embed_data_ptr[logical_dim] = 0.0f;
29+
if (logical_dim % 2 != 0 && local_j == local_half_dim) {
30+
local_embed_data_ptr[2 * local_half_dim] = 0.0f;
3131
}
3232

3333
if (local_j >= local_half_dim) {

0 commit comments

Comments
 (0)