]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CANN: add BF16 support for core operators (#20152)
authorhipudding <redacted>
Fri, 20 Mar 2026 09:08:39 +0000 (17:08 +0800)
committerGitHub <redacted>
Fri, 20 Mar 2026 09:08:39 +0000 (17:08 +0800)
commit1af9dab32b555f7e3aac8b1bfe4e4cb780cb4185
tree23e36806a248a967f3ee5a65e8c7ea35974e15ca
parent6d99b44c7eb868e8b9d49d0b4cab243dd70a4b53
CANN: add BF16 support for core operators (#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.
ggml/src/ggml-cann/aclnn_ops.cpp
ggml/src/ggml-cann/ggml-cann.cpp