Welcome to DLPack’s documentation!¶
Purpose¶
In order for an ndarray system to interact with a variety of frameworks, a stable in-memory data structure is needed.
DLPack is one such data structure that allows exchange between major frameworks. It is developed with inputs from many deep learning system core developers. Highlights include:
Minimum and stable: simple header
Designed for cross hardware: CPU, CUDA, OpenCL, Vulkan, Metal, VPI, ROCm, WebGPU, Hexagon
Already a standard with wide community adoption and support:
Clean C ABI compatible.
Means you can create and access it from any language.
It is also essential for building JIT and AOT compilers to support these data types.
Scope¶
The main design rationale of DLPack is the minimalism. DLPack drops the consideration of allocator, device API and focus on the minimum data structure. While still considering the need for cross hardware support (e.g. the data field is opaque for platforms that does not support normal addressing).
It also simplifies some of the design to remove legacy issues (e.g. everything assumes to be row major, strides can be used to support other case, and avoid the complexity to consider more layouts).
Roadmap¶
C API that could be exposed as a new Python attribute
__dlpack_info__
for returning API and ABI versions. (see #34, #72)Clarify alignment requirements. (see data-apis/array-api#293, numpy/numpy#20338, data-apis/array-api#293 (comment))
Adding support for boolean data type (see #75)
Adding a read-only flag (ABI break) or making it a hard requirement in the spec that imported arrays should be treated as read-only. (see data-apis/consortium-feedback#1 (comment), data-apis/array-api#191)