summaryrefslogtreecommitdiff
path: root/ggml.c
diff options
context:
space:
mode:
authorHerman Semenov <GermanAizek@yandex.ru>2023-10-20 10:02:12 +0000
committerGitHub <noreply@github.com>2023-10-20 13:02:12 +0300
commitf439e506e8ae8b01df2ae2156380f8156d7553e3 (patch)
tree59683267206e83bba460a13347caae31b7f0ea8e /ggml.c
parente78f3ef24af4ca74e77e725644b41ae8ca3b10a5 (diff)
ggml : fix rope + llama minor optimizations (#3560)
* Minor fixes and fixed memleak * Using const auto references in range-based loop C++17
Diffstat (limited to 'ggml.c')
-rw-r--r--ggml.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ggml.c b/ggml.c
index 630deb49..ed157aab 100644
--- a/ggml.c
+++ b/ggml.c
@@ -13537,7 +13537,7 @@ static void ggml_compute_forward_rope_f16(
dst_data[n_dims] = GGML_FP32_TO_FP16(x2*cos_block_theta - x3*sin_block_theta);
dst_data[n_dims/2*3] = GGML_FP32_TO_FP16(x2*sin_block_theta + x3*cos_block_theta);
}
- } if (!is_neox) {
+ } else if (!is_neox) {
for (int64_t i0 = 0; i0 < ne0; i0 += 2) {
const float cos_theta = cosf(theta);
const float sin_theta = sinf(theta);
@@ -19170,6 +19170,7 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) {
if (idx == -1) {
fprintf(stderr, "%s: failed to find tensor, arg = %d, node = %d\n", __func__, j, i);
+ fclose(fout);
return;
}