whisper.cpp/ggml/src
Daniel Bevenius e0be0de1ee ggml : add check for grad_accs (ggml/1046)
* ggml : add check for grad_accs

This commit adds a check for grad_accs in ggml_graph_get_grad and
ggml_graph_get_grad_acc functions. This is necessary to avoid segfaults
when grad_accs is not initialized.

The motivation for this change is that I find it nice to be able to
print out a computation graph using ggml_graph_print but this function
segfaults when grad_accs is not initialized:
```console
(gdb) p g1
$2 = (ggml_cgraph *) 0x7ffff66004b0
(gdb) p *g1
$3 = {size = 2048, n_nodes = 1, n_leafs = 2, nodes = 0x7ffff6600500,
grads = 0x0, grad_accs = 0x0, leafs = 0x7ffff6604500,
visited_hash_set = {size = 4099, used = 0x7ffff6610518,
keys = 0x7ffff6608500}, order = GGML_CGRAPH_EVAL_ORDER_LEFT_TO_RIGHT}
(gdb) p ggml_graph_print(g1)
=== GRAPH ===
n_nodes = 1

Program received signal SIGSEGV, Segmentation fault.
0x0000555555579775 in ggml_graph_get_grad
(cgraph=0x7ffff66004b0,node=0x7ffff6600340)
    at /ggml/ggml/src/ggml.c:5990
5990  return igrad != GGML_HASHSET_FULL &&
          ggml_bitset_get(cgraph->visited_hash_set.used, igrad) ?
          cgraph->grads[igrad] : NULL;
```

* squash! ggml : add check for grad_accs

Fix the check in ggml_graph_get_grad. The check was incorrectly using
cgraph->grad_accs instead of cgraph->grads.
2024-12-18 12:52:16 +02:00
..
ggml-amx ggml : adapt AMX to tensor->grad removal (llama/0) 2024-11-20 21:00:08 +02:00
ggml-blas ggml : add support for dynamic loading of backends (llama/10469) 2024-12-08 20:14:35 +02:00
ggml-cann ggml : refactor online repacking (llama/10446) 2024-12-18 12:52:16 +02:00
ggml-cpu ggml : disable iq4_nl interleave size 8 (llama/10709) 2024-12-18 12:52:16 +02:00
ggml-cuda CUDA: fix shared memory access condition for mmv (llama/10740) 2024-12-18 12:52:16 +02:00
ggml-hip ggml : add support for dynamic loading of backends (llama/10469) 2024-12-08 20:14:35 +02:00
ggml-kompute kompute : improve backend to pass test_backend_ops (llama/10542) 2024-12-08 20:14:35 +02:00
ggml-metal metal : Extend how Llama.cpp locates metal resources (llama/10676) 2024-12-18 12:52:16 +02:00
ggml-musa ggml : remove old files (skip) (#0) 2024-12-08 23:04:26 +02:00
ggml-rpc ggml : add support for dynamic loading of backends (llama/10469) 2024-12-08 20:14:35 +02:00
ggml-sycl ggml : refactor online repacking (llama/10446) 2024-12-18 12:52:16 +02:00
ggml-vulkan vulkan: fix compile warnings (llama/10731) 2024-12-18 12:52:16 +02:00
CMakeLists.txt ggml : refactor online repacking (llama/10446) 2024-12-18 12:52:16 +02:00
ggml-aarch64.c ggml : optimize Q4_0 into Q4_0_X_Y repack (llama/10324) 2024-11-20 21:00:08 +02:00
ggml-aarch64.h ggml : build backends as libraries (llama/10256) 2024-11-20 21:00:08 +02:00
ggml-alloc.c ggml: new optimization interface (ggml/988) 2024-11-20 21:00:08 +02:00
ggml-backend-impl.h ggml : move AMX to the CPU backend (llama/10570) 2024-12-08 20:14:35 +02:00
ggml-backend-reg.cpp ggml : add predefined list of CPU backend variants to build (llama/10626) 2024-12-08 20:14:35 +02:00
ggml-backend.cpp ggml : move AMX to the CPU backend (llama/10570) 2024-12-08 20:14:35 +02:00
ggml-common.h ggml : refactor online repacking (llama/10446) 2024-12-18 12:52:16 +02:00
ggml-impl.h Avoid using __fp16 on ARM with old nvcc (llama/10616) 2024-12-08 20:14:35 +02:00
ggml-opt.cpp ggml-opt: fix data corruption (ggml/1022) 2024-12-08 20:14:35 +02:00
ggml-quants.c ggml : refactor online repacking (llama/10446) 2024-12-18 12:52:16 +02:00
ggml-quants.h ggml : build backends as libraries (llama/10256) 2024-11-20 21:00:08 +02:00
ggml-threading.cpp ggml : build backends as libraries (llama/10256) 2024-11-20 21:00:08 +02:00
ggml-threading.h ggml : build backends as libraries (llama/10256) 2024-11-20 21:00:08 +02:00
ggml.c ggml : add check for grad_accs (ggml/1046) 2024-12-18 12:52:16 +02:00