Add kDLAscend for Huawei Ascend NPU device memory - #189
Open
voidLitchi wants to merge 1 commit into
Open
Conversation
This can be used to exchange buffers between Ascend integrations such as torch_npu, TVM-FFI, and TileLang without overloading kDLExtDev. kDLExtDev is shared by unrelated extension backends and cannot uniquely identify Ascend device memory.
rgommers
approved these changes
Jul 29, 2026
rgommers
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @voidLitchi. This looks like a logical choice to me. The one question I have is if this is aligned with other maintainers focused on Ascend - can you comment or Cc a couple of the relevant Huawei devs please?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Huawei Ascend integrations currently have no dedicated
DLDeviceTypeandtherefore have to represent Ascend device memory using
kDLExtDev.Because
kDLExtDevis shared by unrelated extension backends, it cannotuniquely identify Ascend memory when tensors are exchanged across frameworks
and runtime integrations.
This PR adds
kDLAscend = 21as the dedicated device type for Huawei AscendNPU device memory. It only extends the enumeration and does not change any
existing enum value or ABI layout.
Naming
kDLAscenduses the official and unambiguous Ascend platform name. A genericname such as
kDLNPUwould be ambiguous across NPU vendors, whilekDLAscendNPUwould repeat the device category without adding identifyinginformation.
kDLCANNwas also avoided because CANN is the software stack,rather than the identity of the device and its memory domain.
This follows the precedent established by
kDLMAIA,where DLPack adopted the released product name instead of a vendor- or
generic-NPU-derived name.
Downstream adoption
After this device type is merged and made available to downstream projects,
we intend to follow up with Ascend integrations—starting with
torch_npu—to usekDLAscendforDLPack import and export instead of overloading
kDLExtDev. Other consumers,including TVM-FFI and TileLang integrations, can then adopt the same
standardized device identity.