]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
hexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (#20701)
authorKrishna Sridhar <redacted>
Tue, 17 Mar 2026 22:34:36 +0000 (15:34 -0700)
committerGitHub <redacted>
Tue, 17 Mar 2026 22:34:36 +0000 (15:34 -0700)
commitcf23ee244717b7b41f092410991d0344b25620ea
tree7aa2694cd3efe860eaa83c4230889466b1f8bbc7
parent892e3c333a634f818acc195dc699468c08ff5e80
hexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (#20701)

Add element-wise unary ops needed by Qwen 3.5's DeltaNet linear
attention layers. These ops follow the existing unary-ops pattern
with VTCM DMA double-buffering.

- neg: negate via scale by -1.0
- exp: uses existing hvx_exp_f32 HVX intrinsics
- sigmoid: uses existing hvx_sigmoid_f32_aa HVX intrinsics
- softplus: log(1 + exp(x)) scalar fallback
- CONT reuses the existing CPY infrastructure since making a tensor
  contiguous is equivalent to a same-type copy.
- REPEAT implements tiled memory copy with multi-threaded execution via
  the worker pool, supporting f32 and f16 types. The kernel parallelizes
  across output rows and uses memcpy for each tile.

Co-authored-by: Max Krasnyansky <redacted>
ggml/src/ggml-hexagon/ggml-hexagon.cpp
ggml/src/ggml-hexagon/htp/CMakeLists.txt
ggml/src/ggml-hexagon/htp/htp-msg.h
ggml/src/ggml-hexagon/htp/htp-ops.h
ggml/src/ggml-hexagon/htp/hvx-base.h
ggml/src/ggml-hexagon/htp/hvx-exp.h
ggml/src/ggml-hexagon/htp/hvx-sigmoid.h
ggml/src/ggml-hexagon/htp/main.c
ggml/src/ggml-hexagon/htp/repeat-ops.c [new file with mode: 0644]
ggml/src/ggml-hexagon/htp/softmax-ops.c
ggml/src/ggml-hexagon/htp/unary-ops.c