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 <maxk@qti.qualcomm.com>
48 lines
1.1 KiB
CMake
48 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.22.2)
|
|
project(ggml-htp C CXX ASM)
|
|
|
|
include(${HEXAGON_SDK_ROOT}/build/cmake/hexagon_fun.cmake)
|
|
|
|
include_directories(
|
|
${HEXAGON_SDK_ROOT}/incs
|
|
${HEXAGON_SDK_ROOT}/incs/stddef
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../../include
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
set(HTP_LIB ggml-htp-${DSP_VERSION})
|
|
|
|
add_library(${HTP_LIB} SHARED
|
|
main.c
|
|
htp_iface_skel.c
|
|
worker-pool.c
|
|
hex-dma.c
|
|
matmul-ops.c
|
|
binary-ops.c
|
|
unary-ops.c
|
|
sum-rows-ops.c
|
|
softmax-ops.c
|
|
act-ops.c
|
|
rope-ops.c
|
|
flash-attn-ops.c
|
|
set-rows-ops.c
|
|
get-rows-ops.c
|
|
cpy-ops.c
|
|
repeat-ops.c
|
|
argsort-ops.c
|
|
ssm-conv.c
|
|
)
|
|
|
|
target_compile_definitions(${HTP_LIB} PRIVATE
|
|
$<IF:$<BOOL:${HEXAGON_HTP_DEBUG}>,HTP_DEBUG=1,NDEBUG=1>
|
|
$<IF:$<BOOL:${HEXAGON_HTP_DEBUG}>,FARF_HIGH=1,>
|
|
FP32_QUANTIZE_GROUP_SIZE=${GGML_HEXAGON_FP32_QUANTIZE_GROUP_SIZE})
|
|
|
|
build_idl(htp_iface.idl ${HTP_LIB})
|
|
|
|
set_target_properties(${HTP_LIB} PROPERTIES EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
install(TARGETS ${HTP_LIB})
|