]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
CANN: fix RoPE cache issue on multi-device (llama/15629)
authorhipudding <redacted>
Mon, 1 Sep 2025 00:57:00 +0000 (08:57 +0800)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:42:45 +0000 (13:42 +0300)
commited7ebdc757be86ad3d227021247b804b377edb20
tree14275279eeb2bf6327f935bac0bf0aab877f91d3
parent3d470687de33d800beb3ac537493b542d7ac41d4
CANN: fix RoPE cache issue on multi-device (llama/15629)

* CANN: fix RoPE cache issue on multi-device

RoPE cache only needs to be computed once per token.
However, in multi-device scenarios, not every device starts
computation from layer 0, which may lead to unallocated memory
issues and precision errors.

This commit records the first layer of each device to avoid
the above issues.

* CANN: Optimize first-layer detection method

* CANN: Remove trailing whitespace

* CANN: Only cache the data that can be determined as unchanged through the parameters.

* CANN: Update function comment
ggml/src/ggml-cann/aclnn_ops.cpp
ggml/src/ggml-cann/common.h
ggml/src/ggml-cann/ggml-cann.cpp