]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CANN: Use smart pointers to manage ACL objects (#17238)
authorhipudding <redacted>
Mon, 17 Nov 2025 00:43:59 +0000 (08:43 +0800)
committerGitHub <redacted>
Mon, 17 Nov 2025 00:43:59 +0000 (08:43 +0800)
commit2376b7758c58b0ede05de382bf72bb538f11ef9a
tree943a4a7327ead1e59288904163ecb442a199a701
parentdbed61294abbc91b93aef64047bf2fecbf44b48b
CANN: Use smart pointers to manage ACL objects (#17238)

* CANN: Use smart pointers to manage ACL objects

Previously, ACL objects were managed via manual destruction, which
led to multiple memory-leak issues during runtime. This patch replaces
manual memory management with smart pointers so that ACL objects
are properly released and ownership is clearly defined.

Note that the ownership of an ACL object belongs to the function
that creates it. Other internal functions should operate on these ACL
objects using raw pointers to avoid unintended ownership transfers.

Additionally, since aclTensorList automatically frees its contained
aclTensor objects, any aclTensor added to a tensor list must release
ownership to avoid double free operations.

This PR also removes the asynchronous task submission mechanism.
Due to changes in recent CANN versions, tiling time has significantly
decreased. Even with a dual-thread submission model, the dispatch
overhead still falls on the critical path, making async submission
less beneficial. Moreover, aclGraph support provides a much better
path to reducing operator dispatch latency.

* CANN: resolve review comments
ggml/src/ggml-cann/Doxyfile [deleted file]
ggml/src/ggml-cann/acl_tensor.cpp
ggml/src/ggml-cann/acl_tensor.h
ggml/src/ggml-cann/aclnn_ops.cpp
ggml/src/ggml-cann/aclnn_ops.h
ggml/src/ggml-cann/common.h
ggml/src/ggml-cann/ggml-cann.cpp