]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
CANN: add BF16 support for core operators (llama/20152)
authorhipudding <redacted>
Fri, 20 Mar 2026 09:08:39 +0000 (17:08 +0800)
committerGeorgi Gerganov <redacted>
Sat, 28 Mar 2026 11:39:09 +0000 (13:39 +0200)
commita4e7b4adfdb6dfcf426e00d67591033ea5830b6e
tree04bcd0dd213009003c7035203a098142c9486fc4
parentc797b6df08e893eb2a00cc815ceef34a89f9df6d
CANN: add BF16 support for core operators (llama/20152)

* CANN: add BF16 support for core operators

Add BF16 (bfloat16) type support to the CANN backend for the following
operators: MUL_MAT, MUL_MAT_ID, GET_ROWS, SET_ROWS, CPY, CONT, and
OUT_PROD. This enables BF16 models to run on Ascend NPUs.

* CANN: skip NZ weight format for BF16 and add 310P compile guards

NZ weight format conversion does not support BF16 tensors, skip it
in set_tensor, get_alloc_size and mul_mat. Remove BF16 from MUL_MAT_ID
and OUT_PROD as there are no BF16 use cases. Add #ifndef ASCEND_310P
guards for all BF16 operator support since 310P does not support BF16.
src/ggml-cann/aclnn_ops.cpp
src/ggml-cann/ggml-cann.cpp