[GH-ISSUE #2197] [Bug]: 华为昇腾,开启ascend_use_fabric_mem时,使用dummy-client卸载ssd,出现unmap 崩溃 #604

Closed
opened 2026-10-29 21:17:06 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @xuyucheng220 on GitHub (May 23, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2197

Bug Report

初步分析原因:
mooncake-store/src/real_client.cpp中在 FabricMem=1 时跳过 RegisterLocalMemory:
if (!globalConfig().ascend_use_fabric_mem) {
auto result = client_->RegisterLocalMemory(mapped_va, mem_size, "npu",
false, true);
if (!result.has_value()) {
LOG(ERROR) << "Failed to register memory";
(void)aclrtIpcMemClose(ipc_key_bytes.data());
return tl::unexpected(result.error());
}
LOG(INFO) << "RegisterLocalMemory for ipc shm, va:" << mapped_va;
}

但是Unmap 时 teardown_ascend_shm_buffer 始终调 unregisterLocalMemory,没有判断是否开启了fabricMem:
void RealClient::teardown_ascend_shm_buffer(MappedShm &shm) {
#ifdef USE_ASCEND_DIRECT
(void)ContextManager::getInstance().setCurrentContextByPhysicalId(
shm.device_id);
if (shm.shm_size > 0 && client_) {
auto res = client_->unregisterLocalMemory(shm.shm_buffer, true);
if (!res) {
LOG(WARNING)
<< "Failed to unregister local memory for shared memory: "
<< shm.shm_name << ", error: " << toString(res.error());
}
}

Before submitting...

  • Ensure you searched for relevant issues and read the [documentation]
Originally created by @xuyucheng220 on GitHub (May 23, 2026). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2197 ### Bug Report 初步分析原因: mooncake-store/src/real_client.cpp中在 FabricMem=1 时跳过 RegisterLocalMemory: if (!globalConfig().ascend_use_fabric_mem) { auto result = client_->RegisterLocalMemory(mapped_va, mem_size, "npu", false, true); if (!result.has_value()) { LOG(ERROR) << "Failed to register memory"; (void)aclrtIpcMemClose(ipc_key_bytes.data()); return tl::unexpected(result.error()); } LOG(INFO) << "RegisterLocalMemory for ipc shm, va:" << mapped_va; } 但是Unmap 时 teardown_ascend_shm_buffer 始终调 unregisterLocalMemory,没有判断是否开启了fabricMem: void RealClient::teardown_ascend_shm_buffer(MappedShm &shm) { #ifdef USE_ASCEND_DIRECT (void)ContextManager::getInstance().setCurrentContextByPhysicalId( shm.device_id); if (shm.shm_size > 0 && client_) { auto res = client_->unregisterLocalMemory(shm.shm_buffer, true); if (!res) { LOG(WARNING) << "Failed to unregister local memory for shared memory: " << shm.shm_name << ", error: " << toString(res.error()); } } ### Before submitting... - [ ] Ensure you searched for relevant issues and read the [documentation]
bsakaguchi 2026-10-29 21:17:06 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ascend-direct-dev commented on GitHub (May 25, 2026):

unregisterLocalMemory has special handling — if the memory was not registered, it is skipped and will not cause problems. However, we suggest identifying the root cause.

<!-- gh-comment-id:4531053520 --> @ascend-direct-dev commented on GitHub (May 25, 2026): unregisterLocalMemory has special handling — if the memory was not registered, it is skipped and will not cause problems. However, we suggest identifying the root cause.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#604
No description provided.