Skip to content

Add kDLAscend for Huawei Ascend NPU device memory - #189

Open
voidLitchi wants to merge 1 commit into
dmlc:mainfrom
voidLitchi:add-ascend-npu
Open

Add kDLAscend for Huawei Ascend NPU device memory#189
voidLitchi wants to merge 1 commit into
dmlc:mainfrom
voidLitchi:add-ascend-npu

Conversation

@voidLitchi

Copy link
Copy Markdown

Motivation

Huawei Ascend integrations currently have no dedicated DLDeviceType and
therefore have to represent Ascend device memory using kDLExtDev.
Because kDLExtDev is shared by unrelated extension backends, it cannot
uniquely identify Ascend memory when tensors are exchanged across frameworks
and runtime integrations.

This PR adds kDLAscend = 21 as the dedicated device type for Huawei Ascend
NPU device memory. It only extends the enumeration and does not change any
existing enum value or ABI layout.

Naming

kDLAscend uses the official and unambiguous Ascend platform name. A generic
name such as kDLNPU would be ambiguous across NPU vendors, while
kDLAscendNPU would repeat the device category without adding identifying
information. kDLCANN was 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 use kDLAscend for
DLPack import and export instead of overloading kDLExtDev. Other consumers,
including TVM-FFI and TileLang integrations, can then adopt the same
standardized device identity.

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 rgommers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants