]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : fix padding in timestep embedding kernels (#15932)
authorDaniel Bevenius <redacted>
Tue, 16 Sep 2025 13:25:57 +0000 (15:25 +0200)
committerGitHub <redacted>
Tue, 16 Sep 2025 13:25:57 +0000 (15:25 +0200)
commit3913f8730ec6d6245480affc30ae3049107956f4
tree6af7c3058fe149279844f55239d90330b02f032b
parent76888d202ed2b835ae19ea9f9db6baf39e419297
ggml : fix padding in timestep embedding kernels (#15932)

* ggml : remove adding extra dim timestep embedding

This commit updates the ggml_timestep_embedding function to no longer
add an extra dimension when the specified dimension is odd.

The motivation for this change is that this introduces an unnecessary
dimension when the dimension is odd, which caused an issue in the
kernels which were not expecting this extra dimension and it resulted in
uninitialized memory for the second to last dimension.

* ggml-cuda : fix padding in timestep embedding kernel

This commit removes the zeroing out of the last dimension now that we
are not adding the extra padding dimension.

* ggml-metal : fix padding in timestep embedding kernel

This commit fixes the zero padding for odd dimensions in
the timestep embedding kernel

* ggml-opencl : fix padding in timestep embedding kernel

This commit fixes the zero padding for odd dimensions in
the timestep embedding kernel.

* ggml-sycl : fix padding in timestep embedding kernel

This commit fixes the zero padding for odd dimensions in
the timestep embedding kernel.

* ggml-vulkan : fix padding in timestep embedding kernel

This commit fixes the zero padding for odd dimensions in
the timestep embedding kernel.

* ggml-cpu : fix padding in timestep embedding function

This commit removes the zeroing out of the last dimension now that we
are not adding the extra padding dimension.
ggml/src/ggml-cpu/ops.cpp
ggml/src/ggml-cuda/tsembd.cu
ggml/src/ggml-metal/ggml-metal.metal
ggml/src/ggml-opencl/kernels/tsembd.cl
ggml/src/ggml-sycl/tsembd.cpp
ggml/src/ggml-vulkan/vulkan-shaders/timestep_embedding.comp
ggml/src/ggml.c