]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
hexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (llama/20701)
authorKrishna Sridhar <redacted>
Tue, 17 Mar 2026 22:34:36 +0000 (15:34 -0700)
committerGeorgi Gerganov <redacted>
Sun, 29 Mar 2026 12:04:36 +0000 (15:04 +0300)
commite222814fc4bef846054b071b48bb54e89fcc00c5
treec05882b14fec1fd1cc36fcae7c10ec9c10055a66
parent16ca5e6fb130cd68d1d499db8b59361e3aba0db6
hexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (llama/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