Commit 9de447d
authored
ggml-cpu : fix padding in ggml_timestep_embedding (ggml-org#15917)
This commit fixes the zero padding for odd dimensions in
ggml_compute_forward_timestep_embedding_f32.
The motivation for this is that currently if an odd dimension is used,
the padding check incorrectly uses the dimension value for indexing.
For example, with dim=15:
Elements 0-6 are set to cosine values
Elements 7-13 are set to sine values
Element 14 is left uninitialized (contains garbage)
Element 15 is correctly set to zero
This fix changes embed_data[dim] to embed_data[2 * half] so that
element 14 (the first unused element) is properly set to zero as well
as the last element.
Resolves: ggml-org/ggml#13241 parent 0f0a3c2 commit 9de447d
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8598 | 8598 | | |
8599 | 8599 | | |
8600 | 8600 | | |
| 8601 | + | |
8601 | 8602 | | |
8602 | 8603 | | |
8603 | 8604 | | |
| |||
0 commit comments