]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
ggml : add ggml_set_rows (llama/14274)
authorRadoslav Gerganov <redacted>
Fri, 27 Jun 2025 13:41:40 +0000 (16:41 +0300)
committerGeorgi Gerganov <redacted>
Tue, 1 Jul 2025 08:52:14 +0000 (11:52 +0300)
commita1938493c4c6fded3da6bbde63ef7a273cc1b041
treecab054f9e3537141e6d13bdb25e41363aef6fd1b
parentf232edffb540b694e3bc975e014b40abc6310201
ggml : add ggml_set_rows (llama/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>
include/ggml-cpu.h
include/ggml.h
src/ggml-cpu/ggml-cpu.c
src/ggml-cpu/ggml-cpu.cpp
src/ggml-cpu/ops.cpp
src/ggml-cpu/ops.h
src/ggml-metal/ggml-metal-impl.h
src/ggml-metal/ggml-metal.m
src/ggml-metal/ggml-metal.metal
src/ggml.c
tests/test-backend-ops.cpp