ik_llama_opt/ggml/src
mb8565 0ffdf509ab
ggml : fix set_rows CPU crash when the destination is F32 (#2038)
The CPU `set_rows` kernel for F32 sources fetches `type_traits[dst->type].from_float`
and calls it for every scattered row. F32 has no `from_float` entry, it is NULL in
`type_traits`, so any `set_rows` into an F32 destination calls a NULL function pointer
and segfaults. Other destination types work because they all have a real `from_float`.

Repro (CPU backend, standalone ggml graph):

    dst = new_tensor_2d(F32, 8, 6)   // F32 destination
    src = new_tensor_2d(F32, 8, 4)
    idx = new_tensor_1d(I64, 4)      // {0,2,4,5}
    out = ggml_set_rows(dst, src, idx)
    // ggml_backend_graph_compute(cpu, ...) -> SIGSEGV on current main

When the destination is F32, copy the row with `memcpy` instead of going through
`from_float`. The I32 and I64 index branches both get the same treatment. An assert
guards the remaining case, non-F32 dst with a NULL `from_float`, so a future
unsupported type fails loudly instead of crashing.

I ran a normal model after this and it still decodes fine (DeepSeek-V2-Lite-Q4_K_M,
CPU, coherent output), and the non-F32 path is untouched. On the F32 path you pay one
`memcpy` per row in place of the indirect call.

Co-authored-by: local-llm <local-llm@local-llm-R740.cruvis.org>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:46:26 +02:00
..
cmake Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-cann Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
ggml-cuda cuda : fix MLA flash-attn vec decode for asymmetric K/V head sizes (#2031) 2026-06-25 08:56:17 +02:00
ggml-sycl Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
iqk AVX VNNI auto-activation for MSVC ; HAVE_VNNI256 path for IQ4_XS_R8 and Qx_0 R4 quants. (#1991) 2026-06-18 18:05:19 +02:00
kompute@4565194ed7 Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
kompute-shaders Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
llamafile Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
vulkan-shaders Port of Qwen3-VL support from mainline (#883) 2025-11-04 19:20:54 +02:00
CMakeLists.txt on-demand tensor reload (#1989) 2026-06-22 16:36:34 +02:00
ggml-aarch64.c Merge mainline - Aug 12 2024 (#17) 2024-08-12 15:14:32 +02:00
ggml-aarch64.h Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
ggml-alloc.c Support for Qwen 3.5 MTP (dense models only) (#1698) 2026-04-28 07:47:50 +02:00
ggml-backend-impl.h Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-backend.cpp Fix DFlash oerformance with split mode graph (#1980) 2026-06-17 18:40:02 +02:00
ggml-cann.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-common.h Bonsai support (AVX2, generic) (#1570) 2026-04-02 16:54:08 +02:00
ggml-cuda.cu Split mode graph for dense Gemma4 assistant (#2022) 2026-06-24 18:29:32 +02:00
ggml-impl.h MXFP4 (#682) 2025-08-09 08:40:18 +03:00
ggml-kompute.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-metal.m Fix clang warnings on macOS (#1354) 2026-03-03 16:27:16 +01:00
ggml-metal.metal MXFP4 (#682) 2025-08-09 08:40:18 +03:00
ggml-quants.c Use AVX version VNNI intrinsic when AVX512VNNI not available. (#1748) 2026-05-09 09:02:06 +03:00
ggml-quants.h Quantization options (#1677) 2026-04-23 09:05:39 +02:00
ggml-rpc.cpp server: improve speed of speculative decoding (#1119) 2026-01-10 08:01:22 +02:00
ggml-sycl.cpp Merge vulkan code from mainline up to commit of 6/28/2025 (#563) 2025-07-02 08:49:42 +02:00
ggml-vulkan.cpp Port of Qwen3-VL support from mainline (#883) 2025-11-04 19:20:54 +02:00
ggml.c ggml : fix set_rows CPU crash when the destination is F32 (#2038) 2026-06-26 08:46:26 +02:00