]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
CANN: Refactor ND to NZ workspace to be per-device (llama/15763)
authorChenguang Li <redacted>
Thu, 4 Sep 2025 12:20:14 +0000 (20:20 +0800)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:14 +0000 (12:54 +0300)
commit2df7473b5c3b691db3fb966340b558ba9043b8d7
tree26577c0e484f4701ea94c57e81c8b2b0017e013c
parent0e2040fb0c48f94145e387d6bfe27b0fb5f0997c
CANN: Refactor ND to NZ workspace to be per-device (llama/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>
src/ggml-cann/ggml-cann.cpp