]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/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>
Sun, 29 Mar 2026 12:04:36 +0000 (15:04 +0300)
commit46dcb35aa38f10eb5e1eb6f7c2de071e928a60bc
tree75e39bf06532284e47258cc10495e0e12259ff47
parent65d820a44a6c95b88ae121918202fea9b4ba0d10
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.
ggml/src/ggml-cann/aclnn_ops.cpp
ggml/src/ggml-cann/ggml-cann.cpp