]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CANN: fix RoPE cache issue on multi-device (#15629)
authorhipudding <redacted>
Mon, 1 Sep 2025 00:57:00 +0000 (08:57 +0800)
committerGitHub <redacted>
Mon, 1 Sep 2025 00:57:00 +0000 (08:57 +0800)
commit3dc7397a2799bdc07bccf637ab7ae5a1e786d1a4
tree8b2e27d67f9a219cbf2385e8515d1a680f393fef
parente92d53b29e393fc4c0f9f1f7c3fe651be8d36faa
CANN: fix RoPE cache issue on multi-device (#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