]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
ggml : fix cont with transposed tensors when one dimension is 1 (#934)
authorSalvatore Mesoraca <redacted>
Wed, 28 Aug 2024 08:23:02 +0000 (10:23 +0200)
committerGitHub <redacted>
Wed, 28 Aug 2024 08:23:02 +0000 (11:23 +0300)
commitc78a3d13cd9ac19e52068d8fc95b0a152be14f78
tree1bcc7a7c63cfd480a21625c803114c55b6a64a54
parent0755304f1acdece9eac745d66cc1e4b165179dc6
ggml : fix cont with transposed tensors when one dimension is 1 (#934)

* ggml_cont: fix issue with transposed tensors when one dimension is 1

when using multiple threads, it is not enough
to check for the tensors to be contiguous for
ggml_compute_forward_dup_same_cont to work correctly.
The tensors strides also need to match.

Signed-off-by: Salvatore Mesoraca <redacted>
* Add ggml_cont tests

Signed-off-by: Salvatore Mesoraca <redacted>
* Remove dead code

it isn't possible to reach this code because
all these functions are invoked by ggml_compute_forward_dup
if and only if src0->type != dst->type

Signed-off-by: Salvatore Mesoraca <redacted>
* Make ggml_compute_forward_dup_same_cont work with contiguous tensors

Co-authored-by: Georgi Gerganov <redacted>
Signed-off-by: Salvatore Mesoraca <redacted>
---------

Signed-off-by: Salvatore Mesoraca <redacted>
Co-authored-by: Georgi Gerganov <redacted>
src/ggml.c
tests/CMakeLists.txt
tests/test-backend-ops.cpp
tests/test-cont.c [new file with mode: 0644]