]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CANN: Refactor ND to NZ workspace to be per-device (#15763)
authorChenguang Li <redacted>
Thu, 4 Sep 2025 12:20:14 +0000 (20:20 +0800)
committerGitHub <redacted>
Thu, 4 Sep 2025 12:20:14 +0000 (20:20 +0800)
commitc1c354e44c06d259679bb5bb7a8fa9f0b28480e4
tree749937afbd85fcdabf17118f79b8a0947a623901
parenta68d9144262f1d0ef4f6ba7ad4a7e73e977ba78c
CANN: Refactor ND to NZ workspace to be per-device (#15763)

* CANN:Refactor ND to NZ workspace to be per-device in Ascend backend

- Replaced the previous single global ND→NZ workspace with a per-device
  cache using unordered_map keyed by device ID.
- Functions `release_nz_workspace`, `relloc_nz_workspace`, and
  `get_nz_workspace` now manage workspace independently for each device,
  preventing memory conflicts in multi-device / pipeline parallel scenarios.
- This change fixes potential precision issues caused by workspace
  overwrites when multiple devices perform ND→NZ conversions concurrently.

Co-authored-by: hipudding <redacted>
* refactor

Signed-off-by: noemotiovon <redacted>
* rename

Signed-off-by: noemotiovon <redacted>
* fix review comments

Signed-off-by: noemotiovon <redacted>
---------

Signed-off-by: noemotiovon <redacted>
Co-authored-by: hipudding <redacted>
ggml/src/ggml-cann/ggml-cann.cpp