]> git.djapps.eu Git - pkg/ggml/sources/ggml/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>
Fri, 5 Sep 2025 09:54:09 +0000 (12:54 +0300)
commit79bfa5a4401654e3e10e6dd07fe95118e823b434
tree847aa47dac752b83503a6d8f4b92a18edcae356d
parentbcfb7b45dc583d7a91f515f4613faa29fa8d4e1b
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
src/ggml-cann/aclnn_ops.cpp
src/ggml-cann/common.h
src/ggml-cann/ggml-cann.cpp