mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4046] [Bug]: Ascend transfer engine fails to register host memory (wildcard probe hard-error + misaligned malloc fallback) #1028
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#1028
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gygdh-001 on GitHub (Sep 11, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4046
Environment
kvcache-ai/Mooncakemain(mooncake-transfer-engine-npuwheel / source build)ascend/rdma/tcp(host-memory buffers)Description
Two defects prevent host (CPU) memory from being registered/transferred on the Ascend
transfer engine:
1. Wildcard location probe failure is a hard error instead of falling back to host memory
AscendDirectTransport::ResolveAscendMemType()inmooncake-transfer-engine/src/transport/ascend_transport/ascend_direct_transport/ascend_direct_transport.cppuses
CHECK_ACL(aclrtPointerGetAttributes(addr, &attributes))for the wildcardlocation
"*". When the buffer is host memory that is not managed by ACL (hugepage,shm, or plain
malloc),aclrtPointerGetAttributesfails, soResolveAscendMemTypereturns an error and registration fails (in some code paths this surfaces as
location:* is not supported).CUDA already falls back to host memory when the wildcard probe cannot identify the
address; Ascend should behave the same way. The same pattern was previously applied to
the heterogeneous RDMA transport in PR #1657.
2. Default allocator is not 64KB-aligned, breaking Ascend SVM
initMemoryAllocator()inmooncake-integration/transfer_engine/transfer_engine_py.cppfalls back to plainmallocfor protocols such asrdma/tcp/ascend. Ascend SVM(
_devmm_mem_remote_map) requires a 64KB page-alignedsrc_va(page_size == 65536);an unaligned
mallocaddress makesaclrtHostRegisterfail with EINVAL("Src_va is zero or not page alignment"), cascading into
HCCL HcclMemRegRoce/GE channelerrors (e.g. 503900).Steps to reproduce
allocate_managed_bufferon a host bufferwith protocol
tcp/ascend) so that a host buffer is registered with the wildcardlocation
"*".aclrtPointerGetAttributeserror /location:* is not supported), and, on the cross-card SVM path, theaclrtHostRegisterEINVALalignment failure.
Expected behavior
identify the address (matching CUDA and the heterogeneous-RDMA transport).
Proposed fix
See the linked PR. Two surgical changes:
ResolveAscendMemType(): treataclrtPointerGetAttributesfailure as host memoryinstead of a hard error.
initMemoryAllocator(): useposix_memalign(64 * 1024, ...)instead ofmalloc.@github-actions[bot] commented on GitHub (Sep 11, 2026):
Thanks for opening this issue, @gygdh-001!
43057576A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@gygdh-001 commented on GitHub (Sep 11, 2026):
Superseded - split into #4054 (wildcard probe) and #4055 (64KB alignment).