]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : add ggml_set_rows (#14274)
authorRadoslav Gerganov <redacted>
Fri, 27 Jun 2025 13:41:40 +0000 (16:41 +0300)
committerGitHub <redacted>
Fri, 27 Jun 2025 13:41:40 +0000 (16:41 +0300)
commit8d94219a4a7f2da72ee542019ca01f36af93d1d6
treea6be93c5f1e3dca464f157b5964ef56d694de6ae
parentf667f1e6244e1f420512fa66692b7096ff17f366
ggml : add ggml_set_rows (#14274)

* ggml : add ggml_set_rows

Add ggml_set_rows(a, b, c) which copies rows from 'b' into 'a' using
indices from 'c'.

ref: #8366

* use I64 for indices

* ggml : add repeat impl for i64

* ggml : add ggml_is_contiguous_rows

* ggml : ggml_set_rows support broadcast

* ggml : ggml_set_rows support quantized dst

ggml-ci

* ggml : support GGML_TYPE_F32 ".from_float" trait

* ggml : ggml_set_rows update comment + better index name

* tests : add ggml_set_rows

* metal : add ggml_set_rows implementation

ggml-ci

* ggml : simplify forward_dup_f32

* ggml : fix supports_op

* tests : add comment to set_rows

* ggml : leave the repeat_i64 for a separate PR

ggml-ci

* ggml : set_rows use std::min instead of MIN

* ggml : better error message for set_rows unsupported type

* metal : perform op->type check only once

* tests : more consistent implementation + more tests

ggml-ci

---------

Co-authored-by: Georgi Gerganov <redacted>
12 files changed:
examples/eval-callback/eval-callback.cpp
ggml/include/ggml-cpu.h
ggml/include/ggml.h
ggml/src/ggml-cpu/ggml-cpu.c
ggml/src/ggml-cpu/ggml-cpu.cpp
ggml/src/ggml-cpu/ops.cpp
ggml/src/ggml-cpu/ops.h
ggml/src/ggml-metal/ggml-metal-impl.h
ggml/src/ggml-metal/ggml-metal.m
ggml/src/ggml-metal/ggml-metal.metal
ggml/src/ggml.c
tests/test-backend-ops.cpp